Skip to content
Series 7 · The cryptography of signatures · 7.9

After RSA: post quantum signatures.

Shor's algorithm, lattices and hash based signatures: how signatures are getting ready for the next change.

October 202610 min read

In 1994, Peter Shor, at Bell Labs, presented an algorithm that could not yet run on any existing machine and that nonetheless changed the horizon of all public key cryptography. He showed that a sufficiently large and stable quantum computer could factor integers and compute discrete logarithms in polynomial time. The three problems on which RSA, Diffie and Hellman, and elliptic curves rest would all fall at once.

Three decades later, that machine still does not exist, but nobody serious is betting that it never will. This final article in the series explains what exactly Shor’s algorithm breaks, what it does not, and what the signatures designed to survive it look like on the inside.

What Shor does, and what it does not

The central idea is to turn factoring into the problem of finding the period of a function. If you pick a random a, the sequence ax mod n is periodic, and knowing its period r lets you, with high probability, obtain a factor of n by computing gcd(ar/2 1, n). Finding that period is hard for a classical computer, but a quantum computer can prepare a superposition of all values of the function and extract the period with the quantum Fourier transform. The same principle, applied to groups, solves the discrete logarithm, including on elliptic curves.

Hash functions and symmetric ciphers fall into another category. Grover’s algorithm gives a quadratic speedup for unstructured search: finding a preimage among 2n possibilities now costs about 2n/2 evaluations, and those evaluations are also sequential and very hard to parallelize. At 256 bits, the margin remains enormous. That is why post quantum cryptography focuses on replacing public key algorithms, not hash functions.

The threat is different for signatures

For encryption, the risk is immediate: an adversary can store encrypted traffic today and decrypt it once they have the machine. For signatures there is nothing to store, because a signature hides no information. The risk is a different one: that in the future someone could manufacture signatures that look old, or certificates that look legitimate. That weighs most heavily in two places: roots of trust and documents that must remain provable for decades.

The oldest signature is the most modern

Paradoxically, one of the most solid post quantum families is almost as old as RSA. In 1979, Leslie Lamport described a signature built from nothing but a hash function.

  1. Private key. 256 pairs of random 256 bit values: (xi,0, xi,1) for i from 1 to 256.
  2. Public key. The hashes of all of them: (H(xi,0), H(xi,1)).
  3. Signing. Hash the message and, for each of its 256 bits, reveal xi,0 if the bit is 0 or xi,1 if it is 1.
  4. Verifying. Hash each revealed value and compare it with the corresponding half of the public key.

Forging requires inverting the hash function. There is no algebraic structure for Shor to exploit. But it has a severe limitation: each key is good for a single signature, because each signature reveals half of the secrets, and two signatures on different messages reveal enough to stitch together a third.

Ralph Merkle solved the problem with a tree. You generate 2h one time keys and place their public keys as the leaves of a binary hash tree. The root, 32 bytes, is the only public key. Each signature includes the one time signature, its public key and the h sibling hashes needed to recompute the root. It is the same Merkle tree that underpins certificate transparency and evidence records.

Stateful and stateless

The modern descendants split into two branches. XMSS (RFC 8391) and LMS (RFC 8554), recommended by NIST in SP 800 208, are stateful schemes: the signer must remember which leaves it has used and never repeat one. That is a dangerous requirement in practice, because a restored backup or a cloned module can reuse a leaf without anyone noticing. That is why they are reserved for controlled uses, such as signing a device’s boot software.

SPHINCS, presented in 2015, and its successor SPHINCS+, standardized in 2024 as SLH DSA in FIPS 205, did away with state. It uses a hypertree, a tree of trees, and at the bottom level a “few time” signature scheme called FORS; the leaf is chosen pseudorandomly from the message, and the tree is so large that the probability of dangerously reusing a leaf is negligible. The price is large signatures: between about 8 and 50 kilobytes depending on the parameter set. The reward is the most conservative security assumption possible: if the hash function is good, the signature is secure.

Lattices: the needle in a noisy haystack

The other major family is based on lattices. A lattice is the set of all integer combinations of a set of basis vectors, a regular grid in a space of many dimensions. Finding the shortest nonzero vector in a lattice, given a “bad” basis, is hard in high dimensions, and no known quantum algorithm solves it efficiently.

In 2005, Oded Regev formulated the learning with errors problem, LWE, which became the foundation of practical lattice cryptography:

b = A · s + e  (mod q)
A is a random public matrix, s a secret vector and e a vector of small errors. Without the error, s could be solved for by Gaussian elimination in seconds. With it, recovering s is as hard as solving worst case lattice problems, according to Regev’s reduction.

ML DSA, derived from the CRYSTALS Dilithium scheme and standardized in FIPS 204, uses a more efficient module version, MLWE. Its signature follows the Schnorr structure with a twist, the Fiat and Shamir with aborts method proposed by Vadim Lyubashevsky:

1. Pick a random vector y with small coefficients; w = A · y
2. Challenge c = H(message, high bits of w)
3. z = y + c · s1
4. If z or the remainder would leak information about s1 (coefficients too large), discard and go back to step 1
The verifier checks that z is small and that the high bits of A · z c · t match those used for the challenge. The rejection in step 4 ensures that the distribution of z does not depend on the secret.

ML DSA comes in three levels, 44, 65 and 87, corresponding to NIST security categories 2, 3 and 5. It signs much faster than RSA and verifies at comparable speed, but its keys and signatures are measured in kilobytes. NIST also selected Falcon, another lattice scheme with more compact signatures, which is being standardized as FN DSA; implementing it securely is trickier because it requires Gaussian sampling in floating point arithmetic.

In bytesHow much a signature weighs, before and after
SchemeSignature sizeSig.Key
Ed255196432
ECDSA P 2566464
RSA 3072384384
ML DSA 442,4201,312
ML DSA 653,3091,952
ML DSA 874,6272,592
SLH DSA 128s7,85632
SLH DSA 128f17,08832

Violet: classical schemes, vulnerable to Shor's algorithm. Magenta: post quantum schemes standardized by NIST in FIPS 204 and FIPS 205. Key: public key size. ECDSA figures are for the raw, unencoded form.

Post quantum signatures are not harder to compute. They are heavier to carry, and that changes protocols, formats and cards.

How the transition happens

No cryptographic migration has ever been fast. Moving from SHA 1 to SHA 256 in certificates took more than a decade. The post quantum transition is bigger, because it affects the signature algorithms themselves, and legally binding signatures involve secure devices, identity cards with years of service life, national roots and format standards.

The scientific method of cryptography is, at heart, a method of transitions. Diffie and Hellman replaced key distribution with public keys; elliptic curves largely replaced RSA; SHA 2 replaced SHA 1. The move to post quantum cryptography is the next step, and it will not be the last. What does not change is the pattern that ran through this entire series: a hash that captures the document, a hard problem that separates private from public, a chain that puts names to keys, and evidence that proves when each thing happened.

Key takeaways

Shor’s algorithm would break RSA and elliptic curves on a sufficiently large quantum computer; hash functions merely lose half their exponent to Grover. The standardized post quantum signatures are based on lattices, like ML DSA, or on hash functions alone, like SLH DSA: heavier, but just as fast. For signatures, the quantum risk is future forgery, and it is met with hybrid signatures, renewed roots, archive timestamps and cryptographic agility.

Sources

  1. Shor, “Algorithms for Quantum Computation: Discrete Logarithms and Factoring”, FOCS 1994
  2. Lamport, “Constructing Digital Signatures from a One Way Function”, SRI International, 1979
  3. Merkle, “A Certified Digital Signature”, CRYPTO 1989
  4. Regev, “On Lattices, Learning with Errors, Random Linear Codes, and Cryptography”, STOC 2005
  5. NIST, FIPS 204, Module Lattice Based Digital Signature Standard, 2024
  6. NIST, FIPS 205, Stateless Hash Based Digital Signature Standard, 2024
  7. NIST, SP 800 208, Recommendation for Stateful Hash Based Signature Schemes, 2020
  8. NIST, FIPS 203, Module Lattice Based Key Encapsulation Mechanism Standard, 2024

← All notes

Trust Notes

Articles for those who decide how an organization signs: principles, practices and criteria that hold up as rules and technologies change.

A publication of Signing Flows, by Interfase.

Series