Post-quantum cryptography: lattice ciphers that even a quantum computer cannot break
Post-quantum cryptography means ciphers that not even a quantum computer could break. The most widely used ones hide the secret key in a system of equations that deliberately contains a small error. Without the error, any Year 10 pupil could solve the system; with the error, nobody knows how. Nor is this a thing of the distant future: the Chrome, Firefox and Safari browsers have been agreeing keys in a post-quantum way since 2024 and 2025, Signal since 2023 and iMessage since 2024. If you open Google’s website or a page behind Cloudflare today, it is quite likely running that way already.
Why RSA is not enough
The RSA cipher rests on the fact that a large number cannot be factorised into primes in a reasonable time. The Diffie–Hellman key exchange rests on the fact that you cannot find the exponent from the result of raising to a power. An ordinary computer can do neither. But in 1994 Peter Shor showed that a quantum computer would solve both problems quickly. The article on Shor’s algorithm describes how it would do it. Such a computer does not exist yet. Today’s quantum computers have hundreds, at most thousands, of qubits, the quantum counterparts of bits, and they make a lot of errors. According to a 2025 estimate by Craig Gidney of Google, breaking a 2048-bit RSA key would take fewer than a million such qubits and roughly a week of computing. When such a machine will appear, nobody knows.
So why the hurry? Because of an attack known as harvest now, decrypt later. Anyone who records encrypted communication today cannot read anything in it. But they can keep it and decrypt it in fifteen years, once the quantum computer exists. For messages that are meant to stay secret for a long time, such as medical records or diplomatic cables, that is already a problem today. Ciphers are therefore being replaced before the threat arrives.
Post-quantum ciphers run on ordinary computers and phones and need no quantum technology at all. They simply rest on a different problem from RSA, one that, as far as anyone can tell, not even a quantum computer can handle. Do not confuse them with quantum cryptography, which sends keys as individual photons; that is a completely different field.
A system of equations without an error
Adam thinks of two secret numbers, x = 4 and y = 7. From them he works out two equations and publishes them:
Adam’s secret will not last long. Eva multiplies the first equation by two, which gives 6x + 10y = 94, and subtracts the second from it:
She gets y = 7, and substituting into the first equation gives x = 4. Systems of equations are taught at school, and a computer solves even a system with thousands of unknowns in an instant.
A small error is not enough
Adam tries it a different way. To each right-hand side he adds or subtracts one, and only he knows which. Instead of 47 he publishes 48, and instead of 38 he writes 37. Eva calculates just as before and gets x ≈ 3.71 and y ≈ 7.38. She rounds to whole numbers and has x = 4, y = 7. The small error changed the result only a little, so Eva can easily see through it.
So the error alone is not enough. It needs a helper: remainders after division.
Equations on a clock face
You know remainders after division from clocks. At 14:00 the hand points to two, because 14 divided by twelve leaves remainder 2. Adam will calculate on a clock face with 29 numbers, from 0 to 28. He divides every result by 29 and keeps only the remainder. From 47 that leaves 18, because 47 = 29 + 18, and from 38 it leaves 9. Mathematicians write this as
Eva would still solve them in the same way as before. On a clock face you can add, subtract, multiply and divide, only division looks a little different from what you are used to. The result again comes out as x = 4 and y = 7.
But Adam adds errors, and instead of 18 and 9 he publishes the right-hand sides 19 and 8. Eva calculates in exactly the same way and gets x = 17 and y = 11. Checking the first equation:
On the clock face 19 is left, so Eva’s solution satisfies the published equations exactly, and yet it is completely wrong: Adam has x = 4 and y = 7. Without the clock face, a small error moved the result only a little. On the clock face, division turns into multiplication, usually by a large number, so the error does not shrink but grows and wraps around the dial. The result can end up anywhere. A small error turns into a large one, and there is nothing left to round. Small errors and a clock face together make up a problem called learning with errors (LWE). It was devised by the Israeli computer scientist Oded Regev in 2005.
Eva has one more option: try all the pairs x and y one after another and look for the one for which all the equations hold up to a small error. To make sure only one such pair comes out, Adam publishes more equations than there are unknowns, as we will see below. On a clock face with 29 numbers there are only 29 · 29 = 841 pairs, and a computer goes through those in a fraction of a second. The real cipher ML-KEM, which we come to below, has 768 unknowns and a clock face with 3,329 numbers. The secret numbers in it are small, only from −2 to 2, and even so the number of possibilities is
a number with 537 digits. Cleverer attacks than trying everything do exist. They go through lattices, which we look at next. But even those would, by today’s estimates, need a number of steps with fifty or more digits, and a quantum computer would help them very little.
Where the lattice comes in
A lattice is a regular grid of points. You get one when you jump from a single point by two fixed jumps, say u and v, any number of times forwards and backwards. Mathematicians call the jumps vectors and draw them as arrows. Everywhere you can jump to in this way makes up the lattice.
The picture shows the same lattice twice. On the left it is generated by the short, perpendicular vectors u and v, on the right by the long, almost parallel vectors w1 = u + v and w2 = 3u + 2v. From both pairs you can jump to exactly the same points. The task is this: the red cross lies a little off the lattice, so which lattice point is nearest to it? With the short vectors it is easy: you just work out how many times to jump by u and how many times by v, and round. With the long vectors the same method fails, because every small inaccuracy is multiplied by their length and you end up far from the cross. In the plane you can see the nearest point by eye. In a space with hundreds of dimensions you can see nothing, and all that is left is calculation.
The link with equations goes like this. Adam really publishes more equations than he has unknowns, say four. You will find them a little further down, and you already know the first two, 3x + 5y and 6x + 2y; to them are added 9x + 4y and 5x + 8y. The left-hand sides give four numbers, that is, a point in four-dimensional space. For x = 1, y = 0 it is the point (3, 6, 9, 5), and for x = 0, y = 1 the point (5, 2, 4, 8). Every further x and y simply means more jumps by these two points (and on the clock face also jumps by 29), so all the possible left-hand sides form a lattice. The right-hand sides without errors, (18, 9, 6, 18), are one of its points. The right-hand sides that Adam publishes, (19, 8, 6, 19), lie a little off it. Finding Adam’s secret numbers is the same as finding the lattice point nearest to the point Adam published. That is why there must be more equations than unknowns. With two equations you could jump to every point exactly, as we saw with Eva’s solution x = 17, y = 11. In a real cipher the lattice has hundreds of dimensions.
An attacker knows only the jumps that come from the public equations, and these tend to be long and slanting. The short ones, which would make the task easy, they must find first. Mathematicians have been working on finding short vectors in a lattice for more than forty years, ever since the LLL algorithm, devised in 1982 by Arjen Lenstra, Hendrik Lenstra and László Lovász. In a few dimensions it goes well; in hundreds of dimensions it is so far hopelessly slow.
How to encrypt with equations
Now we can encrypt. Adam keeps his secret numbers x = 4 and y = 7 and publishes four equations with errors, all on the clock face with 29 numbers:
This is his public key. Bára wants to send him one bit, that is, a zero or a one. She sends a one. She secretly chooses a few equations, say the first, the second and the fourth, and adds them:
and on the clock face 14x + 15y = 17. Because she is sending a one, she adds 14 to the right-hand side as well, roughly half the clock face: 17 + 14 = 31, which on the clock face is 2. If she were sending a zero, she would add nothing. She sends Adam the triple of numbers 14, 15 and 2, that is, the left-hand side 14x + 15y and the right-hand side 2.
Adam substitutes his secret numbers into the left-hand side:
On the clock face he gets 16. He subtracts it from the right-hand side: 2 − 16 = −14, which on the clock face is 15. Fifteen lies near fourteen, so Bára sent a one. If she had sent a zero, Adam would have got 17 − 16 = 1, which is near zero.
Why does it work? If the equations had no errors, Adam would get exactly zero for a zero and exactly 14 for a one. But the errors added up, +1 − 1 + 1 = 1, and the result shifted by one. As long as the errors are few and small, the result stays near zero or near fourteen, and Adam can tell what arrived. Eva sees the numbers 14, 15 and 2 and all four public equations. But she does not know x and y, and she does not know which equations Bára added. To read the message she would have to solve the learning with errors problem.
This is not how a whole message is encrypted, only a key, that is, a secret number with which the message is then encrypted by an ordinary fast cipher. Real ciphers send a whole key of 256 bits at once, that is, 256 zeros and ones, and the equations have a clever structure so that they take up less space. But the principle is the same as with Adam and Bára. There is one drawback: the keys are much longer. An ML-KEM public key is 1,184 bytes, almost ten thousand zeros and ones, whereas for the elliptic curves used today, 32 bytes are enough.
ML-KEM and the new standards
The US standards body NIST announced a competition for post-quantum ciphers in 2016. 82 proposals came in from all over the world, and for eight years cryptographers tried to break one another’s. In August 2024 NIST published the first three standards:
- ML-KEM (formerly Kyber) for key agreement, which is exactly what Adam and Bára are doing here. It rests on lattices.
- ML-DSA (formerly Dilithium) for digital signatures, which verify that a message or program really comes from whoever claims to have sent it. It too rests on lattices.
- SLH-DSA (formerly SPHINCS+) for signatures built on completely different mathematics, as a backup in case lattices fail.
In March 2025 NIST also selected a backup cipher, HQC, built on different mathematics, and it is preparing further lattice-based signatures, FN-DSA (formerly Falcon). According to NIST’s plan, RSA and elliptic curves are to disappear from US government use entirely by 2035.
The competition also had a casualty. The cipher SIKE, built on completely different mathematics, made it to the final round. In the summer of 2022 two Belgian mathematicians broke it in an hour on a single ordinary computer. That is why new ciphers today are deployed in hybrid form: the connection is secured at the same time by an old, well-tried cipher and by a new post-quantum one. An attacker has to break both, so if a flaw turns up in one, the other still protects the connection. That is exactly how browsers do it: the key is agreed through elliptic curves and through ML-KEM at the same time, in a combination called X25519MLKEM768.
Why we believe lattices are secure
It has not been proved. As with RSA, all we know is that nobody has found a fast attack. But with lattices there are a few reasons to feel more reassured.
First, in 2005 Oded Regev proved something that RSA does not have. With many problems it happens that most instances are hard, but some are easy by chance. With learning with errors, according to Regev, this cannot happen: anyone who could crack randomly chosen equations could (with the help of a quantum computer) also solve the hardest lattice problems. For real ciphers this holds only approximately, but it is still a strong guarantee. A randomly chosen key is therefore as secure as the best possible one.
Second, lattices were studied long before these ciphers and have been under attack for a long time. For quantum computers mathematicians have algorithms for factorising numbers and for finding an exponent, but for lattices they have none that is similarly fast. In April 2024 the computer scientist Yilei Chen did publish a quantum algorithm that was supposed to solve learning with errors. Experts set about reading it at once, and within ten days they found an error that could not be repaired. So the checking worked, and lattices held up.
But none of this gives certainty. The security of post-quantum ciphers rests on the same foundation as the security of RSA: on the fact that enough clever people tried for a long time and did not succeed. That is why hybrid connections and backup standards built on different mathematics remain.