By Bonaventure Ogeto · Published · Last verified:
Lattice Cryptography Explained Without the Heavy Math
The short answer
Lattice cryptography hides a secret in equations blurred by small random errors. Without the errors, school algebra solves them; with them, solving means finding a hidden point in a vast many-dimensional grid, a task currently believed hard even for quantum computers[1]. ML-KEM and ML-DSA, NIST's main post-quantum standards, work this way.
Source: Mctaba Labs, “Lattice Cryptography Explained Without the Heavy Math”, last verified 4 December 2026, mctaba.com/learn/cryptography/lattice-cryptography-explained
At a glance
- A lattice is a regular grid of points. Finding the grid point nearest a given spot is easy on paper, and no fast method is known in the very high dimensions real schemes use.
- Learning With Errors, introduced by Oded Regev in 2005[2], hides a secret inside equations with small random errors. It is the maths under ML-KEM and ML-DSA.
- ML-KEM and ML-DSA use module lattices, a structured kind built from polynomials. Structure makes them efficient and gives attackers more algebra to try.
- Anthropic's papers of 30 November 2026[3] found a quantum algorithm that is “not practical for the parameter sets of ML-KEM and ML-DSA”[4]. The UK's NCSC said the work does not threaten the deployed standards[5].
- The papers lowered Anthropic's long-term confidence in structured lattices and raised it for unstructured ones. The advice stands: move to the standards and keep the ability to switch algorithms.
What is a lattice?
Picture an orchard planted in perfect rows, or the corners of the squares on graph paper. That regular pattern of points is a lattice. Formally, you pick a few arrows, called a basis, and the lattice is every point you can reach by adding whole-number multiples of them.
Two questions about lattices carry the security. The shortest vector problem asks for the shortest non-zero arrow in the lattice. The closest vector problem gives you a random spot and asks for the nearest lattice point. On flat graph paper both are easy. In the very high dimensions real schemes use, with a badly skewed basis, no fast method is known.
The same lattice can be described by short, nearly square arrows or by long, skewed ones. With the good set, finding the nearest point is easy; with the bad set, nobody knows how to do it fast. That gap can serve as a trapdoor, with the good basis as a private key and the bad one as a public key. Falcon, the scheme behind the coming FN-DSA standard, is a hash-then-sign signature scheme[6] built on this idea: it instantiates the Gentry, Peikert and Vaikuntanathan framework over NTRU lattices[7].
This page is part of a series: start from the hub or what post-quantum cryptography is if the topic is new.
How do you hide a secret in noise?
Learning With Errors, usually shortened to LWE, turns lattices into something you can compute with. Imagine a teacher who picks a secret list of numbers and hands out a stack of sums. Each sum mixes the secret numbers with public random weights, then gets a small random nudge, one or two up or down. All the arithmetic wraps around a fixed number called the modulus, like hours on a clock.
Without the nudges, the stack is a set of linear equations that school algebra solves in moments. With them, every step of the elimination spreads the errors until the answer drowns. Cloudflare's lattice primer states the problem this way: it “asks the attacker to distinguish between two distributions”[8], noisy sums on one side and pure random numbers on the other.
Why is that a lattice problem? The noisy sums describe a point that sits close to, but not on, a lattice point. Recovering the secret means finding that nearest lattice point: the closest vector problem in disguise.
Where did Learning With Errors come from, and why is it trusted?
Oded Regev introduced LWE in On lattices, learning with errors, random linear codes, and cryptography, first published at STOC 2005[2], the ACM's Symposium on Theory of Computing, with a journal version in the Journal of the ACM in September 2009[9].
His main result is why cryptographers trust LWE. Regev gave a reduction from worst-case lattice problems such as GapSVP and SIVP[2], approximate shortest-vector problems, to LWE, and built a public-key cryptosystem whose security rests on LWE[2]. In plain words: anyone who could solve typical LWE instances could also solve the hardest instances of well-studied lattice problems. The reduction is quantum[2], so it shows LWE is at least as hard as those problems are for a quantum computer.
Why would a quantum computer struggle with lattices?
On a large enough quantum computer, Shor's algorithm would break RSA and elliptic curves by finding a hidden period, a repeating pattern buried in the maths (how quantum computers could break RSA and elliptic curves explains it). No comparable quantum shortcut is known for lattice problems at the sizes in use. FIPS 203 says that at present ML-KEM “is believed to be secure, even against adversaries who possess a quantum computer”[1], and FIPS 204 says ML-DSA is believed secure even against “adversaries in possession of a large-scale fault-tolerant quantum computer”[10].
Note the word believed. Lattice hardness is a well-tested assumption, not a proof, which is why new attacks get close attention. The stakes are already real: traffic recorded today could be decrypted later if its key exchange ever falls, the threat known as harvest now, decrypt later. Lattices already carry much of that protection: over 65% of human traffic to Cloudflare was post-quantum encrypted in April 2026[11], and Signal's Sparse Post Quantum Ratchet uses ML-KEM 768[12].
What are module lattices, and why do ML-KEM and ML-DSA use them?
Plain LWE needs a large table of random numbers as its public key. Structured versions replace the numbers with polynomials, so one short polynomial stands in for a whole block of the table. Ring-LWE uses single polynomials; module LWE uses a small grid of them.
ML-KEM and ML-DSA both rest on module LWE. FIPS 203 names its scheme ML-KEM “as it is based on the Module Learning With Errors assumption”[1], and FIPS 204 says ML-DSA is based on the Module Learning With Errors problem[10]. The Cryptography Incident Review Group (CIRG), a group of cryptographers[13] who assessed the November papers, describes the shape: each component has degree n = 256[14], and the standards reach higher security levels by adding components (the rank k) while keeping n fixed[14]. So ML-KEM-512, ML-KEM-768 and ML-KEM-1024 differ in how many components they stack, not in the size of each.
Structure is a trade. It shrinks keys and speeds up the arithmetic, and it hands attackers extra algebra to work with. It is also everywhere in the new standards: of the first algorithms NIST selected, three rest on structured lattices and the fourth on hash functions[15]. Sizes and parameter choices are covered in the NIST post-quantum standards explained.
What did Anthropic's November lattice papers change, and what did they not?
On 30 November 2026 Anthropic released four theoretical papers on lattice cryptography[3], with results found using unreleased Claude models. The CIRG describes the most prominent claim as a quantum, quasi-polynomial-time algorithm[14] for certain module-lattice problems, including some versions of Ring-LWE and Module-LWE. It also states the significance plainly: “if these standards were scaled up in a certain way, their quantum security would increase much more slowly than previously believed”[14].
What it did not change:
- The real standards. The speed-up grows with the degree n, while ML-KEM and ML-DSA keep n fixed and add components instead. Against them, the CIRG found the attack “requires vastly more computation than the best previously known attacks”[14], and that even 2 to the power of 1,000 quantum operations[14] would be far below its cost for ML-KEM-512 and ML-DSA-44. Anthropic's own paper calls the algorithms galactic[16].
- Classical attacks. According to the CIRG, Anthropic found no improvement in classical (non-quantum) attacks[14] on any mainstream lattice system, and none in quantum attacks on unstructured lattices.
- The official verdict. The NCSC said the work “does not represent a threat to the standardised and deployed lattice-based post-quantum cryptography algorithms ML-KEM and ML-DSA”[5].
What it did change is confidence. Anthropic said the results lower its long-term confidence in structured lattices, calling them “a limited signal that weaknesses in structured lattices could be found in the future”[3], while its other three papers raise its overall confidence in unstructured lattices[3]. The CIRG called the unstructured findings meaningful evidence[14] for those systems, and expects the attack to be improved[14]; the open question is whether improvements reach the real standards.
Some coverage suggested that AI had defeated post-quantum encryption. That is false: the papers describe a theoretical quantum algorithm for key sizes far beyond any in use, and Anthropic said they do not have practical, real-world consequences[3] for today's systems. The reviewers recommend continuing the transition[14], hybrids that combine different mathematical foundations and agile systems[14], and standardising more schemes based on diverse designs[14]. A hybrid of X25519 and ML-KEM guards against a classical break of the lattice half; against an improved quantum attack, which would also break X25519, the protection is agility and those more diverse standards. AI and cryptanalysis: what Anthropic found has the full story.
For developers: what does Learning With Errors look like in code?
Here is the whole idea in a few lines of Python. It encrypts one bit, uses tiny numbers and is insecure by design: read it, run it, never ship it.
toy_lwe.py# Toy Learning With Errors (LWE) encryption of one bit.
# Insecure by design: tiny numbers, for intuition only. Never use this for real data.
import random
q = 97 # the modulus: all arithmetic wraps around at q, like hours on a clock
n = 4 # length of the secret (real schemes use far longer ones)
m = 20 # how many noisy equations make up the public key
secret = [random.randrange(q) for _ in range(n)]
def noisy_equation():
a = [random.randrange(q) for _ in range(n)]
error = random.choice([-1, 0, 1]) # the small error that hides the secret
b = (sum(x * s for x, s in zip(a, secret)) + error) % q
return a, b
public_key = [noisy_equation() for _ in range(m)]
def encrypt(bit):
rows = [eq for eq in public_key if random.random() < 0.5] # add up a random handful
a = [sum(r[0][i] for r in rows) % q for i in range(n)]
b = (sum(r[1] for r in rows) + bit * (q // 2)) % q # a 1 shifts the total by half the clock
return a, b
def decrypt(ciphertext):
a, b = ciphertext
v = (b - sum(x * s for x, s in zip(a, secret))) % q # what is left: small errors, plus q/2 for a 1
return 0 if min(v, q - v) < q // 4 else 1
assert all(decrypt(encrypt(bit)) == bit for bit in [0, 1] * 500)
print("secret:", secret, "| one public equation:", public_key[0])The public key is a pile of noisy equations. To encrypt, add up a random handful of them and, if the bit is a one, shift the total by half the modulus. Only the secret holder can subtract the secret part and see whether what remains sits near zero (the bit was zero) or near the halfway mark (the bit was one). The errors add up but stay small enough not to blur the answer.
ML-KEM follows the same pattern with module lattices, far larger parameters and extra steps that make it safe to use as a key-encapsulation mechanism (KEM). In production, call a maintained library: an ML-KEM-768 encapsulation key is 1,184 bytes[1] and its ciphertext 1,088 bytes[1], so plan storage and message sizes for that.
Where can I learn lattice cryptography properly?
The best next step is Cloudflare's tutorial Prepping for post-quantum: a beginner's guide to lattice cryptography, by Christopher Patton and Peter Schwabe, published on 21 March 2025[8]: read the lattice primer on the Cloudflare blog. After that, Regev's paper, cited above, is the classic source.
Frequently asked questions
- Why is it called Learning With Errors?
- Because the task is to learn a secret from examples that each carry a small error. Without the errors, ordinary algebra recovers the secret at once. Oded Regev introduced the problem in a paper first published at STOC 2005[2].
- Is lattice cryptography quantum safe?
- As far as anyone has shown, at the sizes in use. FIPS 203 says that at present ML-KEM “is believed to be secure, even against adversaries who possess a quantum computer”[1], and after Anthropic's November papers the NCSC said they do not represent a threat[5] to ML-KEM or ML-DSA.
- What is the difference between structured and unstructured lattices?
- Unstructured lattices come from plain Learning With Errors, a big random table with no pattern. Structured ones, used by ML-KEM and ML-DSA, build that table from polynomials, which keeps keys small. Anthropic's papers lowered its long-term confidence in structured lattices and raised its confidence in unstructured lattices[3].
- Did Anthropic's research break lattice cryptography?
- No. It found a quantum algorithm that is faster in theory for some structured-lattice problems, but only for key sizes far larger than any in use. Anthropic said the results “do not have practical, real-world consequences for today's security systems”[3].
- Do I need to understand lattices to use ML-KEM?
- No. Use a maintained library, choose ML-KEM-768 or larger, run it as a hybrid with your current key exchange and plan for the bigger sizes. The maths matters for judging news about attacks, not for writing the integration.
Sources
- [1] NIST, 13 August 2024, checked 4 December 2026
- [2] Oded Regev (author's copy), 2 May 2009, checked 4 December 2026
- [3] Anthropic (X post), 30 November 2026, checked 4 December 2026
- [4] Anthropic (GitHub, anthropics/formal-math), 30 November 2026, checked 4 December 2026
- [5] UK National Cyber Security Centre, 1 December 2026, checked 4 December 2026
- [6] NIST CSRC, 25 September 2025, checked 4 December 2026
- [7] Falcon team (falcon-sign.info), checked 4 December 2026
- [8] Cloudflare, 21 March 2025, checked 4 December 2026
- [9] ACM, September 2009, checked 4 December 2026
- [10] NIST, 13 August 2024, checked 4 December 2026
- [11] Cloudflare, 7 April 2026, checked 4 December 2026
- [12] Signal (blog), 2 October 2025, checked 4 December 2026
- [13] Cryptography Incident Review Group, 30 November 2026, checked 4 December 2026
- [14] Cryptography Incident Review Group, 30 November 2026, checked 4 December 2026
- [15] NIST, 27 February 2026, checked 4 December 2026
- [16] Anthropic, November 2026, checked 4 December 2026
Related guides
- What Is Post-Quantum Cryptography? A Plain-English Explanation (2026)
- NIST Post-Quantum Standards Explained: ML-KEM, ML-DSA, SLH-DSA, FN-DSA and HQC
- AI and Cryptanalysis: What Anthropic's Lattice Findings Mean and What They Don't
- How Quantum Computers Could Break RSA and Elliptic Curve Encryption
- Harvest Now, Decrypt Later: Why Today's Data Is Already at Risk
- Cryptography explained: the full series
