Path: blob/main/frontier/11-homomorphic-encryption/break/exhaust-noise-budget.ipynb
483 views
Break: Exhausting the FHE Noise Budget
Module 11 | Breaking Weak Parameters
Chain enough homomorphic multiplications to push noise past the decryption threshold and watch ciphertexts decay into garbage.
Why This Matters
FHE ciphertexts carry noise that grows with every homomorphic operation. Addition grows noise linearly (), but multiplication grows it multiplicatively (). Once noise exceeds a threshold determined by the modulus , decryption produces garbage.
This means every FHE scheme has a noise budget: a maximum number of operations (especially multiplications) before the ciphertext becomes useless. Understanding noise budgets is essential for:
Choosing parameters (, , ) that support enough computation depth
Deciding when bootstrapping is needed
Understanding why FHE is so much slower than plaintext computation
In this notebook, we'll deliberately exhaust the noise budget and observe the transition from correct decryption to complete failure.
The Scenario
We use the toy symmetric LWE-like scheme from Notebook 11a. The scheme encrypts a message into the plaintext space (integers mod ) using a ciphertext space (integers mod ):
Secret key:
Encrypt : pick random , small noise ; output where
Decrypt : compute , then
The scaling factor separates the message from the noise. Decryption succeeds as long as the noise .
Step 1: Encrypt and Measure Initial Noise
Let's encrypt a value and measure the noise. The noise is the difference between the "ideal" ciphertext value and the actual value recovered during decryption. As long as , we can round correctly.
Step 2: Simulate Homomorphic Multiplication and Noise Growth
In a BFV/BGV-like scheme, multiplying two ciphertexts with noise and produces a result with noise roughly proportional to . We simulate this noise growth model:
For simplicity, we use the conservative bound: .
We'll chain multiplications: start with , then multiply by repeatedly, computing .
Step 3: Visualize the Noise Explosion
Let's plot the noise level versus the number of multiplications. The exponential growth is dramatic: a few multiplications are fine, but the noise quickly crosses the decryption threshold.
Step 4: Observe Decryption Failure
Let's actually perform a concrete multiplication chain in our toy scheme and watch the decrypted value go from correct to garbage. We'll simulate the noisy ciphertext values directly.
The Fix: Bootstrapping
Bootstrapping (Gentry, 2009) is the technique that rescues FHE from the noise budget wall. The idea:
You have a noisy ciphertext about to exceed the budget.
Encrypt the secret key under a fresh key .
Homomorphically evaluate the decryption circuit on using .
The result is with fresh, low noise.
This "refreshes" the ciphertext. The cost is enormous (evaluating decryption homomorphically is expensive), but it enables unlimited computation depth.
Without bootstrapping, we're stuck with leveled FHE: a fixed number of operations determined at parameter selection time.
Exercises
Exercise 1: Vary the Modulus
Change to (double the original) and re-run the noise simulation. How many more multiplications can you perform before failure?
Exercise 2 (Independent)
Modify the plaintext modulus . Try (binary messages) and . How does the multiplication depth change? Why?
Real BFV implementations use or larger. If the noise growth per multiplication is roughly a factor of , estimate the multiplicative depth for and .
Why can't we just make arbitrarily large to get unlimited depth without bootstrapping? What are the costs?
Summary
| Concept | Key Fact |
|---|---|
| Noise budget | Each ciphertext has a finite tolerance for noise before decryption fails |
| Addition | Noise grows linearly () --- cheap |
| Multiplication | Noise grows multiplicatively () --- expensive |
| Multiplicative depth | Number of sequential multiplications before noise overflow |
| Larger | More noise budget, but larger ciphertexts and slower operations |
| Bootstrapping | Refreshes noise to enable unlimited depth, at high per-operation cost |
| Leveled FHE | No bootstrapping; fixed depth chosen at parameter selection |
Noise management is THE central challenge of FHE. Every design decision --- modulus size, plaintext space, relinearization, modulus switching --- is ultimately about squeezing more computation out of a finite noise budget.