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.
Experimental — behind a flag. The post-quantum WebCrypto algorithms are gated on the
WebCryptoPQC runtime feature. To run this for real:
- Quit Chrome, then relaunch with
--enable-blink-features=WebCryptoPQC(in a Chrome/Canary build containing the experimental implementation), or - Join the
WebCryptoAdditionalAlgorithms202606origin trial and add its token to your page.
checking support…
signature
—
not verified yet
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.