Skip to content

Post-quantum cryptography

The first four lessons were about what quantum mechanics offers to people who want to keep secrets. This one is about what it offers to people who want to break them, and about the response. That response uses no quantum technology at all: post-quantum cryptography is ordinary software, running on ordinary computers, built on mathematical problems that quantum computers are not known to solve.

Most of this lesson is classical. The quantum part is in the Quantum Algorithms track, and is summarised here.

When your browser connects to a website, two things happen before any data flows.

  • Key exchange. The two sides agree on a secret key, over a network anyone can listen to, without ever having met.
  • Signatures. The website proves that it is who it claims to be, by signing data in a way anyone can check but nobody else can produce.

Both rest on public-key cryptography, and the schemes in use for decades rest on just two mathematical problems:

Scheme Hard problem underneath
RSA Factoring a large number into primes
Diffie–Hellman Discrete logarithms
Elliptic-curve cryptography Discrete logarithms on an elliptic curve

Once a key is agreed, the data itself is protected by symmetric ciphers such as AES, and integrity by hash functions such as SHA-2. These are a different kind of object, with no neat mathematical structure underneath.

Shor’s algorithm finds the period of a function efficiently. Factoring and both kinds of discrete logarithm reduce to period finding. So a large, error-corrected quantum computer would break RSA, Diffie–Hellman and elliptic-curve cryptography, all three. The break is complete, not a matter of degree: the time needed grows only polynomially with the key size, so longer keys do not help.

No such machine exists. Published estimates of what it would take to factor a 2048-bit RSA number have fallen over the years, from around twenty million physical qubits to under a million, and the largest machines today are far short of that and too noisy by a wide margin. Nobody knows when the gap will close. The estimates keep moving, and they have so far moved in one direction.

Symmetric ciphers and hash functions have no period to find. The best known quantum attack is Grover’s search, which finds one key among NN in about N\sqrt{N} steps instead of NN.

That is a quadratic speedup, not an exponential one. A 128-bit key, which takes about 21282^{128} classical guesses, would take about 2642^{64} Grover steps. The steps must be done one after another on an error-corrected machine, which makes the attack far harder in practice than that number suggests. And the fix is simple: double the key length. A 256-bit key leaves 21282^{128} quantum steps, which is out of reach.

Best quantum attack Consequence
RSA, Diffie–Hellman, elliptic curves Shor Broken. Must be replaced
AES, other symmetric ciphers Grover Weakened. Use 256-bit keys
SHA-2, SHA-3 hash functions Grover and relatives Weakened. Use longer outputs
One-time pad None Unaffected
Check

Which of these would a large quantum computer break outright?

An eavesdropper can record encrypted traffic today and keep it. If the key exchange used RSA or elliptic curves, the recording can be decrypted whenever a large enough quantum computer appears. This is called harvest now, decrypt later.

Whether it matters depends on three time spans:

  • how long the data must stay secret,
  • how long it takes to replace the cryptography everywhere,
  • how long until a quantum computer can break it.

If the first two together exceed the third, some data is already exposed. Medical records, state secrets and long-lived infrastructure have secrecy lifetimes of decades, and replacing cryptography across the internet takes many years. That is why the migration has started while the threat is still hypothetical.

Signatures are less urgent in one respect. A signature only needs to resist forgery at the moment it is checked, so a future quantum computer cannot retroactively impersonate a website from last year. Keys that stay in service for a long time, such as those that sign software updates, are the exception.

Problems that seem hard even for quantum computers

Section titled “Problems that seem hard even for quantum computers”

The task is to find public-key schemes built on problems with no period-finding structure. Several families have been studied for decades.

  • Lattices. Problems about finding short vectors in high-dimensional grids, or equivalently solving noisy linear equations. Efficient and versatile, and the basis of the main new standards.
  • Hash-based signatures. Signatures whose security rests on nothing but a hash function. Very conservative. The signatures are large.
  • Error-correcting codes. Decoding a random-looking code is hard. This idea dates from 1978 and has withstood attack since, at the cost of large public keys.
  • Isogenies of elliptic curves. Compact and elegant, and a cautionary tale: a leading candidate, SIKE, was broken in 2022 by a classical attack that ran on an ordinary computer, late in the standardisation process.

The last item is a reminder of what “hard” means here. Nobody has proved that any of these problems is hard, for quantum or classical computers. The same was always true of factoring. Confidence comes from years of failed attempts to break them, and it is occasionally misplaced.

The lattice schemes are built on a problem called learning with errors, or LWE, introduced by Oded Regev in 2005. It is easy to state.

Pick a secret list of numbers s=(s1,…,sn)s = (s_1, \dots, s_n), and work modulo some number qq. Publish many equations of the form

a1s1+a2s2+⋯+ansn=b(modq),a_1 s_1 + a_2 s_2 + \dots + a_n s_n = b \pmod q,

each with freshly chosen random coefficients aia_i. Anyone can recover ss from nn such equations by elimination, as in school algebra. Now add a small random error to each right-hand side before publishing it:

a1s1+a2s2+⋯+ansn+e=b(modq).a_1 s_1 + a_2 s_2 + \dots + a_n s_n + e = b \pmod q.

Elimination multiplies and combines equations, and the errors grow until the answer is noise. With suitable sizes, no efficient method is known for finding ss, classical or quantum.

Try it. Start with the errors switched off and run the attack. Then switch them on.

SimulatorA toy lattice cryptosystem

All arithmetic is modulo 97. This is a teaching toy with no security: real systems use hundreds of unknowns.

The noisy equations work as a public key. To send a bit, the sender adds up a random selection of the published equations, which gives one new equation that is also nearly true for the secret ss. To send a 1 they shift its right-hand side by half of qq. To send a 0 they leave it alone. The receiver, who knows ss, substitutes it into the new equation and looks at what is left over: something near 0 means the bit was 0, and something near q/2q/2 means it was 1. The accumulated errors blur the picture slightly, but in this toy they add up to at most 16, well short of the 24 needed to cause confusion.

An eavesdropper sees the same ciphertext, but without ss the leftover cannot be computed, and finding ss is the LWE problem.

Check

What are the errors in LWE for?

The toy uses three unknowns and has no security: with only 97397^3, under a million, possible secrets, a computer can try them all. Standardised schemes use several hundred unknowns, arranged with extra algebraic structure so that keys stay small, and a great deal of care about exactly how the errors are chosen.

The United States standards body NIST ran an open, international competition from 2016, in which submitted schemes were attacked in public for years. In August 2024 it published its first three post-quantum standards:

Standard Name Purpose Based on
FIPS 203 ML-KEM, derived from Kyber Key exchange Lattices
FIPS 204 ML-DSA, derived from Dilithium Signatures Lattices
FIPS 205 SLH-DSA, derived from SPHINCS+ Signatures Hash functions

In 2025 a code-based scheme, HQC, was selected as an additional key-exchange method, so that a future weakness in lattices would not leave everything exposed at once.

Deployment is under way. Major browsers and large internet services have begun using ML-KEM for key exchange, generally in a hybrid arrangement that combines it with an established elliptic-curve exchange, so that the connection stays secure if either one holds.

Post-quantum cryptography or quantum key distribution?

Section titled “Post-quantum cryptography or quantum key distribution?”

These are two answers to the same threat, and they differ in almost every respect.

Post-quantum cryptography Quantum key distribution
What it is Software Hardware: sources, detectors, a quantum channel
Works over The existing internet Dedicated fibre or free-space links, limited in distance
Security rests on A problem believed hard to compute Physics, plus correctly behaving devices
Provides Key exchange and signatures Key agreement only, and it needs authentication to start
Could a future discovery break past traffic? Yes, if the problem turns out easy No

Neither replaces the other. QKD offers a kind of guarantee no mathematical scheme can, that recorded traffic stays safe against all future computers and algorithms, but it needs special hardware and an authenticated channel. It also cannot sign anything. Post-quantum cryptography can be deployed everywhere with a software update, on the understanding that its hardness assumptions are younger and less tested than those they replace. Several national cybersecurity agencies currently recommend post-quantum cryptography as the main defence for most systems, with QKD regarded as a specialised addition. The two can also be combined, for instance by using post-quantum signatures to authenticate a QKD link.

The final lesson returns to the quantum side, and to the idea that started the whole field.

RecallAnswer from memory, then check
LessonFinish this lesson