English | Português (Brasil)
Expose Curve25519 operations through a function-based TypeScript API.
A WPPConnect Team fork in the WPPConnect ecosystem. Original project credits and license are preserved.
Getting started | Documentation | Contributing | Support WPPConnect
For cryptographic integration developers. This WPPConnect Team fork of privacyresearchgroup/curve25519-typescript exposes named functions instead of the upstream class interface. It supplies curve operations used by the libsignal-protocol fork.
generateKeyPair,sharedSecret,sign,verifyandsignatureIsValidexports.- C implementation compiled to JavaScript with Emscripten.
Use Node.js/npm. Save the local key-agreement example as index.mjs, then run node index.mjs. It prints true without contacting any service.
npm install @wppconnect/curve25519import { randomBytes } from "node:crypto";
import { generateKeyPair, sharedSecret } from "@wppconnect/curve25519";
const alice = generateKeyPair(new Uint8Array(randomBytes(32)));
const bob = generateKeyPair(new Uint8Array(randomBytes(32)));
const a = sharedSecret(bob.pubKey, alice.privKey);
const b = sharedSecret(alice.pubKey, bob.privKey);
console.log(a.every((value, index) => value === b[index]));Inputs are Uint8Array. verify returns true for an invalid signature; prefer signatureIsValid for conventional validity semantics. See tests for vectors. Emscripten is required only to rebuild the C sources using compile.sh.
| Project | Purpose | When to use it |
|---|---|---|
| @wppconnect/libsignal-protocol | Implement Signal Protocol sessions and key handling in TypeScript. | Implement Signal session/key persistence. |
The WPPConnect contribution below supports maintenance of this fork within the ecosystem; it does not imply funding or endorsement of upstream maintainers.
WPPConnect is maintained by an open-source community. Your support helps fund maintenance, infrastructure, documentation, and the people working on the ecosystem.
If WPPConnect helps your project or business, consider making a one-time contribution or becoming a recurring supporter.
Support WPPConnect on Open Collective
Contributions are voluntary. See the official page for current financial information. You can also help with code, tests, documentation, translations and well-described issue reports.
Contributions of code, tests, examples, documentation and translations are welcome. For larger changes, discuss the approach in an issue first. Include the project/runtime versions, a minimal reproduction and sanitized logs when reporting a problem. Update both README.md and README.pt-BR.md in the same change when installation, configuration, features, examples, licensing or funding changes.
After installing the development dependencies, use the repository checks relevant to your change:
npm run build
npm run lint
npm testAccount-dependent examples and tests require separate validation with an authorized test account. Never attach credentials or session files to an issue.
Use repository issues for reproducible bugs and feature proposals. For usage questions, join the community through the official channels:
This project is independent and is not affiliated with or endorsed by WhatsApp or Meta. Follow applicable terms and obtain authorization for account and messaging operations.
GNU General Public License v3.0 only (GPL-3.0-only).
Copyright 2020 Privacy Research, LLC. Based on work by Signal and Privacy Research.
The original legal document and existing copyright notices are preserved. Third-party components retain their own terms.