On this page
Much of today's public-key encryption rests on two problems: factoring large numbers and computing discrete logarithms. In a paper published in 1997, Peter Shor gave algorithms that solve both in polynomial time on a quantum computer (Shor, SIAM Journal on Computing). The replacement that took most places in the new US standards is about grids of points, and Class 12 vectors and determinants are enough to follow it.
What is a lattice in cryptography?
Take n linearly independent vectors b1, ..., bn. The lattice they generate is the set of all integer combinations a1b1 + ... + anbn, where every ai is a whole number. The vectors are called a basis.
In two dimensions, take g1 = (3, 1) and g2 = (−1, 2). Then g1 + g2 = (2, 3) and g1 − g2 = (4, −1) are lattice points, but (1, 1) is not. A quick test: (x, y) is in this lattice exactly when 2x + y is divisible by 7.
The key fact is that one lattice has many bases. Multiply a basis by an integer matrix with determinant ±1 and you get another basis for the same points (the change-of-basis matrix explains the general idea). With the matrix rows (3, 1) and (5, 2), whose determinant is 1:
b1 = 3g1 + g2 = (8, 5)
b2 = 5g1 + 2g2 = (13, 9)
You can get back: 2b1 − b2 = (3, 1) and 3b2 − 5b1 = (−1, 2). Both bases span parallelograms of area 7, since |3·2 − 1·(−1)| = 7 and |8·9 − 5·13| = 7.
What is the shortest vector problem?
The shortest vector problem (SVP) asks: given a basis, find the shortest non-zero vector in the lattice (Regev, lecture notes on the LLL algorithm).
In our example the answer is ±(−1, 2), with length √5. Check it with the divisibility test: no shorter integer vector, such as (1, 0), (1, 1) or (2, 0), passes. With the good basis the answer is staring at you: it is g2. The bad basis shows two long vectors, of lengths √89 and √250, pointing almost the same way, with no hint of (−1, 2).
In two dimensions you can always find it. In hundreds of dimensions it is believed to be hard. Miklós Ajtai proved in 1998 that SVP is NP-hard under randomised reductions (Ajtai, STOC 1998).
How does LLL reduction turn a bad basis into a good one?
Gauss solved two dimensions in 1801. In 1982 A. K. Lenstra, H. W. Lenstra Jr. and László Lovász published the LLL algorithm, which works in any dimension and runs in polynomial time (Lenstra, Lenstra and Lovász, Mathematische Annalen). The catch: it only promises a vector within a factor of (2/√3)^n of the shortest, where n is the dimension (Regev's notes). For n = 500 that bound is more than 10^31. LLL leans on Gram–Schmidt orthogonalisation; in two dimensions it reduces to Gauss's subtract-and-swap, which you can run by hand:
Start with b1 = (8, 5), |b1|² = 89, and b2 = (13, 9), |b2|² = 250.
b1·b2 = 149, and 149/89 ≈ 1.67 rounds to 2. Replace b2 by b2 − 2b1 = (−3, −1), with |b2|² = 10. It is now shorter, so swap.
Now b1 = (−3, −1), b2 = (8, 5). b1·b2 = −29, and −29/10 = −2.9 rounds to −3. Replace b2 by b2 + 3b1 = (−1, 2), with |b2|² = 5. Swap again.
Now b1 = (−1, 2), b2 = (−3, −1). b1·b2 = 1, and 1/5 rounds to 0. Stop.
The result, (−1, 2) and (−3, −1), is short and almost perpendicular, and its first vector solves SVP. It works like Euclid's algorithm for the gcd: subtract the nearest whole multiple, then swap.
If a step feels shaky, the dot product, projections or determinants behind it are each a short read in the Fermi Concept Library.
Why are lattices used for post-quantum cryptography?
First, there is a security proof. Oded Regev's learning-with-errors cryptosystem is secure as long as worst-case lattice problems such as GapSVP are hard for quantum computers (Regev, Journal of the ACM, 2009). So an efficient attack on random instances would give a quantum algorithm for the hardest instances.
Second, it is now standard. On 13 August 2024, NIST released its first three finalised post-quantum standards (NIST announcement):
FIPS 203, ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism), the primary standard for general encryption, with comparatively small keys and fast operation.
FIPS 204, ML-DSA (Module-Lattice-Based Digital Signature Algorithm), the primary standard for digital signatures.
FIPS 205, SLH-DSA, a hash-based signature standard kept as a backup in case ML-DSA proves vulnerable.
Dustin Moody, who heads NIST's post-quantum project, said: "There is no need to wait for future standards."
The grid you just reduced by hand is the same kind of object, in hundreds of dimensions. Next, read about Minkowski's lattice point theorem, or practise vector and matrix problems step by step in the Fermi Problem Library.



