TExcelTAD
Home › Applied Cryptography: Ciphers, Hashes, Signatures, PKI & TLS › Post-Quantum Migration: ML-KEM, ML-DSA and SLH-DSA

Post-Quantum Migration: ML-KEM, ML-DSA and SLH-DSA

RSA, Diffie–Hellman, ECDH, ECDSA and Ed25519 all rest on two problems, factoring and discrete logarithms, that a large enough quantum computer running Shor's algorithm would solve efficiently. No such machine exists in 2026, and estimates of when one might range from about a decade to never. But data encrypted today with X25519 can be recorded today and decrypted later, and replacing the public-key cryptography of a whole organisation takes years. That is why the migration has started already.

What quantum computers break, and what they don't

Classical attack Quantum attack Action
RSA, DH, ECDH, X25519 infeasible at current sizes Shor: polynomial time replace key exchange with ML-KEM (hybrid for now)
RSA, ECDSA, Ed25519 signatures infeasible Shor: forge signatures replace with ML-DSA or SLH-DSA
AES-128 21282^{128} Grover: about 2642^{64} quantum steps, impractical in parallel AES-256 for long-term margin
AES-256, SHA-256, SHA-3, HMAC infeasible Grover: square-root speedup at best keep
Argon2id, scrypt per-guess cost small speedup keep

Symmetric cryptography and hashes survive with larger parameters; public-key cryptography must be replaced.

The new standards

NIST ran an open competition from 2016 and published the first three post-quantum standards on 13 August 2024:

Standard Based on Type Typical sizes (security category 3, roughly AES-192)
FIPS 203 ML-KEM (from CRYSTALS-Kyber) module lattices (Module-LWE) key encapsulation ML-KEM-768: public key 1,184 B, ciphertext 1,088 B, shared secret 32 B
FIPS 204 ML-DSA (from CRYSTALS-Dilithium) module lattices signatures ML-DSA-65: public key 1,952 B, signature 3,309 B
FIPS 205 SLH-DSA (from SPHINCS+) hash functions only stateless hash-based signatures SLH-DSA-128s (category 1): public key 32 B, signature 7,856 B; slow to sign

A fourth, FN-DSA (from Falcon, smaller lattice signatures), is being standardised as FIPS 206, and in 2025 NIST selected HQC, a code-based KEM, as a backup to ML-KEM. Stateful hash-based signatures (LMS, XMSS; NIST SP 800-208) are already approved for firmware signing, where a device signs few messages and can keep state.

A KEM (key encapsulation mechanism) replaces Diffie–Hellman in protocols: the client generates a key pair, the server encapsulates a random shared secret to the public key and returns the ciphertext, and the client decapsulates it. The sizes are the visible cost: an ML-KEM-768 key share is 1,184 bytes against 32 for X25519, which made some old middleboxes fail when the ClientHello no longer fit in one packet.

The lattice idea on a toy

ML-KEM's security rests on learning with errors (LWE): given many pairs (ai,bi)(a_i, b_i) with bi=⟨ai,s⟩+ei mod qb_i = \langle a_i, s \rangle + e_i \bmod q for a secret vector ss and small random errors eie_i, find ss. Without the errors it is linear algebra; with them, for large dimensions, no efficient classical or quantum algorithm is known. The toy below is Regev's 2005 encryption scheme with dimension 8 and q=97q = 97, numbers so small that it is trivially breakable; real ML-KEM uses polynomial rings with n=256n = 256, q=3329q = 3329 and a module rank of 2 to 4. The theory is in Learning with Errors.

python · try it yourself
import random
rng = random.Random(7)                     # fixed seed: a deterministic toy, not real ML-KEM
q, n = 97, 8                               # toy modulus and dimension (ML-KEM: q = 3329, n = 256, module rank 2-4)
s = [rng.randrange(q) for _ in range(n)]   # secret vector
def sample():                              # public LWE sample: (a, <a,s> + small error)
    a = [rng.randrange(q) for _ in range(n)]
    e = rng.choice([-1, 0, 1])
    return a, (sum(x * y for x, y in zip(a, s)) + e) % q
pub = [sample() for _ in range(20)]

def encrypt(bit):                          # Regev-style: add a random subset of samples, plus bit * q/2
    subset = [p for p in pub if rng.random() < 0.5]
    a = [sum(p[0][i] for p in subset) % q for i in range(n)]
    b = (sum(p[1] for p in subset) + bit * (q // 2)) % q
    return a, b
def decrypt(ct):
    a, b = ct
    v = (b - sum(x * y for x, y in zip(a, s))) % q
    return 1 if q // 4 < v < 3 * q // 4 else 0

bits = [1, 0, 1, 1, 0, 0, 1, 0]
print("sent     :", bits)
print("decrypted:", [decrypt(encrypt(b)) for b in bits])
sent     : [1, 0, 1, 1, 0, 0, 1, 0]
decrypted: [1, 0, 1, 1, 0, 0, 1, 0]

Decryption subtracts ⟨a,s⟩\langle a, s \rangle and is left with the bit times q/2q/2 plus the sum of the small errors; as long as the errors stay below q/4q/4, rounding recovers the bit. Choosing the error size so decryption almost never fails while the problem stays hard is exactly what the ML-KEM parameters do.

Hybrids and "harvest now, decrypt later"

The new algorithms are young; a classical break can't be ruled out (SIKE, an isogeny-based candidate that reached NIST's fourth round, was broken classically in 2022 in about an hour on a single core). So the first deployments are hybrid: run X25519 and ML-KEM-768 and feed both shared secrets into the key schedule. An attacker must break both.

  • TLS: the hybrid group X25519MLKEM768 (RFC 10024, 2026, from draft-ietf-tls-ecdhe-mlkem; IANA code point 0x11EC = 4588) is on by default in Chrome (since version 131, late 2024), Firefox (desktop since version 132), Apple's networking APIs in iOS 26 and macOS 26 (2025), Cloudflare, and OpenSSL 3.5 (2025). A large share of browser traffic to big sites already uses it.
  • SSH: OpenSSH made the hybrid sntrup761x25519-sha512 its default key exchange in OpenSSH 9.0 (2022) and switched the default to mlkem768x25519-sha256 in OpenSSH 10.0 (April 2025).
  • Messaging: Signal's PQXDH (2023) and Apple's iMessage PQ3 (2024).

Key exchange comes first because of harvest now, decrypt later: anything recorded today is exposed the day a quantum computer exists, while a signature only needs to be unforgeable at the moment it is checked. The exception is long-lived signatures: firmware roots of trust, signed archives and documents that must stay verifiable for decades.

Timelines

  • NIST IR 8547 (draft November 2024, final October 2026) deprecates quantum-vulnerable public-key algorithms (RSA, ECDSA, EdDSA, DH, ECDH) after 2030 and disallows them under NIST standards after 2035. US federal high-value systems have earlier deadlines (post-quantum key establishment by the end of 2030, signatures by the end of 2031).
  • The NSA's CNSA 2.0 requires ML-KEM-1024 and ML-DSA-87 for US national security systems, with milestones from 2025 (software and firmware signing should prefer it) to 2033 for exclusive use in the last product categories, and all national security systems quantum-resistant by 2035.
  • The EU's coordinated roadmap (2025) asks member states to start transitions by 2026 and to finish for high-risk systems by 2030.

How migration readiness is assessed

  • Crypto inventory (a "cryptographic bill of materials"): every protocol, key and library, with its algorithm, owner and data lifetime. The toy classifier below turns an inventory of lab systems into priorities.
  • Data lifetime analysis (Mosca's inequality): if the time data must stay secret plus the time migration takes exceeds the time until a quantum computer exists, you are already late.
  • Agility checks: can each system change algorithms by configuration? Hard-coded RSA in firmware or protocols is the long pole.
  • Network tests: do middleboxes, load balancers and HSMs handle large ClientHellos, KEM ciphertexts and ML-DSA certificates?
python · try it yourself
# A crypto inventory (synthetic, lab systems) classified for the post-quantum migration.
INVENTORY = [
    ("www.lab.test TLS key exchange", "X25519"),
    ("www.lab.test certificate", "RSA-2048"),
    ("vpn.lab.test IKEv2", "ECDH P-256"),
    ("backup encryption", "AES-256-GCM"),
    ("password storage", "Argon2id"),
    ("code signing", "ECDSA P-256"),
    ("archive of signed contracts (kept 30 years)", "RSA-3072 PSS"),
    ("browser to CDN", "X25519MLKEM768"),
    ("file integrity", "SHA-256"),
]
SHOR = {"X25519", "RSA-2048", "ECDH P-256", "ECDSA P-256", "RSA-3072 PSS"}      # broken by Shor's algorithm
PQ = {"X25519MLKEM768", "ML-KEM-768", "ML-DSA-65", "SLH-DSA"}
def classify(name, alg):
    if alg in PQ: return "OK (post-quantum or hybrid)"
    if alg not in SHOR: return "OK (symmetric/hash: keep 256-bit)"
    kex = any(w in alg for w in ("X25519", "ECDH")) or "IKE" in name
    return "PRIORITY 1: harvest now, decrypt later" if kex else "migrate signatures (ML-DSA / SLH-DSA)"
for name, alg in INVENTORY:
    print(f"{name:44} {alg:15} {classify(name, alg)}")
www.lab.test TLS key exchange                X25519          PRIORITY 1: harvest now, decrypt later
www.lab.test certificate                     RSA-2048        migrate signatures (ML-DSA / SLH-DSA)
vpn.lab.test IKEv2                           ECDH P-256      PRIORITY 1: harvest now, decrypt later
backup encryption                            AES-256-GCM     OK (symmetric/hash: keep 256-bit)
password storage                             Argon2id        OK (symmetric/hash: keep 256-bit)
code signing                                 ECDSA P-256     migrate signatures (ML-DSA / SLH-DSA)
archive of signed contracts (kept 30 years)  RSA-3072 PSS    migrate signatures (ML-DSA / SLH-DSA)
browser to CDN                               X25519MLKEM768  OK (post-quantum or hybrid)
file integrity                               SHA-256         OK (symmetric/hash: keep 256-bit)

In a real plan, the 30-year signed archive would move up: its signatures must remain trustworthy long after a quantum computer could forge RSA.

How the migration is done

  1. Inventory and prioritise (key exchange for long-lived secrets first, then long-lived signatures).
  2. Turn on hybrid key exchange where libraries support it (TLS 1.3 with X25519MLKEM768, OpenSSH's default); test middleboxes.
  3. Make formats and protocols agile: algorithm ids, version fields, room for larger keys and signatures.
  4. Plan PKI changes with your CAs and HSM vendors (ML-DSA certificates, composite or dual certificates).
  5. Move symmetric keys to 256 bits where data lives long.

Pitfalls

  • Waiting for "quantum day" to start: inventories alone take years in large organisations.
  • Rolling your own post-quantum code: these schemes are new, and side channels in early implementations (KyberSlash, 2024, a timing leak in several Kyber implementations) have already been found. Use vetted libraries.
  • Dropping the classical half too early: hybrids protect against a surprise break of the new schemes.

Practice

1. Medical records encrypted in transit today must stay confidential for 25 years. Your migration will take 5 years. What does Mosca's inequality say if a quantum computer might exist in 15 years?

25+5=30>1525 + 5 = 30 > 15: data sent today is at risk, so hybrid key exchange should be deployed for that traffic now.

2. Why are AES-256 and SHA-256 not on the list of algorithms to replace?

The best known quantum attack on them is Grover's search, a square-root speedup that is impractical to parallelise; 256-bit keys and digests keep a large margin. Only the public-key algorithms fall to Shor's algorithm.

3. In the LWE toy, what would happen if the errors were drawn from a much wider range, say up to $\pm 30$?

Sums of errors would often exceed q/4≈24q/4 \approx 24, so decryption would round to the wrong bit: the scheme stops being correct. Real parameters balance error size (security) against decryption failures (correctness).

Test yourself

Which algorithms does Shor's algorithm break?

  1. AES and SHA-256
  2. RSA, Diffie-Hellman and elliptic-curve schemes
  3. Argon2id
  4. HMAC

What is FIPS 203?

  1. SHA-3
  2. ML-KEM, a lattice-based key encapsulation mechanism
  3. ML-DSA signatures
  4. SLH-DSA signatures

Why is key exchange migrated before most signatures?

  1. Signatures are already quantum-safe
  2. Recorded traffic can be decrypted later (harvest now, decrypt later), while a signature only needs to resist forgery when it is verified
  3. Key exchange is cheaper
  4. Standards require it

What does the hybrid group X25519MLKEM768 protect against?

  1. Only quantum attackers
  2. A break of either X25519 or ML-KEM alone
  3. Phishing
  4. Side channels