v151 · security · post-quantum

ML-DSA Post-Quantum Signatures

ML-DSA (FIPS 204) is a lattice-based digital-signature scheme that stays secure against a quantum adversary. This demo generates a real ML-DSA key pair, signs your message with crypto.subtle.sign, and verifies it with crypto.subtle.verify — then lets you tamper with the message or signature and watch verification reject it.

checking support…

signature

the code

// Generate an ML-DSA key pair
const { publicKey, privateKey } = await crypto.subtle.generateKey(
  { name: "ML-DSA-65" }, true, ["sign", "verify"]);

const data = new TextEncoder().encode(message);

// Sign with the private key
const signature = await crypto.subtle.sign("ML-DSA-65", privateKey, data);

// Verify with the public key → true only if message + signature are intact
const ok = await crypto.subtle.verify("ML-DSA-65", publicKey, signature, data);

ML-DSA signatures are large (a few kilobytes) compared with ECDSA, but they are believed secure even against an attacker with a large-scale quantum computer — the whole point of migrating signature schemes now, before such a machine exists.

see also

references