Quantum Safe Watch

How NIST-approved algorithms work, old and new

RSA and elliptic curves rest on factoring and discrete logarithms, two problems a large quantum computer could solve quickly with Shor's algorithm. NIST's replacements rest on different maths: noisy equations over lattices, hash functions, and error-correcting codes. No known quantum algorithm solves these fast. This page explains the idea behind each one, without assuming a maths degree.

At a glance

Four post-quantum standards are approved today. Two more are selected but not yet published as drafts (as of December 2026). A KEM agrees a shared secret key; a signature proves who sent something. RSA, elliptic curves and the other classical algorithms are covered below.

AlgorithmStandardJobHard problemStatus
ML-KEM (Kyber)FIPS 203Key exchange (KEM)Module Learning With Errors (lattice)Approved 2024
ML-DSA (Dilithium)FIPS 204SignatureModule-LWE and Module-SIS (lattice)Approved 2024
SLH-DSA (SPHINCS+)FIPS 205SignatureSecurity of a hash functionApproved 2024
LMS, XMSSSP 800-208Signature (stateful)Security of a hash functionApproved 2020
FN-DSA (Falcon)FIPS 206 (planned)SignatureShort vectors in NTRU latticesDraft pending
HQCFIPS 207 (expected)Key exchange (KEM)Decoding random quasi-cyclic codesDraft pending

Security categories: NIST rates parameter sets from 1 to 5 by comparison with attacks on symmetric primitives. Category 1 is as hard as finding an AES-128 key, 3 as AES-192, 5 as AES-256; 2 and 4 match finding SHA-256 and SHA-384 collisions.

Approved today, retiring soon: RSA, elliptic curves and Diffie–Hellman

These are what nearly all of today's internet runs on, and NIST still approves them. They all rest on two problems, factoring and discrete logarithms, that Shor's algorithm solves on a large quantum computer. NIST plans to deprecate them after 2030 and disallow them after 2035.

AlgorithmStandardJobHard problemAgainst a quantum computer
RSAFIPS 186-5, SP 800-56BSignature, key transportFactoringBroken by Shor
ECDSA, EdDSAFIPS 186-5, SP 800-186SignatureElliptic-curve discrete logarithmBroken by Shor
ECDHSP 800-56AKey agreementElliptic-curve discrete logarithmBroken by Shor
Diffie–Hellman (finite field)SP 800-56AKey agreementDiscrete logarithm modulo a primeBroken by Shor
AESFIPS 197EncryptionKey searchStays (Grover only)
SHA-2, SHA-3, HMACFIPS 180-4, 202, 198-1Hashing, message authenticationPreimages and collisionsStays (Grover only)

DSA, the original Digital Signature Algorithm, is no longer approved for creating signatures since FIPS 186-5 (2023); it remains only for verifying old ones.

RSA: multiplying is easy, factoring is hard

Pick two large secret primes p and q and publish their product n = p·q, along with a public exponent e. The private exponent d is chosen so that e·d ≡ 1 modulo (p−1)(q−1), which anyone can compute only if they know p and q.

encrypt or verify: c = m^e mod n decrypt or sign: m = c^d mod n

A worked example with toy numbers: p = 61, q = 53, so n = 3233 and (p−1)(q−1) = 3120. With e = 17, the private key is d = 2753. Encrypting m = 65 gives 6517 mod 3233 = 2790, and 27902753 mod 3233 gives back 65. Real keys use primes over 300 digits long, and the best classical factoring method (the number field sieve) still needs time that grows almost exponentially with the size of n.

Diffie–Hellman: exponents that cannot be undone

Two parties agree a public prime p and base g. Each picks a secret, a and b, and sends ga and gb modulo p. Each then raises what it received to its own secret, and both arrive at gab. An eavesdropper sees ga but would need a itself: the discrete logarithm problem.

toy example: p = 23, g = 5, secrets a = 6, b = 15 Alice sends 5^6 mod 23 = 8 Bob sends 5^15 mod 23 = 19 Alice: 19^6 mod 23 = 2 Bob: 8^15 mod 23 = 2 shared secret = 2

Elliptic curves: the same idea, much smaller

An elliptic curve is the set of points satisfying an equation like y2 = x3 + ax + b over a finite field. There is a rule for "adding" two points to get a third, so you can multiply a fixed base point G by a whole number k:

public key: Q = k·G (k is the private key)

Computing Q from k takes a few hundred point additions (double and add). Going back from Q to k is the elliptic-curve discrete logarithm problem, and no shortcut like the number field sieve is known for it. That is why a 256-bit curve matches a 3,072-bit RSA key, and why elliptic curves took over: ECDH (often X25519) for key agreement, and ECDSA and EdDSA (Ed25519) for signatures.

Why Shor's algorithm breaks all of them

Factoring and discrete logarithms share a hidden structure: both reduce to finding the period of a repeating function, such as ax mod n. A classical computer has to try values one by one. A quantum computer can evaluate the function on a superposition of all inputs at once and then apply a quantum Fourier transform, which makes the period stand out, like a prism splitting light into a frequency. Peter Shor showed in 1994 that this runs in polynomial time: doubling the key size only multiplies the work by a small factor, instead of making it astronomically harder.

Bigger keys therefore do not help. The open question is only when a large enough, error-corrected machine exists. Craig Gidney's 2025 estimate put RSA-2048 within reach of under a million noisy qubits running for less than a week, about 20 times fewer than his 2019 estimate. Elliptic curves likely fall sooner than RSA of the same classical strength, because their smaller numbers need fewer qubits.

The lattice, hash and code problems in the rest of this page have no such periodic structure that a quantum computer can exploit, as far as anyone knows.

NIST's retirement timeline

  • After 2030: 112-bit security (RSA-2048, 2,048-bit Diffie–Hellman, and curves below 256 bits) becomes deprecated.
  • After 2035: all RSA, Diffie–Hellman and elliptic-curve algorithms are disallowed, whatever the key size.

From NIST IR 8547, the transition plan published as a draft in November 2024. Agencies and regulators in many countries have adopted similar or earlier dates; see the roadmaps.

Primer: lattices and learning with errors

A lattice is a regular grid of points in many dimensions, every whole-number combination of a few starting vectors. In two dimensions it looks like wallpaper. In 500 or more dimensions, two questions become very hard: find the shortest non-zero point (the Shortest Vector Problem), and find the lattice point closest to a given spot (the Closest Vector Problem). The best known algorithms, classical or quantum, take time that grows exponentially with the dimension.

Cryptographers rarely use lattices directly. They use an equivalent puzzle called Learning With Errors (LWE), introduced by Oded Regev in 2005. Take a secret vector s, a public random matrix A, and a vector of small random errors e. Publish:

b = A·s + e (mod q)

Without the errors, anyone could recover s from A and b with school algebra (Gaussian elimination). The small noise makes it hopeless: every equation is slightly wrong, and the errors compound when you try to eliminate. Recovering s turns out to be as hard as worst-case lattice problems.

Making it fast: rings and modules

Plain LWE needs a big matrix, so keys would be hundreds of kilobytes. The standards replace single numbers with polynomials of degree below 256, multiplied modulo X256 + 1 and with coefficients modulo a prime q. One polynomial carries 256 numbers, so a small matrix of polynomials (say 3 × 3) stands in for a huge matrix of numbers. This is Module-LWE. Multiplication uses the Number Theoretic Transform, a whole-number cousin of the Fast Fourier Transform, which is a big part of why ML-KEM is faster than elliptic-curve key exchange in most benchmarks.

Try it: a toy LWE encryption

This is Regev's original scheme with tiny numbers: 4 secret values, 8 noisy equations, modulus 97. It encrypts one bit. Turn up the noise to see when decryption starts to fail. Real schemes use 256-coefficient polynomials and are tuned so failure is practically impossible.

Loading…

ML-KEM (FIPS 203)

The main post-quantum key exchange, derived from CRYSTALS-Kyber. Browsers, CDNs and SSH already use it, usually combined with X25519 as X25519MLKEM768 so the connection stays safe if either half holds.

How it works

  1. Key generation. Pick a public matrix A of polynomials (expanded from a 32-byte seed), a secret s and an error e, both with small coefficients. The public key is t = A·s + e. That is exactly an LWE sample.
  2. Encapsulation. The sender picks fresh small r, e1, e2 and a random 32-byte message m, then sends
    u = Aᵀ·r + e1 v = tᵀ·r + e2 + encode(m)
    where encode places each bit of m at 0 or about q/2. The shared key is a hash of m and the ciphertext.
  3. Decapsulation. The owner of s computes v − sᵀ·u. The big terms cancel, leaving encode(m) plus a little noise (eᵀr + e2 − sᵀe1). Rounding each coefficient to 0 or q/2 recovers m.

A Fujisaki–Okamoto transform wraps this basic encryption: the receiver re-encrypts m and checks it gets the same ciphertext. That blocks attacks that feed in tampered ciphertexts and watch what happens, which is the security property known as IND-CCA2.

Why it is believed secure

Reading s from t, or m from the ciphertext, means solving Module-LWE. The parameter sets differ only in the module size k: a 2 × 2, 3 × 3 or 4 × 4 matrix of polynomials.

ML-DSA (FIPS 204)

The main post-quantum signature, derived from CRYSTALS-Dilithium. It uses the same kind of polynomial ring as ML-KEM, with a larger modulus.

How it works: Fiat–Shamir with aborts

The public key is t = A·s1 + s2 with small secrets s1, s2. (Only the high bits of t are published to save space.) To sign a message:

  1. Commit. Pick a random masking vector y and compute w = A·y. Keep only its high bits, w1.
  2. Challenge. Hash the message together with w1 into a sparse polynomial c whose coefficients are mostly 0, with a few ±1.
  3. Respond. Compute z = y + c·s1.
  4. Abort if risky. If z has any coefficient that is too large, or a rounding check fails, throw it away and start again with a new y. Otherwise publish (c, z, and a small hint h).

The abort step is the clever part. Without it, the distribution of z would lean towards c·s1, and many signatures would leak the secret. Rejecting the outliers makes z look uniformly random in a box, independent of s1. On average it takes about four attempts.

Verifying: compute A·z − c·t. That equals w − c·s2, which has the same high bits as w, so the verifier can recover w1 (with the hint), re-hash, and check the result equals c.

Why it is believed secure

Recovering the key from t is a Module-LWE problem. Forging a signature without the key means finding a short vector that satisfies the verification equation, which is a Module-SIS (Short Integer Solution) problem.

Primer: signatures from hash functions

A hash function such as SHA-256 turns any input into a fixed-size fingerprint, and it is easy to compute but practically impossible to reverse. Quantum computers only speed up attacks on hashes modestly (see AES and SHA), so signatures built only from hashes rest on the most conservative assumption in cryptography.

Step 1: a one-time signature (Lamport, 1979)

For each bit of the message hash, generate two random secrets, one for 0 and one for 1. Publish the hashes of all of them as the public key. To sign, reveal the secret that matches each bit. The verifier hashes each revealed value and compares. It is secure, but only once: a second signature reveals more secrets and lets an attacker mix and match.

Step 2: shorter, with hash chains (Winternitz)

Instead of one secret per bit, take one secret per group of bits (say 4 bits, a value from 0 to 15) and hash it repeatedly to form a chain. The public key is the end of each chain; the signature is the point partway along that encodes the value. A checksum stops an attacker from moving further along a chain. This is the WOTS+ scheme used inside all the standards below.

Step 3: many keys under one, with a Merkle tree

Generate many one-time key pairs and hash their public keys together, in pairs, up a binary tree. The root becomes the single public key. A signature contains a one-time signature plus the "authentication path" of sibling hashes that leads from that leaf to the root.

SLH-DSA (FIPS 205)

The stateless hash-based signature, derived from SPHINCS+. It is the hedge in case lattice problems turn out to be easier than believed.

How it removes the state

A plain Merkle tree forces the signer to remember which one-time keys are used. SLH-DSA avoids this by making the tree astronomically large and choosing a leaf pseudo-randomly from the message, so reuse is vanishingly unlikely. Three layers make that work:

  • Hypertree. A tree of trees: each layer is a Merkle tree of WOTS+ keys, and each WOTS+ key signs the root of a tree in the layer below. Only the trees on the path being used are ever computed, generated on the fly from a secret seed.
  • FORS at the bottom. The leaves sign messages with FORS, a "few-time" signature, so the rare case of two messages landing on the same leaf does not break security.
  • Randomised index. The message and a random value pick which leaf and which FORS key sign it.

The cost is size and speed: signatures are 8 to 50 KB, and signing is slow. The "s" (small) parameter sets trade signing time for size, and the "f" (fast) sets do the reverse. There are 12 parameter sets in all, using either SHA-2 or SHAKE.

LMS and XMSS (SP 800-208)

Stateful hash-based signatures: a Merkle tree of Winternitz one-time keys, exactly as in the primer above, optionally stacked into a few levels. NIST approved them in 2020, before the other standards, and CNSA 2.0 requires them early for firmware and software signing.

The catch: state

Each one-time key must be used once only, so the signer has to keep a counter and never roll it back. Restoring a backup, cloning a virtual machine or running two signers from one key can reuse a leaf and let an attacker forge signatures. For that reason SP 800-208 requires keys to be generated and used inside a hardware cryptographic module, and these schemes suit tightly controlled uses such as signing firmware, not general use.

In return they are small and fast compared with SLH-DSA, and their security depends only on the hash function.

FN-DSA (planned FIPS 206) Pending

Derived from Falcon. NIST selected it in 2022 for its very small signatures. The draft standard was not public as of December 2026; final publication is expected around 2027.

How it works: hash-and-sign with a trapdoor

Falcon uses NTRU lattices. The secret key is a pair of small polynomials f, g; the public key is their ratio

h = g / f (mod q), q = 12289

which looks random. The small f and g form a "trapdoor": a short, good basis for a lattice whose public description is a long, bad basis.

  1. Hash the message to a point c, a target that is generally not on the lattice.
  2. Using the trapdoor, find a lattice point close to c. The signature is the short difference between them (the GPV framework).
  3. The verifier checks the difference is short and satisfies the public equation with h.

The close point has to be chosen randomly from a carefully shaped (Gaussian) distribution; a naive choice leaks the secret basis. Falcon does this with "fast Fourier sampling", which uses floating-point arithmetic. Getting that constant-time and identical on every platform is hard, which is a main reason FN-DSA is taking longer to standardise and is the trickiest of these algorithms to implement safely.

HQC (expected FIPS 207) Pending

Hamming Quasi-Cyclic, selected in March 2025 as a backup to ML-KEM. It uses completely different maths, so a breakthrough against lattices would not affect it. NIST has said it expects a draft first and a final standard in 2027.

Primer: error-correcting codes

Error-correcting codes let a phone or a QR code recover data after some bits are flipped, by adding structured redundancy. Decoding is easy if you know the code's structure, but for a random code, finding which few bits were flipped (the syndrome decoding problem) is believed to be hard for classical and quantum computers alike. Code-based cryptography has been studied since McEliece in 1978.

How it works

HQC works with long binary vectors, multiplied as polynomials so that the codes are quasi-cyclic (which keeps keys small). It mirrors the LWE idea, with "sparse" (few ones) in place of "small":

public key: h (random), s = x + h·y x, y sparse and secret ciphertext: u = r1 + h·r2 v = encode(m) + s·r2 + e r1, r2, e sparse

The receiver computes v − u·y. The big terms cancel, leaving encode(m) plus a sparse error. A public, efficiently decodable code (a concatenated Reed–Muller and Reed–Solomon code) then removes the errors to recover m. Like ML-KEM, HQC wraps this in a Fujisaki–Okamoto transform.

Keys and ciphertexts are a few times larger than ML-KEM's, and it is slower, so it is a backup rather than a replacement.

Why size is the hard part

Post-quantum keys and signatures are far bigger than today's. A TLS handshake sends several signatures and public keys, so certificate chains grow from about a kilobyte to tens of kilobytes. That is why the web is moving to Merkle Tree Certificates instead of putting ML-DSA straight into today's certificate chains.

Signature size, bytes

Key exchange: what goes over the wire, bytes

Public key plus ciphertext. Orange bars are post-quantum. HQC and FN-DSA figures are from their submissions.

What stays: AES and SHA

Symmetric ciphers and hash functions are not broken by Shor's algorithm. The relevant quantum attack is Grover's algorithm, which searches N possibilities in about √N steps. On paper that halves the security level in bits, so AES-128 would offer roughly 64-bit security against a quantum key search.

In practice Grover's steps must run one after another on an error-corrected machine and cannot be split up efficiently, so NIST considers AES-128 adequate and uses it as the benchmark for category 1. Policies that want a margin, such as the NSA's CNSA 2.0, require AES-256 and SHA-384 or SHA-512. Either way, migration work is about public-key cryptography: key exchange, signatures and certificates.

Further reading