Suite25519 is a cryptographic library for real-world assets, engineered to be secure, simple, and efficient. Built under the LEA Blockchain ecosystem, it’s designed for developers needing high-performance crypto tools with minimal overhead.
Powered by the excellent @noble/ciphers, @noble/curves, and @noble/hashes packages, Suite25519 layers on top of these audited, performant libraries to provide a clean, minimal API for developers who need cryptographic capabilities without the overhead.

What It Does
Suite25519 offers a focused suite of cryptographic functions built around Ed25519 and X25519, with support for modern CBOR serialization and isomorphic usage across environments.
This cryptographic library for real-world assets includes…
- Key Pair Generation
Generate Ed25519 key pairs for secure message signing and identity. - Digital Signatures
Sign messages using Ed25519 and verify authenticity with minimal API friction. - Signature Verification
Verify signed payloads to ensure data integrity and source authenticity. - Encryption via ECIES
Encrypt data using Elliptic Curve Integrated Encryption Scheme (X25519 + HKDF-SHA256 + AES-GCM-SIV) to ensure confidentiality and integrity. - Decryption via ECIES
Decrypt incoming payloads encrypted with your public key. - Combined Operations
Need sign-then-encrypt or decrypt-then-verify? Suite25519 makes these compound actions ergonomic and secure. - CBOR Serialization
Leverages cbor for compact, efficient binary encoding. Includes helpers for base64 export/import of keys. - Isomorphic Support
Write once, run anywhere: works in Node.js (v16+) and modern browsers supporting Web Crypto API. Uses native TextEncoder/TextDecoder, and base64 helpers likeatob
/btoa
.
Getting Started
0. Install via npm:
npm install @leachain/suite25519
- Generate Keys & Sign a Message
import { PrivateKey, signMessage } from './suite25519.js';
// Generate a new identity (key pair)
const myPrivateKey = PrivateKey.randomPrivateKey();
const myPublicKey = myPrivateKey.publicKey;
// Create a signature for a message
const message = "This is my message";
const signedPayload = signMessage(message, myPrivateKey, true, true); // Include msg & key
console.log("Message signed successfully! Payload contains signature, message, and public key.");
// You would typically send 'signedPayload' (Uint8Array) to someone who has 'myPublicKey' to verify.For encryption:
2. Encrypt & Decrypt a Message
This demonstrates encrypting a message so only the intended recipient (who holds the corresponding private key) can read it.
import { PrivateKey, encryptMessage, decryptMessage } from './suite25519.js';
// Assume we have the recipient's public key
const recipientPrivateKey = PrivateKey.randomPrivateKey(); // Recipient keeps this secret
const recipientPublicKey = recipientPrivateKey.publicKey; // This is shared publicly
// Encrypt a secret message for the recipient
const secret = "Meet me at midnight";
const encryptedPayload = encryptMessage(secret, recipientPublicKey);
// Only the recipient can decrypt it
const decryptedBytes = decryptMessage(encryptedPayload, recipientPrivateKey);
console.log("Message encrypted and decrypted successfully.");
// console.log("Decrypted:", new TextDecoder().decode(decryptedBytes)); // "Meet me at midnight"
3. Sign-then-Encrypt & Decrypt-then-Verify
This combines signing and encryption. The message is first signed by the sender, then encrypted for the recipient. The recipient decrypts it and then verifies the sender’s signature, ensuring both confidentiality and authenticity.
import { PrivateKey, signAndEncryptMessage, decryptAndVerifyMessage } from './suite25519.js';
// Keys for sender and recipient
const senderPrivateKey = PrivateKey.randomPrivateKey();
const senderPublicKey = senderPrivateKey.publicKey;
const recipientPrivateKey = PrivateKey.randomPrivateKey();
const recipientPublicKey = recipientPrivateKey.publicKey;
// Message to send securely and with proof of origin
const importantMessage = "Order confirmed: #12345";
// Sender signs *then* encrypts
const signedEncryptedPayload = signAndEncryptMessage(
importantMessage,
senderPrivateKey, // Sign with sender's private key
recipientPublicKey // Encrypt for recipient's public key
);
// Recipient decrypts *then* verifies
const originalVerifiedBytes = decryptAndVerifyMessage(
signedEncryptedPayload,
recipientPrivateKey, // Decrypt with recipient's private key
senderPublicKey // Verify against sender's public key
);
console.log("Message securely transmitted and sender verified.");
// console.log("Original Message:", new TextDecoder().decode(originalVerifiedBytes)); // "Order confirmed: #12345"
Learn More
Whether you’re building with LEA or elsewhere, Suite25519 is a cryptographic library for real-world assets that prioritizes security and simplicity.
Check out the documentation or explore the source code on GitHub. Suite25519 is under active development with security and simplicity at its core.
If you’re building with LEA, or just need reliable crypto primitives with an easy API, Suite25519 has your back.
Secure. Simple. Suite25519.