A Problem Built from Noise
The previous page built one-way functions and collision-resistant hashing on the difficulty of finding
short vectors in a random lattice, and closed by naming what that construction is not known to reach:
public-key encryption. The difficulty was structural. The function
\(\mathbf{z} \mapsto \mathbf{A}\mathbf{z}\) is compressing on short inputs and, once \(\mathbf{A}\)
has many columns, essentially surjective. A map of that shape is a hash, which destroys information
rather than preserving it behind an injective trapdoor. This page introduces the problem that supplies
the missing shape, the same \(q\)-ary geometry read through an injective map, made hard not by
compression but by a controlled amount of noise.
Convention. Where the short-integer-solution problem multiplied its unknown vector on
the right, as \(\mathbf{A}\mathbf{z}\), the problem of this page places its secret on the left, as
\(\mathbf{s}^\top\mathbf{A}\). The change is not substantive. It reflects that the two problems are
duals of one another, a relationship the next section makes exact. But the convention is worth fixing
now, because it governs every formula below.
The Distribution
Fix a dimension \(n\) and a modulus \(q\), as before, together with an error
distribution \(\chi\) over \(\mathbb{Z}\). Typically \(\chi\) is a discrete Gaussian of width
parameter \(\alpha q\), so that its standard deviation is of order \(\alpha q\), for some
\(\alpha \lt 1\), and the parameter \(\alpha\) is called the relative error rate. A secret
vector \(\mathbf{s} \in \mathbb{Z}_q^n\) is fixed once. The problem is presented not as a single
equation but as a source of noisy linear measurements of that secret.
Definition: The LWE Distribution
For a secret \(\mathbf{s} \in \mathbb{Z}_q^n\), the LWE distribution
\(A_{\mathbf{s}, \chi}\) over \(\mathbb{Z}_q^n \times \mathbb{Z}_q\) is sampled by choosing
\(\mathbf{a} \in \mathbb{Z}_q^n\) uniformly at random, drawing an error \(e \leftarrow \chi\), and
outputting
\[
(\mathbf{a}, b = \langle \mathbf{s}, \mathbf{a} \rangle + e \bmod q).
\]
The second coordinate of each sample is an
inner
product of the secret with a random vector, computed modulo \(q\) and then pushed off its
true value by a small error. Without the error the samples would be exact linear equations, and about
\(n\) of them would typically pin down \(\mathbf{s}\) by Gaussian elimination in polynomial time. This
is the same collapse that made unbounded SIS trivial, here for an inhomogeneous linear system instead
of a homogeneous one. The noise is the entire difficulty. It is small enough that the samples still
carry information about \(\mathbf{s}\), yet large enough that no efficient procedure has been found to
disentangle the secret from the error.
Two Problems, Search and Decision
From this one distribution grow two problems, and the distinction between them will matter for both
the hardness reduction and the encryption scheme.
Definition: Search-LWE
Given \(m\) independent samples \((\mathbf{a}_i, b_i) \in \mathbb{Z}_q^n \times \mathbb{Z}_q\)
drawn from \(A_{\mathbf{s}, \chi}\) for a uniformly random secret \(\mathbf{s} \in \mathbb{Z}_q^n\)
fixed across all samples, search-LWE asks to recover \(\mathbf{s}\).
Definition: Decision-LWE
Given \(m\) independent samples \((\mathbf{a}_i, b_i) \in \mathbb{Z}_q^n \times \mathbb{Z}_q\),
where every sample is drawn either (1) from \(A_{\mathbf{s}, \chi}\) for a uniformly random
\(\mathbf{s}\) fixed across all samples, or (2) from the uniform distribution on
\(\mathbb{Z}_q^n \times \mathbb{Z}_q\), decision-LWE asks to distinguish which
of the two is the case, with non-negligible advantage.
Search asks to extract the secret. Decision asks only whether a secret is there at all, that is,
whether the noisy samples are structured or merely random. An encryption scheme leans on the hardness
of decision, since hiding a message amounts to making a ciphertext indistinguishable from noise.
As with the previous problem, the sample count \(m\) is of secondary importance, taken large enough
that the secret is determined with high probability and otherwise left unspecified. For a prime
modulus polynomial in \(n\), the two problems turn out to be equivalent up to a polynomial loss, a
fact the hardness section returns to. For now it is enough that both are believed hard, and that the
belief will shortly be anchored to the worst-case lattice problems of the previous pages.
The Dual of the Hash
The short-integer-solution problem was a shortest-vector problem on the \(q\)-ary lattice
\(\mathcal{L}^\perp(\mathbf{A})\). Learning with errors is also a lattice problem, on a different
lattice built from the same matrix. The relationship between the two lattices is exactly the
relationship between a hash and the encryption it could not provide.
Definition: The LWE Lattice \(\mathcal{L}(\mathbf{A})\)
For a matrix \(\mathbf{A} \in \mathbb{Z}_q^{n \times m}\), the associated LWE
lattice is
\[
\mathcal{L}(\mathbf{A}) = \{\, \mathbf{A}^\top \mathbf{s} : \mathbf{s} \in \mathbb{Z}^n \,\} +
q\mathbb{Z}^m,
\]
the set of all integer vectors congruent modulo \(q\) to some \(\mathbf{A}^\top\mathbf{s}\).
Here \(\mathbf{s}\) ranges over integer vectors, but only its residues modulo \(q\) matter.
Changing \(\mathbf{s}\) by a multiple of \(q\) shifts \(\mathbf{A}^\top\mathbf{s}\) by an element
of \(q\mathbb{Z}^m\), which the summand \(q\mathbb{Z}^m\) absorbs. The set is therefore well
defined, and \(\mathbf{s}\) may equally be read as an element of \(\mathbb{Z}_q^n\).
The connection to the samples is immediate. If we collect \(m\) LWE samples into a matrix
\(\mathbf{A}\) whose columns are the \(\mathbf{a}_i\) and a vector \(\mathbf{b}\) whose entries are
the \(b_i\), the defining relation becomes
\[
\mathbf{b}^\top \equiv \mathbf{s}^\top \mathbf{A} + \mathbf{e}^\top \pmod q, \quad \mathbf{e}
\leftarrow \chi^m.
\]
The noiseless part \(\mathbf{A}^\top\mathbf{s}\) is a point of \(\mathcal{L}(\mathbf{A})\), and the
observed \(\mathbf{b}\) is that point displaced by the short error \(\mathbf{e}\). Recovering the
secret amounts to recovering the lattice point closest to \(\mathbf{b}\), provided the error is small
enough that exactly one lattice point is within reach. The identification also requires the map
\(\mathbf{s} \mapsto \mathbf{A}^\top\mathbf{s} \bmod q\) to be injective, a condition that holds with
high probability when \(m\) is large compared with \(n\).
An Average-Case Bounded-Distance Problem
This recovery is a decoding problem. The target \(\mathbf{b}\) lies close to
\(\mathcal{L}(\mathbf{A})\), displaced from a lattice point by the error vector. For the parameters of
interest, that distance lies, with overwhelming probability, below half the minimum distance
\(\lambda_1\) of \(\mathcal{L}(\mathbf{A})\), so that a single lattice point is unambiguously the
nearest, and the task is to find that unique nearby lattice point.
That task is precisely bounded-distance
decoding, now in an average-case form. The lattice \(\mathcal{L}(\mathbf{A})\) is random
rather than adversarial, and the target is generated by the LWE distribution. Search-LWE is
average-case BDD on the family of LWE lattices, exactly as SIS was an average-case shortest-vector
problem on the family of \(q\)-ary lattices. In the other case of decision-LWE, where the samples are
uniform instead, the vector \(\mathbf{b}\) is far from every lattice point with high probability, and
no nearby point exists to decode.
The Two Lattices Are Dual
The SIS lattice and the LWE lattice are built from the same \(\mathbf{A}\), and they are duals of
one another up to a scale of \(q\):
\[
\mathcal{L}(\mathbf{A}) = q \cdot \mathcal{L}^\perp(\mathbf{A})^*.
\]
By definition, a vector \(\mathbf{y}\) lies in \(q \cdot \mathcal{L}^\perp(\mathbf{A})^*\) exactly
when \(\mathbf{y}/q \in \mathcal{L}^\perp(\mathbf{A})^*\). The definition of the dual turns this
into the condition that \(\langle \mathbf{z}, \mathbf{y}/q \rangle \in \mathbb{Z}\) for every
\(\mathbf{z} \in \mathcal{L}^\perp(\mathbf{A})\), that is, for every \(\mathbf{z}\) with
\(\mathbf{A}\mathbf{z} = \mathbf{0} \bmod q\). Every vector \(q\mathbf{u}\) with
\(\mathbf{u} \in \mathbb{Z}^m\) lies in \(\mathcal{L}^\perp(\mathbf{A})\), so taking
\(\mathbf{u}\) to be each standard basis vector shows that such a \(\mathbf{y}\) has integer
entries. The membership condition can therefore equally be written
\(\langle \mathbf{z}, \mathbf{y} \rangle \equiv 0 \pmod q\). Every vector congruent to some
\(\mathbf{A}^\top\mathbf{s}\) satisfies it, since
\[
\langle \mathbf{z}, \mathbf{A}^\top\mathbf{s} \rangle
= \langle \mathbf{A}\mathbf{z}, \mathbf{s} \rangle \equiv 0 \pmod q.
\]
For prime \(q\) the converse is a dimension count in \(\mathbb{Z}_q^m\). The residues satisfying
the condition form the orthogonal complement of \(\ker \mathbf{A}\), of dimension
\(m - \dim \ker \mathbf{A} = \operatorname{rank} \mathbf{A}\), and they contain the row space of
\(\mathbf{A}\), which has the same dimension, so the two coincide. For composite \(q\) the
converse still holds, by linear algebra over \(\mathbb{Z}_q\) that we take for granted here.
Either way, the vectors satisfying the condition are exactly those of \(\mathcal{L}(\mathbf{A})\).
The
dual
lattice introduced in the geometry pages, developed there with no application in
sight, is exactly the bridge between the two central problems of lattice cryptography.
Why One Hashes and the Other Encrypts
The duality is not a curiosity. It is the reason the two problems support different cryptography. SIS
is concerned with the map \(\mathbf{z} \mapsto \mathbf{A}\mathbf{z}\), which sends a short vector to
its syndrome. For large \(m\) the map is surjective with high probability, and since it is
many-to-one on short inputs, it cannot be inverted to a unique input. That is the shape of a hash.
LWE is concerned with the map \(\mathbf{s} \mapsto \mathbf{A}^\top\mathbf{s}\), which embeds a secret
into a higher-dimensional space, where noise then perturbs the image. Once \(m\) is large, this map is
injective with high probability. An injective map admits, in principle, a unique preimage,
and the noise is what hides it. A unique preimage that only a hidden key can recover is the shape of a
trapdoor, and a trapdoor is the traditional route to public-key encryption. The surjective
side compresses and destroys. The injective side embeds and conceals. That is the whole difference,
and the final section turns it into a scheme.
A Quantum Reduction
Learning with errors inherits the guarantee that made its predecessor trustworthy. It is hard on
average provided a worst-case lattice problem is hard even for quantum algorithms. But the reduction
that establishes this differs from the one for the short-integer-solution problem in a way that is not
incidental. The difference is quantum. This is the point at which the thread left hanging by
the earlier pages is drawn tight: that lattices appear to resist quantum attack, yet are not untouched
by quantum computation.
Theorem: Worst-Case Hardness of LWE
Fix any \(m = \mathrm{poly}(n)\), any modulus \(q \leq 2^{\mathrm{poly}(n)}\), and a discretized
Gaussian error distribution \(\chi\) of width parameter \(\alpha q \geq 2\sqrt{n}\) with
\(0 \lt \alpha \lt 1\). If there is an efficient algorithm that solves
decision-LWE,
then there is an efficient quantum algorithm that solves
\(\mathrm{GapSVP}_\gamma\)
and
\(\mathrm{SIVP}_\gamma\)
on every \(n\)-dimensional lattice, for an approximation factor \(\gamma = \tilde{O}(n/\alpha)\).
As with the short-integer-solution problem, the exact modulus and sample count do not enter the
approximation factor of this reduction. The strength of the conclusion is governed by the
error rate \(\alpha\), through the factor \(\gamma = \tilde{O}(n/\alpha)\). Smaller noise means a
smaller \(\alpha\), hence a larger \(\gamma\), which is a weaker guarantee. There is therefore a
genuine tension. With too little noise the problem loses its worst-case backing, and with too much the
samples cease to determine the secret. The reduction converts any algorithm solving LWE, classical or
quantum, into a quantum algorithm for lattice problems. It runs in two steps, and the second is where
the quantum Fourier transform re-enters the story.
The Two Steps
The reduction is iterative. It produces progressively narrower Gaussian samples over the input lattice
\(\mathcal{L}\) until they are sharp enough to read off solutions to the lattice problems of the
theorem. One iteration couples a classical step to a quantum one. The LWE oracle it calls is the
search form, while the theorem above assumes only the decision form. The
bootstrapping that converts one into the other is recorded right after the sketch below.
One iteration of the reduction
Step one, classical. Given an oracle for search-LWE and a supply of discrete
Gaussian samples over \(\mathcal{L}\) of some width \(r\), one solves bounded-distance decoding on
the dual lattice \(\mathcal{L}^*\), to within a distance \(d \approx \alpha q / r\). The
Gaussian samples over \(\mathcal{L}\) are combined with the BDD target to manufacture properly
distributed LWE samples. The secret the oracle then recovers is exactly what pins down the
closest dual-lattice vector, which solves the decoding instance.
Step two, quantum. Given an oracle for bounded-distance decoding on
\(\mathcal{L}^*\) to within distance \(d\), one generates discrete Gaussian samples over
\(\mathcal{L}\) of a narrower width \(r' \approx \sqrt{n}/d\). This is the step
with no known classical counterpart. The BDD oracle is used to prepare a quantum state.
Computing the quantum Fourier transform on that state and measuring it yields a fresh
Gaussian sample over \(\mathcal{L}\).
Substituting \(d \approx \alpha q / r\) into \(r' \approx \sqrt{n}/d\) gives
\(r' \approx \sqrt{n}\, r / (\alpha q)\), so the condition \(\alpha q \geq 2\sqrt{n}\) makes
\(r'\) at most about \(r/2\). The width produced by step two is smaller than the width step one
consumed, by a constant factor.
Feeding \(r'\) back into step one and iterating drives the Gaussian width steadily down, until the
samples over \(\mathcal{L}\) are narrow enough that \(\mathrm{SIVP}_\gamma\) and
\(\mathrm{GapSVP}_\gamma\) fall out directly. The detailed accounting of the widths and the
discrete-Gaussian machinery that makes each step precise are beyond the scope of this page. What
matters here is the architecture, in which a classical decoding step alternates with a quantum
sampling step, and the role of the quantum transform in the second.
Here is that bootstrapping. For a prime modulus of size polynomial in \(n\), search and decision
agree, up to a polynomial loss in the sample count, and later work extends the hardness of the
decision form to every modulus the theorem allows. An oracle that merely distinguishes LWE samples
from uniform can be bootstrapped, one coordinate of the secret at a time, into one that recovers the
whole secret. That is the search oracle the reduction called for. The reverse direction is immediate,
since a search oracle can distinguish by checking whether the residuals
\(b_i - \langle \mathbf{s}, \mathbf{a}_i \rangle\) of its answer are small. The encryption scheme of
the next section needs the decision form, which the theorem above addresses directly.
Why the Reduction Is Quantum, and What That Means
The quantum step is not a mere convenience. There is no known classical procedure that generates the
narrower Gaussian samples from a BDD oracle, and the quantum Fourier transform is, so far, essential
to that construction. This has a precise and initially unsettling consequence. The theorem guarantees
only that breaking LWE yields a quantum algorithm for lattice problems. Hence, through this
theorem alone, a classical algorithm breaking LWE would still imply merely a quantum lattice
algorithm, not a classical one.
Later work removes the quantum step in part, at a cost that sharpens the picture rather than
dissolving it. A first classical reduction reached \(\mathrm{GapSVP}_\gamma\) but only for an
exponentially large modulus, \(q \geq 2^{n/2}\). That barrier was later broken by a fully classical
reduction for a modulus polynomial in \(n\), the regime of practical parameters. Two costs survive.
The reduction is not known to reach \(\mathrm{SIVP}_\gamma\), only \(\mathrm{GapSVP}_\gamma\). And it
loses dimension. Breaking \(n\)-dimensional LWE classically yields a lattice algorithm only in
dimension \(\sqrt{n}\), so to underwrite a lattice problem of a given size, the classical route
demands an LWE instance quadratically larger than the quantum route does.
The first cost traces to a structural fact that the proof above has already exhibited. The quantum
reduction is iterative. Step two hands a narrower Gaussian back to step one, and the width
descends by a constant factor each round. The classical route rests on a reduction that makes a single
pass and so never produces the narrow Gaussian samples from which short independent vectors are read
off. No such one-shot argument is known to reach \(\mathrm{SIVP}_\gamma\), which the iterative one
handles. The second cost goes back to the same structural fact but enters at a different step. The
classical reduction first reaches LWE with an exponentially large modulus, and it brings the modulus
down to a polynomial one by enlarging the dimension, which is where the quadratic loss enters.
Whether the loss is inherent remains open. The question is whether \(n\)-dimensional LWE with
polynomial modulus is classically as hard as \(n\)-dimensional lattice problems, rather than merely
\(\sqrt{n}\)-dimensional ones. The strongest known evidence for LWE's hardness, in dimension and in
the problems it reaches, still passes through a quantum computation. On the defensive side, this is
the exact counterpart of the fact that the schemes built on factoring and the discrete logarithm
fell to one.
Math \(\leftrightarrow\) Quantum: The Transform That Builds Instead of Breaks
The classical assumptions
fell because the quantum Fourier transform detects the hidden abelian period inside factoring
and the discrete logarithm. No such period is known in lattice problems, so that particular
attack has no known grip. Yet the transform reappears here on the constructive side. It is the
engine of the sampling step that certifies LWE's worst-case hardness. The security of lattice
cryptography does not come from lattices being untouched by quantum computation. The honest
statement is narrower. No efficient quantum algorithm for the underlying lattice problems is
known, and the abelian structure that the transform exploits to break the number-theoretic
schemes is not known to be present. The same instrument that ends one cryptography helps certify
the foundation of its successor.
The Cryptosystem
The opening of this page promised that the injective, noisy shape of learning with errors would unlock
public-key encryption. Here is the scheme that redeems the promise. Its security reduces to
decision-LWE, and hence, through the quantum reduction of the previous section, to the worst-case
hardness of lattice problems against quantum algorithms.
Encrypting a Bit
The secret key is a random vector \(\mathbf{s} \in \mathbb{Z}_q^n\). The public key is a collection
of LWE samples \((\mathbf{a}_i, b_i)\) for that secret. They are noisy linear measurements,
published in the open. Because the samples are LWE-distributed, the hardness of decision-LWE is
exactly the assumption that they look like uniform random pairs and so reveal nothing about
\(\mathbf{s}\) to an efficient observer.
To encrypt a single bit, one adds together a random subset of the public samples, obtaining a fresh
pair \((\mathbf{a}, b)\) that is itself close to a valid LWE sample. The message bit is hidden in the
last coordinate. To send a zero, leave \(b\) as it is. To send a one, shift it by
\(\lfloor q/2 \rfloor\). The quantity \(b - \langle \mathbf{s}, \mathbf{a} \rangle \bmod q\), which is
the inner product of the ciphertext with \((-\mathbf{s}, 1)\), is close to \(0\) modulo \(q\) when the
ciphertext encodes zero and close to \(q/2\) when it encodes one.
Holding the secret \(\mathbf{s}\), the receiver computes the inner product that tests which case holds
and recovers the bit. Decryption succeeds as long as the error accumulated by summing the subset stays
below \(\lfloor q/2 \rfloor / 2\) in absolute value, half the gap between the two cases. On the rare
occasions it exceeds that threshold, decryption can fail. This is the practical face of the tension
named in the hardness section. Too little noise forfeits the worst-case guarantee, and too much
invites decryption failure. Controlling its probability is a central concern in choosing the
parameters of practical schemes.
Why It Is Secure
Semantic security follows from a single thought experiment. Imagine the public key were
malformed, replaced by genuinely uniform random pairs with no underlying secret at all. The
decision-LWE assumption says that no efficient adversary can tell a malformed key from a real one, so
the two are computationally indistinguishable.
Under a malformed key, however, encryption is lossy. Provided the public key holds somewhat
more than \((n+1)\log_2 q\) pairs, a ciphertext formed from uniform pairs is, up to negligible
statistical error, independent of the message bit. This is a fact about random subset sums, stated
here without proof. An adversary facing a malformed key therefore gains no information about the bit,
not because the bit is computationally hidden, but because it is statistically absent from the
ciphertext. Since the real key is indistinguishable from the malformed one, an efficient adversary can
do at most negligibly better against the real scheme. Any advantage in guessing the message would be
an advantage in solving decision-LWE, which is assumed hard.
Math \(\leftrightarrow\) CS: Worst-Case Security, Deployed
Two properties set this construction apart from the number-theoretic schemes it is built to
outlast. Its security rests on decision-LWE, an average-case problem that the quantum reduction
ties to the worst-case hardness of general lattice problems, namely
\(\mathrm{GapSVP}_\gamma\) and \(\mathrm{SIVP}_\gamma\), so no class of weak keys has to be
avoided. And the underlying problems carry no known hidden abelian periodicity for a quantum
computer to seize, so the scheme is conjectured to resist the attack that felled the
number-theoretic constructions. That is the same conjecture as before, that no efficient
algorithm, classical or quantum, solves these lattice problems, but it now sits under an
encryption scheme rather than a hash.
The word general in the first of those is doing work. Worst-case lattice security for
public-key encryption was achieved earlier, but only for a restricted class, and by a classical
reduction. That class consists of lattices promised to hold one vector far shorter than any other.
Against that earlier guarantee this one is incomparable rather than strictly stronger. It
reaches the general lattice, and the only reduction known to reach \(\mathrm{SIVP}_\gamma\) there
is the quantum one.
From the Textbook Scheme to a Deployed Standard
The scheme above is deliberately minimal, with a single bit per ciphertext and keys quadratic in the
dimension, and a long line of refinements separates it from what runs in practice. The efficiency
gap is closed largely by working over a ring. Replacing the vectors of \(\mathbb{Z}_q^n\)
with polynomials in a quotient ring endows the samples with algebraic structure that shrinks keys
and speeds arithmetic, at the price of a more specialized hardness assumption. The structured
variant that results is ring learning with errors, and
its intermediate generalization, module learning with errors, is the foundation of the
key-encapsulation mechanism standardized in 2024 as the primary post-quantum replacement for the
classical key exchanges.