Noise Breaks Linear Algebra
August 25, 20266 min readbeginner
The chapter now leaves the plane and moves into modular arithmetic. The transition is abrupt, and it is worth saying in advance where it is going: we are about to build a problem…
The chapter now leaves the plane and moves into modular arithmetic. The transition is abrupt, and it is worth saying in advance where it is going: we are about to build a problem that looks like schoolbook simultaneous equations, and then break it with a single unit of noise.
Simultaneous equations modulo are easy
Suppose there is a secret vector with components, all of them in , and an attacker gets to see equations of the form
where each is a known vector and each is a known number.
The angled brackets are the inner product, sometimes called the dot product, and it means multiply componentwise and add:
Stack the equations into a matrix statement:
This is a system of linear equations, and solving it is a schoolbook exercise. If is invertible modulo , which is likely when is prime, then
and the attacker has the secret. One matrix inversion, done in time cubic in . For that is a few million operations, meaning milliseconds.
So this is no basis for a cryptosystem at all. Publishing and publishes .
02.Adding the noise
Now change one thing. Add a small error to each equation:
where each is a small integer, drawn from some distribution concentrated near zero. Small means genuinely small. In the example below, is one of , or .
The attacker now sees equations that are each almost right and none of which is exactly right.
The natural first reaction is that this cannot possibly matter much. The errors are tiny, the equations are nearly correct, so surely the solution comes out nearly correct, and rounding fixes it.
That reaction is wrong, and the reason is worth understanding properly.
03.Why a tiny error is not a tiny problem
Gaussian elimination, the standard method, works by multiplying equations by constants and adding them together. Modulo , those constants are elements of , and they are not small. Eliminating a variable might require multiplying an entire equation by , or by .
When you multiply an equation by , you multiply its error by too.
Do this a few dozen times, as elimination on a system requires, and the accumulated error is no longer small. It has been multiplied and summed until it wraps around the modulus repeatedly. At that point the error is indistinguishable from a uniformly random element of , and the equation it is attached to carries no information at all.
There is a second way to see it. Modular arithmetic has no notion of "close". In Modular Arithmetic the residues are a clock face, and is adjacent to modulo just as much as is. There is no ordering to be nearly right about. So "the answer came out slightly off" is not a recoverable situation the way it would be with real numbers. Slightly off in means somewhere else entirely.
04.The demonstration
Assertions are cheap. Here is the arithmetic.
Take , , and the secret
Take three known vectors and stack them:
Compute the three exact inner products.
since .
since exactly.
Without noise. The attacker sees . Inverting modulo and multiplying gives
which is , exactly. The secret is recovered in one step, as promised.
With noise. Now add errors , each of them as small as a non-zero error can be. The attacker sees
noting that .
Run the identical computation on :
Compare that with the true secret .
Not one component is right. The first is off by , the second by , the third by . The answer is not a slightly perturbed version of the secret that could be cleaned up by rounding. It is an unrelated point in , and there are only of those, so a wrong answer here is worth about as much as a guess.
That is the entire idea of Learning With Errors, visible in a system. Three errors of magnitude at most one destroyed the solution completely.
05.What the attacker is left with
If elimination is useless, what can an attacker actually do?
They can search. Somewhere out there is a vector and a small error vector satisfying , and the error is small. So the attacker is looking for a point that is unusually close to the observed .
That is the closest vector problem from Short Vectors: SVP and CVP, on a lattice built out of . The next note makes the connection precise.
And this is why the chapter spent five notes on geometry before touching cryptography. The noise did not merely make the equations harder to solve. It converted a linear algebra problem, which is easy, into a lattice problem, which is not.