How it works
Ed25519 is EdDSA, a signature scheme on the twisted Edwards curve edwards25519, which is equivalent to the curve Curve25519 under a change of coordinates. You generate a random 32-byte private key and derive a 32-byte public key from it. To sign, you run the message and the private key through the algorithm. To verify, anyone runs the message, the signature and the public key through the check, which answers yes or no.
RFC 8032 lists its advantages: small public keys and signatures, and no need for a unique random number for each signature. Signing is deterministic. The same key and the same message always give the same 64 bytes, so a weak random number generator cannot leak the private key during signing.
Sizes against RSA-2048
| Ed25519 | RSA-2048 | |
|---|---|---|
| Public key (raw) | 32 bytes | 256-byte modulus plus exponent |
| Signature | 64 bytes | 256 bytes |
| Signature in base64url | 86 characters | 342 characters |
The numbers for Ed25519 come from RFC 8032. The RSA signature length was measured with Node.js below. Small signatures matter when the signature travels inside a token or a header.
Try it in Node.js
import { generateKeyPairSync, sign, verify } from 'node:crypto';
const { publicKey, privateKey } = generateKeyPairSync('ed25519');
const msg = Buffer.from('sgt1.eyJ2IjoxfQ');
const sig = sign(null, msg, privateKey);
console.log(sig.length); // 64
console.log(sign(null, msg, privateKey).equals(sig)); // true, deterministic
console.log(verify(null, msg, publicKey, sig)); // true
console.log(verify(null, Buffer.from('sgt1.eyJ2IjoyfQ'), publicKey, sig)); // false, one character changed
This ran on Node.js 26. The raw public key is the last 32 bytes of the SPKI export, publicKey.export({ format: 'der', type: 'spki' }).subarray(-32).
Ed25519 versus X25519
The names look alike and both sit on the same curve family, but the jobs differ. Ed25519 signs. X25519, defined in RFC 7748, is a Diffie-Hellman function that two parties use to agree on a shared secret. A library that offers one does not always offer the other, so check which you need.
Where it is available
Web Crypto in current browsers, Node.js 20 and later, Deno, Bun and Cloudflare Workers; CryptoKit on Apple platforms (Curve25519.Signing); libsodium, which PHP and PyNaCl wrap; and ed25519-dalek in Rust. The offline verification guide has working code for five of these.
How Clavem handles it
Each Clavem product gets its own Ed25519 key pair. Clavem signs license tokens with the private half, which it encrypts at rest and never shares, and you ship the 32-byte public half in your app. The signature covers the ASCII text sgt1.<payload>. To experiment with keys, use the Ed25519 key generator. For the general idea behind key pairs, see public-key cryptography.
Questions
Is Ed25519 encryption?
No. It signs and verifies. A signed message stays readable; the signature only proves who produced it and that it was not changed.
Why is the same message signed the same way every time?
Ed25519 signatures are deterministic. RFC 8032 notes this protects against attacks that exploit bad randomness during signing.
Which is smaller, an Ed25519 or an RSA-2048 signature?
Ed25519, by a wide margin. A signature is 64 bytes, against 256 bytes for RSA-2048.