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.
What public-key cryptography does
Section titled “What public-key cryptography does”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.
What Shor’s algorithm breaks
Section titled “What Shor’s algorithm breaks”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.
What Grover’s algorithm only weakens
Section titled “What Grover’s algorithm only weakens”Symmetric ciphers and hash functions have no period to find. The best known quantum attack is Grover’s search, which finds one key among in about steps instead of .
That is a quadratic speedup, not an exponential one. A 128-bit key, which takes about classical guesses, would take about 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 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 |
Which of these would a large quantum computer break outright?
RSA's security is the difficulty of factoring, which Shor's algorithm removes. The others lose at most a square-root factor, or nothing.
Why act before the computer exists
Section titled “Why act before the computer exists”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.
Learning with errors
Section titled “Learning with errors”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 , and work modulo some number . Publish many equations of the form
each with freshly chosen random coefficients . Anyone can recover from such equations by elimination, as in school algebra. Now add a small random error to each right-hand side before publishing it:
Elimination multiplies and combines equations, and the errors grow until the answer is noise. With suitable sizes, no efficient method is known for finding , classical or quantum.
Try it. Start with the errors switched off and run the attack. Then switch them on.
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 . To send a 1 they shift its right-hand side by half of . To send a 0 they leave it alone. The receiver, who knows , substitutes it into the new equation and looks at what is left over: something near 0 means the bit was 0, and something near 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 the leftover cannot be computed, and finding is the LWE problem.
What are the errors in LWE for?
Exact linear equations are easy to solve. The errors are the only thing standing between the public key and the secret, which is why they must be large enough to defeat elimination yet small enough for decryption to work.
The toy uses three unknowns and has no security: with only , 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 standards
Section titled “The standards”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.
Remember it
Section titled “Remember it”Which widely used cryptosystems does Shor's algorithm break?
RSA, Diffie–Hellman and elliptic-curve cryptography: everything based on factoring or discrete logarithms.
What does Grover's algorithm do to symmetric ciphers such as AES, and what is the fix?
It reduces a search over keys to about steps. Doubling the key length restores the security margin.
What is "harvest now, decrypt later"?
Recording encrypted traffic today in order to decrypt it once a quantum computer can break the key exchange.
What is the learning with errors (LWE) problem?
Find a secret vector from many random linear equations in , modulo , each of which has a small error added.
What are the first three NIST post-quantum standards, and what are they for?
ML-KEM (key exchange, lattices), ML-DSA (signatures, lattices) and SLH-DSA (signatures, hash functions).
How does the security of post-quantum cryptography differ in kind from that of QKD?
Post-quantum cryptography rests on problems believed hard to compute. QKD rests on physics, given correctly working devices and an authenticated channel.