Skip to content
Post-quantumml-dsa-44

ML-DSA-44

The smallest ML-DSA parameter set (NIST Security Category 2): 1312-byte public key, 2420-byte signature.

Why it's safe

ML-DSA (formerly Dilithium) is NIST's primary post-quantum signature standard. ML-DSA-44 is the most compact option and is used in some hybrid schemes, such as OpenSSH's ssh-mldsa44-ed25519 (experimental in OpenSSH 10.4, enabled under its final name in 10.6).

Used for
Signature
Family
Lattice (Module-LWE / Module-SIS)
Classical security
128 bits
Against a quantum computer
~128 bits
Standards
FIPS 204, RFC 9881 (X.509), RFC 9964 (JOSE/COSE)
Read the guideThe new standards: ML-KEM, ML-DSA, SLH-DSA and friends

Migration guides

How to adopt ML-DSA-44. Pick your stack.

JOSE / JWT libraries (e.g. jose) · javascriptJWT/JOSE: what the post-quantum state is, and how to get ready without breaking loginsExperimental

Why

JWTs signed with RS256/PS256 or ES256/EdDSA can be forged once a large quantum computer can recover the issuer's private key from its published JWKS. Tokens are short-lived, so this is not a harvest-now-decrypt-later problem: the deadline is "before such a machine exists", not today. But identity systems are slow to change, so preparation pays off.

State of standards (late 2026):

  • RFC 9964 ("ML-DSA for JOSE and COSE", 2026) registers the JWS algorithms ML-DSA-44, ML-DSA-65 and ML-DSA-87 and a new JWK key type AKP (Algorithm Key Pair).
  • Composite (hybrid) ML-DSA + ECDSA/EdDSA signatures for JOSE/COSE are still an IETF draft (draft-ietf-jose-pq-composite-sigs).
  • Library support is emerging. For example, the jose npm package supports the ML-DSA JWS identifiers since v6.1.0 where the JavaScript runtime's WebCrypto implements ML-DSA. Most identity providers, API gateways and OIDC client libraries do not yet issue or accept ML-DSA tokens.

Steps

  1. Inventory issuers and verifiers: npx -y pqe-cli scan . flags RS*/ES*/HS* usage. List every service that validates your tokens.
  2. Make algorithms configuration, not code. Verifiers should take an allow-list of algorithms and fetch keys from a JWKS by kid. Never accept alg blindly from the token header (RFC 8725).
  3. Practise key rotation now (publish a new kid, sign with it, retire the old one). The PQ migration is a rotation where the new key has a new algorithm.
  4. First-party tokens: if the issuer and verifier are the same organisation and can share a secret, HS256 with a random 256-bit secret is already quantum-safe.
  5. Pilot ML-DSA where both ends are yours: add ML-DSA-65 (or ML-DSA-44 if size matters) to verifier allow-lists, publish an AKP key in the JWKS, then switch signing.
  6. Third-party IdPs (Auth0/Okta/Entra/Cognito/Keycloak...): track their roadmaps; keep your verifiers ready to accept new algorithms.

Before

js
import { SignJWT, jwtVerify, createRemoteJWKSet } from 'jose';

const token = await new SignJWT({ sub: 'user-1' })
  .setProtectedHeader({ alg: 'RS256', kid: 'rsa-2024' })
  .setExpirationTime('15m')
  .sign(rsaPrivateKey);

const JWKS = createRemoteJWKSet(new URL('https://issuer.example/.well-known/jwks.json'));
await jwtVerify(token, JWKS); // accepts whatever alg the key allows

After (agile verifier; ML-DSA where supported)

js
import { SignJWT, jwtVerify, createRemoteJWKSet, generateKeyPair } from 'jose';

// Verifier: explicit allow-list that can grow without a code change
const ALLOWED = (process.env.JWT_ALGS ?? 'RS256,ML-DSA-65').split(',');
const JWKS = createRemoteJWKSet(new URL('https://issuer.example/.well-known/jwks.json'));
const { payload } = await jwtVerify(token, JWKS, { algorithms: ALLOWED, issuer: 'https://issuer.example' });

// Issuer (pilot): requires a jose version and runtime with ML-DSA support (e.g. recent Node 24+)
const { privateKey } = await generateKeyPair('ML-DSA-65');
const pqToken = await new SignJWT({ sub: 'user-1' })
  .setProtectedHeader({ alg: 'ML-DSA-65', kid: 'mldsa-2026' })
  .setExpirationTime('15m')
  .sign(privateKey);

Gotchas

  • Size. An ML-DSA-65 signature is 3,309 bytes, about 4.4 KB once base64url-encoded, against 342 characters for RS256. Tokens in cookies (4 KB browser limit per cookie) or HTTP headers (proxies often cap total headers at 8-16 KB) may break. ML-DSA-44 is smaller (2,420-byte signatures) but still large; consider reference tokens or token exchange at the edge.
  • JWKS size grows too: an ML-DSA-65 public key is 1,952 bytes.
  • Do not invent algorithm names. Use the registered ML-DSA-44/65/87 identifiers from RFC 9964; pre-RFC drafts used other names and key types.
  • Encrypted JWTs (JWE) with RSA-OAEP or ECDH-ES key management are a harvest-now-decrypt-later risk if tokens carry sensitive data and are stored; prefer not putting secrets in tokens, or plan PQ key management once standardised for JOSE.
  • HS256 pitfalls: weak or shared-everywhere secrets, and algorithm-confusion bugs; follow RFC 8725.

Verify

Decode a token header (echo $TOKEN | cut -d. -f1 | base64 -d) to see alg and kid, run your verifier tests with both the classical and the ML-DSA key in the JWKS, and measure the largest token size against your cookie and header limits.

node:crypto / @noble/post-quantum · javascriptNode.js: sign and verify with ML-DSA-65 (node:crypto on Node 24.6+, or @noble/post-quantum)Production-ready

Why

ECDSA, Ed25519 and RSA signatures will be forgeable once a large quantum computer exists. Signatures are not exposed to "harvest now, decrypt later", but anything that must stay trustworthy for years (software updates, firmware, documents, long-lived API keys, internal PKI) needs a post-quantum path. ML-DSA (FIPS 204) is the standard general-purpose replacement; ML-DSA-65 is the common default.

Node.js supports ML-DSA natively in node:crypto from 24.6.0 (key generation, crypto.sign, crypto.verify) when built with OpenSSL 3.5+, which all official Node 24 and 26 builds are. @noble/post-quantum works on any runtime, including Node 22 and browsers.

Steps

  1. Add an algorithm identifier to everything you sign (a header field, a key ID that maps to an algorithm), so verifiers know which algorithm to use. This is the crypto-agility step that makes later swaps cheap.
  2. Generate an ML-DSA-65 key pair and distribute the public key alongside (not instead of) the old one.
  3. Sign new artifacts with ML-DSA, or with both algorithms during the transition ("dual signing"); teach verifiers to accept either.
  4. Once all verifiers understand ML-DSA, stop issuing classical signatures.

Before

js
import { generateKeyPairSync, sign, verify } from 'node:crypto';

const { publicKey, privateKey } = generateKeyPairSync('ed25519');
const sig = sign(null, data, privateKey);           // 64 bytes
const ok = verify(null, data, publicKey, sig);

After: node:crypto (Node 24.6+)

js
import { generateKeyPairSync, sign, verify } from 'node:crypto';

const { publicKey, privateKey } = generateKeyPairSync('ml-dsa-65');
const sig = sign(null, data, privateKey);           // algorithm must be null/undefined: 3309 bytes
const ok = verify(null, data, publicKey, sig);

// Optional domain separation (FIPS 204 "context", up to 255 bytes; Node 24.8+):
const sig2 = sign(null, data, { key: privateKey, context: Buffer.from('myapp/release/v1') });
verify(null, data, { key: publicKey, context: Buffer.from('myapp/release/v1') }, sig2);

// Keys export as usual
const spkiPem = publicKey.export({ type: 'spki', format: 'pem' });

After: @noble/post-quantum (any runtime)

js
import { ml_dsa65 } from '@noble/post-quantum/ml-dsa.js';

const keys = ml_dsa65.keygen();                     // publicKey 1952 B, secretKey 4032 B
const sig = ml_dsa65.sign(data, keys.secretKey);    // 0.5.x argument order: (message, secretKey)
const ok = ml_dsa65.verify(sig, data, keys.publicKey);

Gotchas

  • Size. ML-DSA-65 signatures are 3,309 bytes and public keys 1,952 bytes, against 64 and 32 bytes for Ed25519 and 256 bytes for an RSA-2048 signature. Check HTTP header limits (many proxies cap headers at 8-16 KB), JWT/cookie sizes, database columns (VARBINARY(256) will not do) and QR codes.
  • Need tiny signatures or extreme conservatism? FN-DSA (Falcon, FIPS 206) will give ~666-byte signatures but is not final yet. SLH-DSA (FIPS 205) relies only on hashes but signatures are 7.8-50 KB.
  • Context strings must match on both sides, or verification fails.
  • Pre-hash variants (HashML-DSA) are different algorithms with different signatures; use plain ML-DSA unless a protocol requires otherwise.
  • HSM/KMS support for ML-DSA is arriving but uneven; check your provider before moving signing keys.
  • Verifiers first. Roll out verification support everywhere before switching signers, otherwise old clients reject new artifacts.

Verify

js
import assert from 'node:assert';
assert.equal(sig.length, 3309);
assert.ok(verify(null, data, publicKey, sig));
assert.ok(!verify(null, Buffer.from('tampered'), publicKey, sig));