← Back to section · Post-Quantum Cryptography

LLL and BKZ: How Lattice Basis Reduction Turns Bad Bases Good

Basis reduction is the core engine of lattice attacks and lattice analysis. This article explains what a reduced basis means, LLL's polynomial-time approximation guarantee, how BKZ trades block size for quality, and how the Hermite factor measures the quality of a reduction.

Published 22 November 2026 · 5 min read · PQ Frontier

LLL and BKZ: How Lattice Basis Reduction Turns Bad Bases Good
AI-generated site artwork
Video explainer · Lattice cryptography: SVP

Given a basis of a lattice, the first thing an attacker does is almost always reduction: use a unimodular transformation to replace the basis with another basis of the same lattice — shorter vectors, closer to mutually orthogonal. In a reduced basis, the first vector is an approximation to the shortest vector, and the more orthogonal the basis, the better decoding algorithms such as Babai’s nearest plane perform. Everyday lattice attack and defense is, in a sense, a contest of reduction quality: attackers use reduction to close in on the private key, and parameter designers work backwards from “how well can reduction do” to decide how large the dimension must be. This field has two milestone algorithms: LLL and BKZ.

What is a “reduced basis”?

The quality of a basis depends on two things: vector lengths and orthogonality. Gram–Schmidt orthogonalization quantifies this: if the basis vectors deviate little from their orthogonalized images (the size-reduction condition: projection coefficients have absolute value at most 1/2) and the orthogonalized lengths decay gently, the basis is “short and orthogonal.” Perfect orthogonality is generally unattainable (the discreteness of lattice points means a basis cannot be rotated freely); reduction approaches this ideal as closely as the unimodular constraint allows. The standard metric is the root-Hermite factor δ: the first vector of a reduced basis has length about δⁿ · det(L)^(1/n), and the closer δ is to 1, the better. It compresses “quality” into a single number, and the δ an attacker can achieve translates directly into the scale of problems they can solve in security estimates.

LLL: the art of approximation in polynomial time

The LLL algorithm, proposed by Lenstra, Lenstra and Lovász in 1982, is the starting point of modern lattice algorithms. It repeatedly performs two steps: first size reduction, subtracting integer multiples of earlier vectors from each basis vector so that projection coefficients fall into [−1/2, 1/2]; then a check of the Lovász condition on adjacent vectors — if some orthogonalized length decays too fast (meaning swapping the adjacent vectors would improve the basis), swap them and step back. The whole process is proved to terminate in polynomial time.

LLL’s guarantee: the first vector of the output basis is at most on the order of 2^((n−1)/2) times λ₁ — that is, it solves SVP with an approximation factor exponential in the dimension. Polynomial time, exponential approximation: this is the realistic picture of the hardness spectrum at large n. In low dimensions (a few dozen) LLL is formidable and can directly solve many seemingly hard instances — historically, several knapsack-type and low-density subset-sum schemes fell exactly this way; but at several hundred dimensions, a 2^(n/2) approximation factor comes nowhere near the short vectors of cryptographic instances. LLL’s other identity is as preprocessing: it is the first step of nearly every stronger reduction and decoding algorithm.

BKZ: trading block size for quality

To do better than LLL, one must pay exponential cost. Schnorr’s BKZ (Block Korkine–Zolotarev) algorithm widens the view from adjacent vectors to blocks: take β consecutive basis vectors in a sliding window, form the local lattice they span (in the Gram–Schmidt projection sense), solve SVP exactly or near-exactly in this β-dimensional sublattice, insert the result back into the basis, slide the window across the whole basis, and repeat for many tours until quality stops improving. β is BKZ’s gear knob: at β = 2 it degenerates to LLL-like behavior, and as β grows the local solving becomes more thorough and the output basis closer to truly short vectors.

Local SVP is solved by sieving or enumeration: sieving costs time and memory exponential in the block dimension, with commonly cited magnitude estimates of about 2^(0.292β) operations for classical sieving and about 2^(0.257β) for quantum sieving; enumeration is faster on small blocks but has a larger exponential base. BKZ’s total cost model can thus be sketched as “polynomially many local calls × the cost of one β-dimensional SVP” — and this is precisely the skeleton of security parameter estimation: when a parameter set claims “X bits of security,” it is mostly asking how expensive BKZ’s β must become to break it.

From algorithms to engineering

Beyond theory, reduction is a craft: floating-point precision management (Gram–Schmidt values overflow and lose accuracy in high dimensions, requiring Givens rotations, high-precision floats and similar techniques), pruned enumeration, and the memory scheduling of sieving databases all deeply affect the dimensions actually reachable. Open-source implementations such as fplll/fpylll and the sieving framework G6K are the community’s public yardsticks for evaluating parameters; any serious parameter proposal must report “under the current best reduction implementations, what does an attack cost?” Reduction is also a construction tool: trapdoor sampling, and the key generation of some schemes, must first manufacture a good basis internally.

Reduction’s record and its boundary

Reduction’s power is documented in cryptanalytic history: low-density subset-sum (knapsack) schemes, several early lattice-type and RSA-related constructions (including parts of small-private-exponent attacks) were broken outright by LLL-grade reduction at scales of a few dozen dimensions. These results draw an empirical boundary: problems in under a hundred dimensions whose target vectors are significantly shorter than the Gaussian heuristic predicts are often within reduction’s easy reach — exactly the region parameter design must stay away from. In the other direction, public lattice challenges (such as the SVP Challenge) record the dimensions the community has actually reached with BKZ plus sieving/enumeration on random lattices with no predictable short vector — these public records are the most honest anchors for calibrating cost models: the predicted exponential curves must line up with measured challenge points before parameter estimates deserve trust. Reduction’s other face should be seen clearly too: it is an art of exponential cost, and each increment of β raises time and memory exponentially; against cryptographic parameters in several hundred dimensions whose target vectors are not anomalously prominent, known reduction techniques still fall exponentially short — and that gap is the security margin of lattice schemes themselves.

Summary

LLL proved that reduction can achieve exponential approximation in polynomial time; BKZ provides a curve along which exponential cost continuously buys quality. The attacker picks a gear on this curve; the designer sets parameters by the curve’s position. With this engine understood, the attack and defense of LWE — why noise makes the closest-point problem so hard to solve — comes with a yardstick already in hand.

Tags: LLLBKZbasis reductionlattice attacks