Chapter 4 · Lectures 10 to 13

Post-Quantum Cryptography

Shor's algorithm solves factoring and discrete logarithms in polynomial time on a quantum machine, so public-key cryptography needs new hard problems. This chapter begins with the Small Integer Solution (SIS) and Learning with Errors (LWE) assumptions, then uses trapdoors and Gaussian sampling to build lattice schemes. It covers the NIST (US National Institute of Standards and Technology) standards Module-Lattice Digital Signature Algorithm (ML-DSA) and Module-Lattice Key Encapsulation Mechanism (ML-KEM), plus Falcon, which NIST selected for the forthcoming FN-DSA standard. The final sections apply lattices to fully homomorphic, identity-based and attribute-based encryption.

107 slides 4 stages 3 labs 7 exercises Source: 04_Crypto_101_PQC.pdf
How this chapter maps onto the lectures

Lecture 10 (23/10/25) is sections 1 to 6: the quantum threat, lattices, SIS and LWE, LWE over rings and modules, the basic lattice primitives and lattice trapdoors. Lecture 11 (28/10/25) is sections 7 to 10: Falcon, canonical identification and Crystals-Dilithium, Regev encryption and the Fujisaki-Okamoto transform with Crystals-Kyber. Lecture 12 (30/10/25) is section 11, fully-homomorphic encryption. Lecture 13 (04/11/25) is split: its first half, Identity-Based Encryption (IBE) and Attribute-Based Encryption (ABE) from lattices, is section 12 below. Its second half opens differential privacy, which belongs to Chapter 5. Study plans: Lecture 10, Lecture 11, Lecture 12.

Section 1The Quantum Threat, and Why the Migration Starts Now

Lecture 10.

Every public-key scheme in Chapters 2 and 3 rests on one asymmetry: multiplying two large primes is fast, while recovering the primes from their product is beyond every known classical polynomial-time algorithm, the best known method running in subexponential time. The discrete logarithm and its bilinear variants have the same shape. Provable security is conditional on the asymmetry holding: each scheme reduces breaking it to inverting one of these problems, so the reduction is only as good as the hardness of the problem.

In 1994 Shor broke the asymmetry for quantum machines. His algorithm solves both factoring and the discrete logarithm in polynomial time on a quantum Turing machine. The period-finding core exploits superposition to extract the period of $x \mapsto a^{x} \bmod N$ from exponentially many values at once. The period yields a factor of $N$ or a logarithm base $g$. The relevant threshold is a cryptographically relevant quantum computer, one with enough logical qubits and gate fidelity to run such circuits. Factoring a $1024$-bit integer is estimated at roughly $2050$ logical qubits and a circuit of billions of quantum gates, and present devices have factored only tiny numbers such as $15$ and $21$. No cryptographer expects a break this year.

Common mistake. "Quantum computers can already break RSA-2048." Shor's algorithm needs millions of physical qubits: Gidney and Ekerå estimated in 2019 that factoring RSA-2048 in eight hours takes about 20 million noisy qubits. Current machines hold roughly a thousand.

The migration still cannot wait for the machines, and harvest-now-decrypt-later is the reason. An adversary can record today's ciphertexts and decrypt them years later, when the quantum machine exists, so any traffic that must stay secret for a decade is already exposed. Signatures raise the same problem from the other side: once RSA or ECDSA keys are broken, signatures made under them today can be forged retroactively, which invalidates long-lived certificates and archived contracts. Migration time adds urgency. Replacing cryptographic primitives across protocols, libraries, hardware and standards takes ten to twenty years, as the TLS 1.3 rollout shows, so starting after the threat materializes is starting too late.

Symmetric cryptography survives with longer keys. Grover's algorithm searches an unstructured key space quadratically faster, which halves the security level, and doubling the key length restores it. An AES-256 key keeps $128$ bits of security against a quantum attacker. Public-key cryptography has no such fix, because Shor's speedup is exponential. The assumptions of Chapters 2 and 3 must be abandoned.

Common mistake. "Grover's algorithm destroys symmetric cryptography." The speedup is only quadratic: a $128$-bit key drops from about $2^{128}$ classical trials to about $2^{64}$ sequential quantum operations, which stays infeasible. Doubling to AES-256 restores the margin.

Post-quantum cryptography is one of two responses to the threat. The two are often confused. PQC replaces the hard problem. It keeps classical algorithms on ordinary hardware and rests their security on problems no known quantum algorithm speeds up. Quantum key distribution distributes keys over quantum channels, using physics in place of computation. QKD needs dedicated hardware on every link and does not by itself authenticate the endpoints or replace signatures, so this chapter is about PQC alone.

Standardization history

The US National Institute of Standards and Technology (NIST) opened a process in 2017 to solicit, evaluate and standardize quantum-resistant algorithms, and announced the selected designs in 2022. Most are based on lattices: Crystals-Kyber for key encapsulation, Crystals-Dilithium and Falcon for signatures. The hash-based Stateless Hash-Based Digital Signature Algorithm (SLH-DSA) was also selected. ML-KEM and ML-DSA were published in 2024 as FIPS 203 and FIPS 204. SLH-DSA was published separately as FIPS 205 and is hash-based. The process doubles as a cryptanalysis lesson. In 2022 the isogeny scheme Supersingular Isogeny Diffie-Hellman (SIDH) and its encapsulation variant Supersingular Isogeny Key Encapsulation (SIKE), a live candidate family in the competition, fell to a classical attack, so the standards carry the standing assumption that no comparable break awaits the lattice problems.

What went wrong. The multivariate signature scheme Rainbow fell in 2022, when Beullens's MinRank attack broke the submitted parameters on a laptop over a weekend. Parameters that ignore a known attack family can collapse without warning.

The migration has a concrete cost in bytes. Lattice keys, ciphertexts and signatures run one to two orders of magnitude larger than the elliptic-curve primitives they replace, and the code-based McEliece scheme, one of the longest-standing candidates, carries a public key near $1$ MB.

Worked number. ML-KEM-768 uses a $1184$-byte encapsulation key and $1088$-byte ciphertexts, against $32$ bytes for an X25519 elliptic-curve key and $256$ bytes for RSA-2048. A handshake that once carried tens of bytes of key material now carries kilobytes.

SchemePublic keySignature or ciphertext
256-bit elliptic curve32 bytes65 bytes (signature)
ML-DSA, smallest parameter setabout 1312 bytesabout 2420 bytes (signature)
ML-KEM-512800 bytes768 bytes (ciphertext)
Code-Based (McEliece)near 1 MBnot given here
Takeaway

Shor's algorithm breaks factoring and discrete logarithms in polynomial time on a quantum machine, so every scheme built on them has a shelf life. Ciphertexts harvested now can be decrypted later, deployment takes ten to twenty years, and symmetric cryptography needs only longer keys while public-key cryptography needs new assumptions.

Section 2Lattices, Bases and the Geometry That Matters

Lecture 10.

The replacement assumptions are lattice problems, so the first task is geometric. A lattice is the simplest infinite set that still has enough structure to do algebra on: points in $\R^{n}$ arranged periodically.

Definition: lattice, basis

Take $n$ linearly independent vectors $b_1, \dots, b_n \in \R^{n}$. The lattice they generate is the set of all integer combinations

$$\Lambda = \mathcal{L}(B) = \Big\{ \sum_{i=1}^{n} a_i b_i : a_i \in \Z \Big\},$$

and $(b_1, \dots, b_n)$ is a basis, written as the matrix $B$ whose columns are the $b_i$. Equivalently, a lattice is a discrete additive subgroup of $\R^{n}$. Lattice geometry has been studied since Gauss (1801), Hermite (1850) and Minkowski (1896), long before cryptography arrived.

The same lattice has many bases. Permuting the vectors, negating one or adding an integer multiple of one vector to another all preserve the generated set. Every basis change of this kind is captured by one statement.

Theorem: equivalent bases

Two bases $B_1, B_2$ generate the same lattice if and only if $B_2 = B_1 U$ for a unimodular matrix $U$, meaning $U$ has integer entries and $\det U = \pm 1$.

This freedom in the description is the source of both the algorithms and the hardness. Even when every basis vector is long, the lattice may contain short vectors. A bad basis hides them. The animation below makes this visible in two dimensions. Deployed schemes run in dimensions too high to draw, so treat every picture in this section as intuition.

Definition: fundamental region, determinant

The fundamental parallelepiped of a basis is $\mathcal{P}(B) = B \cdot [0,1)^{n} = \{\sum_i c_i b_i : c_i \in [0,1)\}$. It is a fundamental region: the translates $\mathcal{P}(B) + v$ over $v \in \Lambda$ tile $\R^{n}$ without overlap, so every point $x$ has a unique representative $x \bmod \mathcal{P}(B)$, and $x \in \Lambda$ exactly when that representative is $0$. The determinant is $\det \Lambda = \abs{\det B}$, the volume of $\mathcal{P}(B)$. It is well defined because $\abs{\det(BU)} = \abs{\det B}$ for unimodular $U$. It is the reciprocal of the point density, so a large determinant means a sparse lattice.

Definition: successive minima

$\lambda_1(\Lambda)$ is the length of the shortest non-zero lattice vector, in the Euclidean norm. The minimum is never unique, since $v \in \Lambda$ implies $-v \in \Lambda$. More generally $\lambda_k(\Lambda)$ is the smallest radius of a ball containing $k$ linearly independent lattice vectors; for $k = n$ the ball contains a basis of the whole space.

Theorem: Minkowski

Blichfeldt's lemma. For any lattice $\Lambda$ and any set $\mathcal{S}$ with $\mathrm{vol}(\mathcal{S}) > \det \Lambda$, there exist distinct $z_1, z_2 \in \mathcal{S}$ with $z_1 - z_2 \in \Lambda$; the proof is a pure volume argument. Minkowski's theorem. If $\mathcal{S}$ is additionally convex and symmetric about the origin and $\mathrm{vol}(\mathcal{S}) > 2^{n} \det \Lambda$, then $\mathcal{S}$ contains a non-zero lattice point: apply the lemma to $\mathcal{S}/2$ and average. The standard corollary bounds the shortest vector:

$$\lambda_1(\Lambda) \le \sqrt{n} \cdot \det(\Lambda)^{1/n}.$$

So every lattice is guaranteed to contain a fairly short vector. The difficulty is locating it.

Takeaway

A lattice is the set of integer combinations of a basis. The same lattice admits many bases, related by unimodular transforms. The determinant measures density. Minkowski's theorem guarantees short vectors exist. The hardness of finding them is the cryptographic resource.

Section 3Small Integer Solution (SIS) and Learning with Errors (LWE), the Average-Case Hard Problems

Lecture 10.

Cryptography needs problems that are hard on the instances it actually generates. Lattice theory supplies them in two layers: worst-case geometric problems, which are conjecturally hard but inconvenient to sample, and average-case algebraic problems, SIS and LWE, whose random instances are provably as hard as the worst case.

The worst-case layer, first. For an approximation factor $\gamma \ge 1$:

Solving $\mathsf{CVP}$ solves $\mathsf{SVP}$. Exact algorithms cost $2^{\Theta(n)}$ time, polynomial algorithms exist only for very large $\gamma$ and NP-hardness is known only for small approximation factors. For the polynomial factors cryptography uses, $\gamma = \Omega(n)$, the problems are believed hard without being NP-hard. No better quantum algorithm is known, which is the property section 1 needs.

Common mistake. "Learning with errors is proven NP-hard." The schemes rest on average-case hardness tied by reductions to worst-case lattice problems. No NP-hardness proof is known. The gap problems in the used regime lie in NP intersect coNP, which makes NP-hardness unlikely.

Definition: Small Integer Solution (SIS)

Fix a dimension $n$, a modulus $q$ (typically $q \approx n^{2}$ or larger) and a width $m$. Given random vectors $a_1, \dots, a_m \in \Zq^{n}$, find a non-zero short $z_1, \dots, z_m \in \Z$ with

$$z_1 a_1 + z_2 a_2 + \cdots + z_m a_m = 0 \quad \text{in } \Zq^{n},$$

equivalently a short non-zero $z \in \Z^{m}$ with $A z = 0 \bmod q$ for $A = (a_1, \dots, a_m)$. Without the shortness restriction the problem is trivial by Gaussian elimination; the restriction is the problem.

SIS is a lattice problem in disguise: the solutions form the $q$-ary lattice $\Lambda^{\perp}(A) = \{z \in \Z^{m} : A^{\top} z = 0 \bmod q\}$. The task is to find a short vector in it. Ajtai's theorem is the bridge from average case to worst case.

Theorem: Ajtai (1996)

For suitable polynomial approximation factors $\gamma$, $\mathsf{GapSVP}_{\gamma}$ and $\mathsf{SIVP}_{\gamma}$ on arbitrary $n$-dimensional lattices reduce to $\mathsf{SIS}$ on random matrices $A$. The same holds for the inhomogeneous variant, finding short $z$ with $A^{\top} z = u \bmod q$ for a given $u$, which is SIS on a lattice coset $u + \Lambda^{\perp}(A)$.

LWE is a system of linear equations with noise added to every row. The noise is the whole difficulty.

Worked number. Take modulus $q = 13$ and secret $s = 4$. For $a = 7$ the sender computes $7 \cdot 4 = 28 = 2 \bmod 13$, adds error $e = 1$ and publishes $(7, 3)$. With errors in $\{-1, 0, 1\}$ several secrets fit, so the attacker cannot single out $s$.

Definition: Learning with Errors (LWE)

Fix $n$, a prime modulus $2 < q = \poly(n)$ and a noise distribution $\chi$ over $\Z$, typically a discrete Gaussian with standard deviation at least $\sqrt{n}$ and far below $q$, summarized by a rate $\alpha \ll 1$ with $\alpha q > \sqrt{n}$. Draw $A \getsr \Zq^{n \times m}$, $s \getsr \Zq^{n}$, $e \gets \chi^{m}$ and set $b = A^{\top} s + e \bmod q$. The search problem recovers $s$ from $(A, b)$; the decisional problem distinguishes $(A, b)$ from $(A, u)$ with $u \getsr \Zq^{m}$. For prime polynomial modulus and suitable error distributions, decision LWE can be used to solve search LWE in polynomial time. A search solver also distinguishes LWE samples by recovering $s$ and checking the residual distribution.

LWE is BDD in disguise: the samples live near the lattice $\Lambda(A) = \{z \in \Z^{m} : z \equiv s^{\top} A \bmod q \text{ for some } s\}$, and recovering $s$ means finding the lattice point close to $b$.

Theorem: Regev (2005), Peikert (2010)

$\mathsf{GapSVP}_{\gamma}$ and $\mathsf{SIVP}_{\gamma}$ for polynomial $\gamma$ reduce to $\mathsf{LWE}$. Regev's reduction is quantum; Peikert's is classical for restricted parameter ranges such as $q \approx 2^{n}$. Parameters trade off: smaller $\alpha$, larger $m$ and larger $q$ each make the assumption stronger, and $\Pr[\abs{e_i} > \alpha q : e_i \gets \chi] \le \negl(n)$ keeps errors in range.

The attacker in both problems is any polynomial-time algorithm, classical or quantum. The reductions above make success on random instances imply success on worst-case geometry. No quantum algorithm improves on the best classical attacks there.

Common mistake. "Shor's algorithm also cracks lattice schemes." Shor extracts the period of a repeating pattern, the structure hidden inside factoring and discrete logarithms. Lattice problems show no such periodic structure, so the algorithm gives no speedup.

Several elementary properties of LWE are used constantly later.

SIS and LWE are related. SIS has many solutions while LWE has one, an SIS oracle solves LWE by returning $z$ with $A^{\top} z = 0$ and testing whether $\langle b, z \rangle = \langle e, z \rangle$ is small. The converse direction is known only under quantum reductions.

Lab

LWE Samples and the Noise That Hides the Secret

Generate samples $b_i = \langle s, a_i \rangle + e_i \bmod q$, then run a census of every candidate secret in $\Zq^{n}$ and count how many fit the residuals. Switch the noise off to watch Gaussian elimination recover $s$ outright.

·samples m
·consistent secrets
·verdict
Takeaway

SIS asks for a short relation modulo $q$ and LWE asks for a secret hidden in noisy linear equations. Ajtai, Regev and Peikert tie their random instances to the worst-case geometric problems. The noise is the difficulty itself. Remove it and both problems collapse to linear algebra.

Section 4Learning with Errors (LWE) over Rings and Modules, and Why Lattices Win

Lecture 10.

Plain LWE has a cost problem. Producing one pseudorandom scalar $b_i = \langle s, a_i \rangle + e_i \bmod q$ takes an $n$-dimensional inner product, so each output element costs $O(n)$ field operations, public keys carry the whole matrix $A$ and encrypting an $n$-bit message costs $\Omega(n^{2})$ time. The columns of $A$ can be amortized over many secrets, yet the per-scalar cost remains. The question is whether one cheap algebraic product can yield many pseudorandom scalars at once.

The answer is to replace the scalar ring $\Zq$ with a polynomial ring. Let $R = \Z[X]/(X^{d} + 1)$ for $d$ a power of two and $R_q = R / qR$, whose elements are polynomials of degree below $d$ with coefficients modulo $q$. Define the product $\star$ as multiplication in $R_q$. One product $s \star a + e = b$ then expands into $d$ related scalar equations on a secret of dimension $n = d \cdot k$. The multiplication itself runs in $O(d \log d)$ operations by FFT-style algorithms. The coefficient-wise product would be insecure for small errors, so the ring structure is essential.

Definition: LWE, Ring-LWE, Module-LWE

All three share the shape: find the secret vector $\mathbf{s}$ given samples $s \star a_i + e_i = b_i$, or distinguish the samples from uniform. They differ in the dimensions. LWE: $d = 1$, $k = n$, no structure. Ring-LWE: $d = n$, $k = 1$, one polynomial secret, each sample worth $n$ coupled equations. Module-LWE: intermediate, $k$ polynomial secrets of degree $d$, so $n = d \cdot k$. Module-LWE sits between unstructured LWE and Ring-LWE, with $k$ as a knob that trades security against key size. That middle position is why ML-KEM and ML-DSA both use modules.

Theorem: Lyubashevsky, Peikert, Regev (2010)

For $R$ the ring of integers of a number field, worst-case $R$-$\mathsf{GapSVP}$ reduces to search Ring-LWE, which decision Ring-LWE reduces to. The reduction is quantum in general. A classical reduction exists for related parameter ranges, with a caveat: for the relevant approximation factors, GapSVP on ideals (the $k = 1$ case) is comparatively easy, so the classical guarantee is weakest in the parameter range where the schemes are fastest. For polynomial approximation, no significant speedup is known for ideal or module lattices over general ones; for subexponential approximation, better quantum algorithms exist for ideals but none for $k > 1$, which is one more argument for module parameters.

The case for lattices as the post-quantum foundation rests on four properties: provable security, worst-case security, quantum resistance and efficiency.

What went wrong. Fluhrer's 2016 key-reuse attack on a Ring-LWE key exchange recovered the secret when one ephemeral key served several sessions. Protocols must enforce fresh keys.

Takeaway

Moving LWE from $\Zq$ to $\Zq[X]/(X^{d}+1)$ turns one inner product into $d$ coupled equations computable by FFT. Module-LWE keeps a dimension knob for tuning. The same worst-case guarantees survive the move. The efficiency gain is what put lattice schemes into the NIST portfolio.

Section 5One-Way Functions, Hashing and Commitments from Small Integer Solution (SIS)

Lecture 10.

SIS alone yields the two most basic primitives in cryptography, a one-way function and a collision-resistant hash, plus commitments. The proofs introduce the leftover hash lemma that the rest of the chapter keeps reusing.

Construction: Ajtai's one-way function

Goal. A one-way function on a random public matrix. Parameters $m, n, q$ with $m > n \log q$, and key $A \in \Zq^{n \times m}$. The function is $f_A(x) = A x \bmod q$ on inputs $x \in \{0,1\}^{m}$.

Theorem: Ajtai (1996)

If $\mathsf{SIVP}$ is hard to approximate in the worst case, then $f_A$ is one-way for random $A$. Inverting it means finding, given $A$ and $y$, a short $x$ with $A^{\top} x = y$. Any solution at all is easy to find; the set of all solutions is the coset $t + \Lambda^{\perp}(A)$ for any particular solution $t$. The task is to find the short member of that coset, an average-case closest-vector problem on $\Lambda^{\perp}(A)$.

Construction: SIS compression hash

Goal. Collision-resistant compression from SIS. With $A = (a_1, \dots, a_m)$, define $h_A : \{0,1\}^{m} \to \Zq^{n}$ by $h_A(z_1, \dots, z_m) = a_1 z_1 + \cdots + a_m z_m \bmod q$. With $m > n \log q$ the domain outruns the image, so the function compresses. A collision $h_A(z) = h_A(z')$ yields $a_1 (z_1 - z_1') + \cdots + a_m (z_m - z_m') = 0$ with every difference in $\{-1, 0, 1\}$, a non-zero short SIS solution. Collisions exist in abundance, since the map compresses; finding one is as hard as SIS.

Construction: SIS commitment

Goal. A commitment that hides statistically and binds computationally. Take two random SIS matrices $A_1, A_2$. Commit to a message $x \in \{0,1\}^{n}$ with randomness $r \in \{0,1\}^{m}$ as $\mathsf{Com}(x; r) = A_1^{\top} x + A_2^{\top} r \bmod q$, opening by revealing $(x, r)$. Hiding is statistical: $A_2^{\top} r$ is close to uniform by the leftover hash lemma below, so it masks $A_1^{\top} x$ information-theoretically. Binding is computational: opening to two different messages is exactly a collision of the combined function $f_{A_1, A_2}$.

Theorem: leftover hash lemma

Let $H$ be a family of universal hash functions from domain $D$ to image $I$. For $x \getsr D$, $h \getsr H$, $u \getsr I$, the statistical distance satisfies $\mathsf{SD}\big((h, h(x)),\, (h, u)\big) \le \tfrac{1}{2}\sqrt{\abs{I}/\abs{D}}$. The family $h_A(r) = A r \bmod q$ is universal, because for $r_1 \neq r_2$ the difference $A(r_1 - r_2)$ is uniform over $\Zq^{n}$, so the collision probability is $q^{-n}$. Taking $r \getsr \{0,1\}^{m}$ and $m \ge n \log q + 2n$ gives $\mathsf{SD}\big((A, A^{\top} r), (A, u)\big) \le 2^{-n}$, so a binary vector of that length, multiplied by a random matrix, is statistically indistinguishable from uniform.

The lemma recurs throughout the chapter's security proofs. Regev encryption in section 9 hides its message because the ciphertext preamble $Ar$ is statistically uniform, and GSW in section 11 hides its plaintext by the same argument over the columns of its randomness matrix.

Takeaway

One random matrix $A$ gives a one-way function, a collision-resistant hash and a statistically hiding commitment, all with security reducible to SIS. The leftover hash lemma is the recurring step: a short random vector times a random matrix is statistically uniform, provided the vector is long enough.

Section 6Lattice Trapdoors and Gaussian Sampling

Lecture 10.

One-way functions alone do not provide encryption or signatures. Lattice schemes add a geometric trapdoor, together with a sampling method that conceals it.

Recall the two faces of the Small Integer Solution (SIS) and Learning with Errors (LWE) function family. The surjective face is $f_A(x) = A^{\top} x \bmod q$ for short $x$, many preimages per output. The injective face is $f_A(s, e) = s^{\top} A + e \bmod q$ for small $e$, one preimage per output. Inverting means, in the first case, sampling a random preimage $x \getsr f_A^{-1}(u)$ with probability proportional to the Gaussian weight $\exp(-\abs{x}^{2}/s^{2})$, and in the second, recovering the unique small pair $(s, e)$. Both tasks are easy given the right auxiliary information: a short basis of $\Lambda^{\perp}(A)$. The lab below shows why. With a short, nearly orthogonal basis, Babai's nearest-plane algorithm rounds coordinate by coordinate and lands on (or very near) the closest lattice point; with a long skewed basis of the same lattice the same rounding misses. The quality parameter of a Gaussian sampler is the length of the basis it works with. The line of work from Babai (1986) through Klein, Gentry-Peikert-Vaikuntanathan and others is a history of tightening that trade-off.

Generating a random $A$ together with a short basis for $\Lambda^{\perp}(A)$ is possible but slow. The older inversion algorithms trade sampling quality against running time. Micciancio and Peikert (2012) replaced the basis with a different kind of trapdoor that is simpler, faster and just as powerful.

Construction: the gadget matrix

Goal. A lattice function that is easy to invert by design. For $q = 2^{k}$ let $g = (1, 2, 4, \dots, 2^{k-1}) \in \Z^{k}$ and $G = I_n \otimes g \in \Zq^{n \times nk}$. The function $f_G$ inverts easily: from $f_g(s, e) = s \cdot g + e = (s + e_0,\; 2s + e_1,\; \dots,\; 2^{k-1} s + e_{k-1})$ the top entry gives the low bit of $s$ whenever $\abs{e_i} < q/4$, then the next bit and so on. Sampling a Gaussian preimage of $u$ is equally direct, bit by bit. The lattice $\Lambda^{\perp}(g)$ has an explicit basis $S$ with $\abs{S} = 2$, and since $G$ is a tensor product, all of this runs as $n$ parallel cheap calls. The gadget matrix is a publicly known lattice with a trivially short basis.

Construction: the MP12 trapdoor

Goal. A trapdoor for a matrix that is statistically close to uniform. Randomize the gadget. Draw a uniform $\bar{A} \in \Zq^{n \times \bar{m}}$ and a short Gaussian matrix $R \in \Z^{\bar{m} \times nk}$, and set

$$A = [\,\bar{A} \;\|\; G - \bar{A} R\,].$$

Then $A \binom{R}{I} = G$, and $R$ is called a trapdoor for $A$ with tag $I$; more generally $R$ is a trapdoor with tag $H$ when $A \binom{R}{I} = H G$. The matrix $A$ is statistically close to uniform by the leftover hash lemma, so the construction hides its own structure. Inversion reduces to the gadget: given LWE samples $b = s^{\top} A + e$, multiply by $\binom{R}{I}$ to get $s^{\top} G$ plus small error, and invert bit by bit; given a SIS target $u$, sample $z \getsr f_G^{-1}(u)$ and output $x = \binom{R}{I} z$, which satisfies $A x = G z = u$. The quality of $R$ is $s_1(R) = \max_{\abs{u} = 1} \abs{R^{\top} u}$, about $(\text{rows} + \text{cols}) \cdot r$ for Gaussian entries of standard deviation $r$.

One subtlety remains. Sampling preimages as $x = \binom{R}{I} z$ leaks the covariance $\Sigma = \mathbb{E}[x x^{\top}] \approx R R^{\top}$, which reveals information about the trapdoor. The fix is the perturbation method of Peikert (2010): first draw a perturbation $p$ with covariance $s^{2} I - R R^{\top}$ (positive exactly when the target Gaussian width $s$ exceeds the trapdoor quality), then sample a spherical $z$ with $G^{\top} z = u - A^{\top} p$, then output $x = p + \binom{R}{I} z$. The sum has the target spherical covariance. The equation $A^{\top} x = u$ still holds while the output distribution is independent of $R$. This is the sampler Falcon and the identification schemes of section 8 build on.

Lab

Closest Vector with a Good Basis and a Bad Basis

The same lattice, two bases related by a unimodular transform. Babai's nearest-plane algorithm runs on whichever basis is selected. The exact closest point is computed by enumeration for comparison. Try the target $(4, 5)$ on both bases.

·dist² found
·dist² true
·nearest-plane
Takeaway

A trapdoor for a lattice function is a short basis or its MP12 equivalent, a short matrix $R$ with $A \binom{R}{I} = HG$ that reduces inversion to the public gadget. Basis quality decides whether closest-point computations succeed, and Gaussian sampling with the perturbation method keeps the outputs from leaking the trapdoor itself.

Section 7Falcon: Signatures from Small Integer Solution (SIS)

Lecture 11.

A signature scheme needs a one-way function that only the signer can invert. Section 6 supplied one: a surjective SIS function with a trapdoor. Falcon applies that construction directly.

Construction: Falcon-style SIS signature

Goal. Digital signatures from a trapdoored SIS function. Key generation. Produce a uniform public matrix $A$ together with a trapdoor $T$ for it; the verification key is $\mathit{vk} = A$ and the signing key is $\mathit{sk} = T$. Signing. To sign a message $\mu$, hash it to a target $u = \Hash(\mu) \in \Zq^{n}$ with a public hash function, and use $T$ to sample a short $\sigma = x \in \Z^{m}$ with $A x = u$, drawn from the Gaussian distribution over preimages. Verification. Check that $A^{\top} \sigma = \Hash(\mu)$ and that $\sigma$ is sufficiently short.

The security argument is short because the machinery of sections 3 and 6 does the work. Forging a signature on a fresh message $\mu^{*}$ requires producing a short $x^{*}$ with $A^{\top} x^{*} = \Hash(\mu^{*})$, which is the inhomogeneous SIS problem, hard by Ajtai's theorem. Signing queries do not help the forger, classical or quantum, because the Gaussian sampler reveals nothing about the trapdoor: the distribution of each signature depends on $A$ and $\Hash(\mu)$ alone. The perturbation method of section 6 is what makes that statement true. A sampler that leaked the covariance of $T$ would hand the forger a growing set of linear measurements of the secret basis, and several early lattice signature schemes failed after their samplers leaked in this way.

Falcon itself instantiates this blueprint over NTRU lattices, the ring-structured lattices of Hoffstein, Pipher and Silverman, where keys and signatures are polynomials in $\Z[X]/(X^{d}+1)$ and polynomial arithmetic replaces vector arithmetic. The ring structure makes Falcon's signatures the most compact in the NIST portfolio, at the cost of a delicate implementation: the sampler is a fast Fourier orthogonalization over floating-point trees, and side-channel resistance requires care. NIST selected Falcon in 2022 alongside Crystals-Dilithium; the two are the lattice signature standards, with Falcon favored where bandwidth is scarce and Crystals-Dilithium where implementation simplicity is.

What went wrong. Coppersmith and Shamir used lattice reduction against early NTRU in 1997. Reduction algorithms keep improving, so parameter sets need generous safety margins.

Hash first, then sample

The hash-to-point step is structural. Signing a raw structured target would let an attacker choose targets with easy preimages; hashing $\mu$ to a uniformly distributed $u$ forces the forger to solve SIS on a point it cannot influence. The same pattern reappears in section 8, where the Fiat-Shamir hash plays the role.

Takeaway

Falcon signs by sampling a short SIS preimage of $\Hash(\mu)$ with the trapdoor, and verification re-checks the SIS equation plus shortness. Forgery is inhomogeneous SIS, and signing queries stay harmless because the Gaussian sampler reveals nothing about the trapdoor.

Section 8Canonical Identification and Crystals-Dilithium

Lecture 11.

The second route to signatures goes through identification. A canonical identification scheme is a three-move protocol: the prover sends a commitment $\alpha$, the verifier replies with a random challenge $\beta$ and the prover answers with $\gamma$. Two properties matter. Completeness: an honest prover convinces an honest verifier with overwhelming probability. Passive security: no efficient prover knowing only $\mathit{pk}$ can convince the verifier, even after seeing many honest transcripts.

MoveDirectionContent
1prover to verifiercommitment $\alpha$
2verifier to proverrandom challenge $\beta$
3prover to verifieranswer $\gamma$
Construction: the Fiat-Shamir transform

Goal. A signature from any passively secure identification scheme. Replace the verifier by a hash. The signature on a message $x$ is $\sigma = (\alpha, \gamma)$ where the signer computes $\beta = \Hash(x, \alpha)$ and runs the prover; the verifier checks that $(\alpha, \beta, \gamma)$ is an accepting transcript with $\beta = \Hash(x, \alpha)$.

Theorem: Fiat and Shamir (1986)

If the identification scheme is passively secure, the derived signature scheme is unforgeable under a chosen-message attack, in the random oracle model, where $\Hash$ is treated as an ideal hash. Whether such a proof certifies a real hash function is a standing debate; plain-model proofs exist only for special classes of schemes, via correlation intractability.

Two sufficient criteria make passive security checkable. Special soundness: from any two accepting transcripts $(\alpha, \beta, \gamma)$ and $(\alpha, \beta', \gamma')$ with $\beta \neq \beta'$, one can extract the secret key in polynomial time. This implies the protocol is a proof of knowledge: rewind a successful prover after $\alpha$, feed it a second challenge $\beta'$ and apply the extractor. Honest-verifier zero-knowledge (HVZK): honest transcripts can be simulated from $\mathit{pk}$ alone, so whatever the verifier learns, it could have computed by talking to itself.

The template is the discrete-log scheme (Schnorr): with $\mathit{pk} = x = g^{w}$, send $\alpha = g^{a}$ for fresh $a$, answer $\gamma = \beta w + a$ and verify $g^{\gamma} = x^{\beta} \alpha$. Special soundness extracts $w = (\gamma - \gamma')(\beta - \beta')^{-1}$; the simulator picks $\beta, \gamma$ first and sets $\alpha = g^{\gamma} / x^{\beta}$. Copying the shape onto lattices, with $\mathit{pk} = (A, t = As)$, gives $\alpha = Au$, $\gamma = \beta s + u$ and the check $A^{\top} \gamma = \beta t + \alpha$. The extraction is identical: $s = (\gamma - \gamma')(\beta - \beta')^{-1}$. The problems are all lattice-specific.

Three failures of the naive lattice protocol

Small challenge space. Lattice moduli are small ($q \approx 2^{32}$ for signatures), so a prover that guesses $\beta$ succeeds with non-negligible probability. The fix is repetition: $k$ parallel instances, with $k = 128$ or $256$. The extracted secret is not small. Special soundness produces some $s$ solving $As = t$. Nothing bounds its norm, so an unbounded solution makes the underlying problem trivial. The fix is to draw $u$ small and check that each $\gamma_j$ has small coefficients, so the extracted difference stays small. No HVZK. With $s, u \in \{0,1\}^{n}$ and $\beta = 1$, the answer $\gamma = s + u$ has coefficients in $\{0, 1, 2\}$. The extremes leak: a coefficient $0$ forces $s_i = 0$, a coefficient $2$ forces $s_i = 1$. Only the middle value hides.

The repair is rejection sampling. Widen the mask: draw $u$ with coefficients in $\{0, \dots, b - 1\}$ for $b$ much larger than the coefficient range of $s$. Then $\gamma_i = s_i + u_i$ leaks only at the two extremes, $0$ and $b$. Every middle value occurs with probability exactly $1/b$ regardless of $s_i$. The prover therefore sends $\gamma$ only when every coefficient falls in the safe middle range, and aborts otherwise. The probability a coefficient survives is $1 - 1/b$, and with $b = mk$ tuned to the total number of coefficients, an execution completes with probability about $1/e$, a constant expected number of restarts. A final refinement commits to the whole first round: the verifier receives $\alpha = \Hash(\alpha_1, \dots, \alpha_k)$ and checks each reconstructed $\alpha_j$ on top of the linear equations, which lets the HVZK simulator produce transcripts even for aborted runs.

The protocol that emerges from these repairs, moved to polynomial rings so that one shot suffices for approximate proofs, is the core of Crystals-Dilithium, selected by NIST in 2022 and standardized in 2024 as ML-DSA (FIPS 204). Its structure is the one above: a module-SIS key pair $(A, t = As + e)$, Fiat-Shamir with aborts and rejection sampling to keep transcripts independent of the secret. The size cost is concrete. The smallest ML-DSA parameter set publishes a $1312$-byte public key and produces $2420$-byte signatures, against $32$ and $65$ bytes for the 256-bit elliptic-curve equivalents.

Takeaway

Fiat-Shamir turns any passively secure identification scheme into a signature in the random oracle model, and special soundness plus HVZK are the checkable route to passive security. Lattices break the naive instantiation three ways, and the repairs, parallel repetition, smallness checks and rejection sampling, are the substance of Crystals-Dilithium.

Section 9Regev Public-Key Encryption

Lecture 11.

Encryption from Learning with Errors (LWE) follows the same pattern as the one-way function of section 5, with the injective face of $f_A$ carrying the message. The scheme is due to Regev (2005). It is the ancestor of every lattice encryption scheme that followed, including GSW in section 11 and Kyber in section 10.

Construction: Regev PKE

Goal. Public-key encryption of one bit from LWE. Key generation. Draw $A \getsr \Zq^{n \times m}$, $s \getsr \Zq^{n}$, $e \gets \chi^{m}$; set $\mathit{pk} = (A, b)$ with $b = A^{\top} s + e \bmod q$, and $\mathit{sk} = s$. Encryption of a bit $x$: draw fresh $r \getsr \{0,1\}^{m}$ and output the two-part ciphertext

$$c_0 = A r \in \Zq^{n}, \qquad c_1 = \langle b, r \rangle + x \lfloor q/2 \rceil \in \Zq.$$

Decryption. Compute $v = c_1 - \langle s, c_0 \rangle \bmod q$ and output the bit whose encoding $v$ is closer to: $0$ near the origin, $1$ near $\lfloor q/2 \rceil$.

Theorem: correctness and security

Correctness is one line of algebra: the $A$ terms cancel,

$$c_1 - \langle s, c_0 \rangle = \langle b, r \rangle + x \lfloor q/2 \rceil - \langle s, Ar \rangle = \langle e, r \rangle + x \lfloor q/2 \rceil,$$

and decoding succeeds whenever $\abs{\langle e, r \rangle} < q/4$, which the parameters guarantee with overwhelming probability. For security against any polynomial-time attacker, classical or quantum, LWE first replaces $(A, b)$ with a uniform pair, so the public key is indistinguishable from random; then the leftover hash lemma makes $c_0 = Ar$ statistically close to uniform for $r \getsr \{0,1\}^{m}$ with $m \ge n \log q + 2n$; and once $c_0$ is uniform, the payload $c_1$ is uniform regardless of $x$, so the message is hidden information-theoretically in the final hybrid.

The dual variant (Gentry, Peikert, Vaikuntanathan 2008) transposes the roles. The public key is $(A, u)$ with $u = A^{\top} r$ for a short $r \in \{0,1\}^{m}$. The secret key is $r$. Encryption draws a fresh LWE secret per ciphertext: the preamble is $c_0 = A s' + e'$ and the payload is $c_1 = \langle s', u \rangle + e'' + x \lfloor q/2 \rceil$, and Bob outputs $c_1 - \langle c_0, r \rangle$. In the primal scheme the public key is pseudorandom with a unique secret and each ciphertext admits many coin choices; in the dual scheme the public key is statistically random with many possible secrets and each ciphertext has unique coins. Both security proofs run the same two hybrids in opposite order. A practical bonus of the dual form is that the matrix $A$ can be shared across users.

The most efficient version (Lyubashevsky and Peikert 2011) takes a square matrix $A \in \Zq^{n \times n}$ and draws both the secret and the encryption randomness from the error distribution $\chi$: $\mathit{pk} = (A, u = A^{\top} s + e)$, preamble $c_0 = A r + e'$, payload $c_1 = \langle u, r \rangle + e'' + x \lfloor q/2 \rceil$. Its security uses LWE with short secrets, the theorem of section 3, to replace $(A, u)$ with uniform. This is essentially the shape Crystals-Kyber encrypts in, before the Fujisaki-Okamoto transform of the next section wraps it into a Key Encapsulation Mechanism (KEM).

Takeaway

Regev encryption encodes a bit as a shift by half the modulus and hides it inside LWE samples; correctness is the cancellation of the $A$ terms, and security is the two-step hybrid of LWE followed by the leftover hash lemma. Primal, dual and LP11 variants move the short secret between the key and the ciphertext, and all three prove the same statement.

Section 10The Fujisaki-Okamoto Transform and Crystals-Kyber

Lecture 11.

Regev's scheme is Chosen-Plaintext Attack (CPA) secure. That is the strongest notion its randomization buys. Deployed key transport faces active adversaries, classical or quantum, who submit ciphertexts of their own and watch the reactions, so the target is Chosen-Ciphertext Attack (CCA) security. The Fujisaki-Okamoto transform (1999, refined 2013) converts any passively secure public-key scheme into an actively secure one, at the cost of two hash functions modeled as random oracles. The result is best read as a key encapsulation mechanism: Alice runs $\mathsf{Encaps}$ under $\mathit{pk}$ to obtain a key $k$ and a ciphertext $c$, Bob runs $\mathsf{Decaps}(\mathit{sk}, c)$ to recover the same $k$ and the pair then uses $k$ with a symmetric scheme.

The transform is cleaner in two halves, with an intermediate notion. One-Wayness under Chosen-Plaintext Attack (OW-CPA) says an attacker given $\mathit{pk}$ and a challenge ciphertext for a uniform unknown message cannot guess the message; One-Wayness under Plaintext-Checking Attack (OW-PCA) adds a plaintext-checking oracle that answers whether $\Dec(\mathit{sk}, c) = m$ for queried pairs.

Construction: transform T, derandomization

From Indistinguishability under Chosen-Plaintext Attack (IND-CPA), or OW-CPA, to OW-PCA. Replace the encryption randomness with a hash of the message: $c = \Enc(\mathit{pk}, m;\, r = \Hash_G(m))$. Encryption becomes deterministic. Decryption of $c$ recovers a candidate $m'$, re-encrypts it as $\Enc(\mathit{pk}, m'; \Hash_G(m'))$ and outputs $m'$ if and only if the result equals $c$, rejecting otherwise. Theorem (HKK 2017): the transformed scheme is OW-PCA.

Construction: transform U, encapsulation

From OW-PCA to Indistinguishability under Chosen-Ciphertext Attack (IND-CCA). Encapsulation draws $m \getsr \mathcal{M}$, computes $c = \Enc'(\mathit{pk}, m)$ and outputs the key $k = \Hash_H(c, m)$ together with $c$. Decapsulation computes $m' = \Dec'(\mathit{sk}, c)$ and outputs $k' = \Hash_H(c, m')$, where $m'$ may be the explicit rejection symbol $\bot$. Theorem (HKK 2017): the KEM is IND-CCA.

Worked example: one encapsulation run
  1. Alice draws a uniform message $m \getsr \mathcal{M}$.
  2. She encrypts it deterministically under transform T: $c = \Enc(\mathit{pk}, m;\, r = \Hash_G(m))$.
  3. She derives the key $k = \Hash_H(c, m)$ and sends $c$ to Bob.
  4. Bob computes the candidate $m' = \Dec(\mathit{sk}, c)$, re-encrypts it as $\Enc(\mathit{pk}, m';\, \Hash_G(m'))$ and accepts only if the result equals $c$.
  5. Bob outputs $k' = \Hash_H(c, m')$, equal to $k$ on acceptance. On rejection $m'$ is the symbol $\bot$. The output $\Hash_H(c, \bot)$ is the same for every challenge message.

Each mechanism blocks a specific abuse. The re-encryption check defeats the decryption oracle: a modified ciphertext decrypts to some $m'$ whose re-encryption almost surely differs from the query, so the answer is rejection regardless of the challenge message, and the plaintext-checking capability the attacker was hoping for never materializes. Explicit rejection matters for timing and for the proof, since the decapsulation output must depend only on the hash of whatever came out, valid or invalid. Skipping either ingredient admits a chosen-ciphertext attack, as exercise 4 works out.

Crystals-Kyber is the instantiation: the LP11-style Module-LWE encryption of section 9, over the ring $\Zq[X]/(X^{d}+1)$ with module rank $k$, wrapped in this transform. NIST selected it in 2022 and published it in 2024 as ML-KEM (FIPS 203). The parameter sets are named for their target security: ML-KEM-512, ML-KEM-768 and ML-KEM-1024 match AES-128, AES-192 and AES-256. At the smallest set the public key is $800$ bytes, the ciphertext $768$ bytes and the secret key $1632$ bytes. ML-KEM is the first post-quantum key encapsulation in broad deployment, and current practice runs it in hybrid mode, combined with an elliptic-curve exchange so that a break of either component still leaves the session key intact.

What went wrong. KyberSlash (2024) showed timing side channels in Kyber implementations: secret-dependent divisions leaked secret keys. Constant-time code matters as much as the mathematics.

A Alice Encaps m random, k = H(c, m) Decaps re-encrypt and check B Bob c pk k k = H(c, m) k = H(c, m') or reject
Key encapsulation under Fujisaki-Okamoto. Both parties derive the same key from the ciphertext; the decapsulation side re-encrypts and rejects anything that does not reproduce the query.
Takeaway

The Fujisaki-Okamoto transform is the standard route from CPA-secure encryption to a CCA-secure KEM: derandomize with a hash and verify by re-encryption (T), then hash the pair $(c, m)$ into the key with explicit rejection (U). Crystals-Kyber is Module-LWE plus this transform, standardized as ML-KEM.

Section 11Fully-Homomorphic Encryption

Lecture 12.

Encryption so far has protected data at rest and in transit while destroying its utility, since a server holding $\Enc(\mathit{pk}, x)$ cannot compute $f(x)$. The motivating scenario is outsourced computation: a client uploads private $x$ to an untrusted server, the server evaluates $f$ and the client decrypts $f(x)$, with the server learning nothing. Computing on encrypted data subsumes so many other tasks that a general solution yields most of private computation.

History

Rivest asked in the late 1970s for "privacy homomorphisms", and partial answers existed for decades, since RSA multiplies ciphertexts and ElGamal does the same. The first full solution, after thirty years, is Gentry's 2009 construction.

Definition: fully-homomorphic encryption

An FHE scheme is $(\mathsf{KGen}, \Enc, \Dec, \mathsf{Eval})$ where $\mathsf{Eval}(\mathit{pk}, f, c)$ outputs a ciphertext such that, for every efficient $f$, correctness holds: $\Dec(\mathit{sk}, \mathsf{Eval}(\mathit{pk}, f, c)) = f(x)$ for $c = \Enc(\mathit{pk}, x)$, and privacy holds: evaluated ciphertexts are indistinguishable from fresh encryptions of a dummy message. Full homomorphism is correctness for a universal function set, say NAND gates or the ring operations $(+, \times)$. Levelled FHE restricts $f$ to circuits of bounded depth $\tau$.

An apparent paradox motivates the randomized requirement. Consider $f(x_1, x_2, x_3) = x_2$ if $x_1 = 0$ and $x_3$ if $x_1 = 1$. A server evaluating $f$ on three ciphertexts returns either $\Enc(\mathit{pk}, x_2)$ or $\Enc(\mathit{pk}, x_3)$. The identity of the returned object reveals $x_1$. The resolution is that encryption is randomized: the output of $\mathsf{Eval}$ is computationally indistinguishable from a fresh encryption of $f(x)$, so the server cannot tell which branch it computed. A trivial construction shows the definition is otherwise easy to satisfy: set $\mathsf{Eval}(\mathit{pk}, \Gamma, c) = (\Gamma, c)$ and let $\Dec'$ run $\Gamma$ on the decrypted input. It is correct and private, and useless, because decryption now costs as much as the circuit. Real FHE keeps the evaluation structure while keeping decryption cheap.

Construction: GSW (Gentry, Sahai, Waters 2013)

Goal. A fully homomorphic scheme from LWE, with plaintext space $\Zq$. The intuition is the eigenvector method: a ciphertext $C$ is a matrix for which the secret key $s$ is an approximate eigenvector, satisfying the invariant

$$s \cdot C = e + x \cdot s \cdot G,$$

with $G$ the gadget matrix of section 6 and $e$ small. Exact eigenvectors would be insecure, since eigenvalues are easy to compute; the noise $e$ is what hides $x$, and decryption works while $\abs{e} \ll q$. Concretely, with public LWE matrix $A$ and randomness matrix $R$, set $\Enc(A, x; R) = C = A R + x G$; then $s C = e R + x s G$ has the invariant's form. Decryption computes $s \cdot C \cdot G^{-1}(0, \dots, 0, -q/2)^{\top}$ and compares against $q/4$.

Homomorphism follows the invariant. Addition is matrix addition: $C_{+} = C_1 + C_2$ carries plaintext $x_1 + x_2$ and noise $e_1 + e_2$. Multiplication uses gadget decomposition to control the blow-up: $C_{\times} = C_1 \cdot G^{-1}(C_2)$, and expanding the invariant gives plaintext $x_1 x_2$ with noise $e_{\times} = e_1 G^{-1}(C_2) + x_1 e_2$, bounded by about $(N + 1) \cdot \max(\abs{e_1}, \abs{e_2})$ where $N$ is the gadget width. Without the gadget the noise would square at every multiplication; with it, growth is linear per level. After multiplicative depth $\tau$ the noise is at most $(N + 1)^{\tau - 1} \cdot m \cdot \alpha q$. Correctness requires $n \cdot m \cdot (N + 1)^{\tau - 1} < q/4$. Choosing parameters for a target depth gives levelled FHE. The ciphertext size stays polynomial in the security parameter and $\tau$, which is weak compactness. Security is the Regev argument again: LWE makes $A$ uniform-looking, the leftover hash lemma makes each column of $AR$ statistically uniform and the ciphertext hides the plaintext computationally under LWE.

Levelled schemes have a hard limit. Parameters grow with the depth. No evaluation is possible once the noise crosses $q/4$. Gentry's trick removes the limit. Bootstrapping refreshes a ciphertext by homomorphically evaluating the scheme's own decryption circuit: given an encryption of the secret key under a fresh key, $\mathsf{Eval}$ runs $\Dec$ inside the encryption, producing a fresh ciphertext of the same plaintext with noise reset to the fresh level. Key switching chains the levels, so a few operations per key suffice. The construction assumes circular security: $\Enc(\mathit{pk}, 0) \approx_c \Enc(\mathit{pk}, 1)$ must hold even given an encryption of $\mathit{sk}$ under $\mathit{pk}$. GSW is conjectured to have this property. No proof is known.

Lab

A Toy FHE Noise Budget

Track the worst-case noise of a GSW-style ciphertext under homomorphic operations. Additions add fresh noise, multiplications multiply it by the gadget factor $N + 1$ and bootstrapping resets it. Watch the budget $q/4$ and the count of remaining multiplications.

·noise |e|
·budget q/4
·mults left
·decryption
Takeaway

FHE evaluates arbitrary circuits on ciphertexts. The whole design problem is noise management: additions add it, multiplications multiply it by the gadget factor, the budget is $q/4$, levelled schemes size the parameters to a depth bound and bootstrapping homomorphically re-encrypts to reset the noise, under the circular security assumption.

Section 12Identity-Based Encryption (IBE) and Attribute-Based Encryption (ABE) from Lattices

Lecture 13 (first half).

Chapter 2 built identity-based encryption from pairings, whose security falls with the discrete logarithm under Shor's algorithm. The lattice construction preserves the interface while replacing the algebra. It also leads to attribute-based encryption. Key escrow remains: the authority that issues private keys can read every message.

Definition: selective security for IBE

$\Adv$ announces the challenge identity $\mathit{ID}^{*}$ first, receives the master public key $\mathit{mpk}$ and may request secret keys $\mathit{sk}_{\mathit{ID}} = \mathsf{KGen}(\mathit{msk}, \mathit{ID})$ for any identity except $\mathit{ID}^{*}$. It then submits two messages, receives $c \gets \Enc(\mathit{ID}^{*}, m_b)$ for random $b$ and guesses $b$. Selective security requires advantage $\negl(\lambda)$. Adaptive (Full) security lets $\Adv$ choose $\mathit{ID}^{*}$ after seeing $\mathit{mpk}$; selective security implies it with an exponential loss in the parameters, and general transformations exist.

Construction: warm-up IBE (CHKP 2010)

Goal. Identity-based encryption with selective security. For two-bit identities, publish $\mathit{mpk} = (A_0, A_1^{0}, A_1^{1}, A_2^{0}, A_2^{1}, u)$, uniform matrices plus a vector $u$. The master secret key is a trapdoor for $A_0$. The secret key for $\mathit{ID} = b_1 b_2$ is a short vector $s$ with $F_{\mathit{ID}}^{\top} s = u \bmod q$, where $F_{\mathit{ID}} = [A_0 \,\|\, A_1^{b_1} \,\|\, A_2^{b_2}]$; a trapdoor for $A_0$ yields one for every $F_{\mathit{ID}}$ by section 6. Encryption is dual-Regev under $F_{\mathit{ID}}$: send $c_0 = F_{\mathit{ID}} r + e$ and $c_1 = \langle r, u \rangle + e' + x \lfloor q/2 \rceil$, and Bob outputs $c_1 - \langle c_0, s \rangle \approx x \lfloor q/2 \rceil$. The selective proof embeds the challenge: for $\mathit{ID}^{*} = 11$ the reduction samples the four matrices so that it holds trapdoors for every $F_{\mathit{ID}}$ except $F_{11}$, answers all extraction queries and plants the LWE challenge in the encryption of $\mathit{ID}^{*}$.

Construction: efficient IBE (ABB 2010)

Goal. The same security with a public key that does not grow with the identity space. Shrink the public key to $\mathit{mpk} = (A_0, A_1, G, u)$ and set $F_{\mathit{ID}} = [A_0 \,\|\, A_1 + \mathit{ID} \cdot G]$, using the gadget matrix as the identity-dependent part. The tag property of the MP12 trapdoor does the work: a trapdoor for $A_0$ extends to $F_{\mathit{ID}}$ for every $\mathit{ID}$, and in the proof the reduction sets $A_1 = \bar{A} R - \mathit{ID}^{*} G$, so $F_{\mathit{ID}} = [A_0 \,\|\, A_0 R + (\mathit{ID} - \mathit{ID}^{*}) G]$ carries a usable trapdoor only when $\mathit{ID} \neq \mathit{ID}^{*}$. One random matrix replaces the exponential family of the warm-up, and encryption is dual-Regev as before.

The same skeleton generalizes from identities to predicates. Inner-product encryption (Katz, Sahai, Waters 2008; Agrawal, Freeman, Vaikuntanathan 2011): Alice encrypts with an attribute vector $a = (a_1, \dots, a_k)$, Bob holds a key $\mathit{sk}_b$ for a vector $b$ and decryption recovers $x$ if and only if $\langle a, b \rangle = 0$. The AFV construction publishes $(A, A_1, \dots, A_k, G, u)$, gives Bob a short $s_b$ with $F_b^{\top} s_b = u$ for $F_b = [A \,\|\, \sum_i b_i A_i]$. The ciphertext components along the $A_i$ are masked so that $a$ itself stays hidden, which is the attribute-privacy variant. Attribute-based encryption (Sahai and Waters 2004) replaces the inner product with a general predicate: decryption succeeds if and only if $f(a) = 0$, with no attribute privacy required. The lattice realization (Garg, Gentry, Halevi and collaborators 2014) handles the missing operation, multiplication, by gadget algebra: from ciphertext pieces for $a_1$ and $a_2$ one forms a piece for the product with matrix $A_{a_1 a_2} = A_1 A_2 + a_1 a_2 G$, combining $c_{a_1}^{\top} G^{-1}(-A_2)$ and $c_{a_2}^{\top} a_1$, where the small terms keep the noise under control. Additions compose trivially, so every boolean circuit of attributes is reachable, which is why ABE is the standard tool for privacy-preserving data mining and fine-grained access control on encrypted data.

Takeaway

Lattice IBE replaces the pairing of Boneh-Franklin with dual-Regev encryption under identity-tagged matrices. The trapdoor machinery of section 6 is what lets the authority derive keys while the reduction withholds the challenge one. The same pattern extends to inner-product and attribute-based encryption, where the gadget matrix absorbs multiplication. Escrow remains the price.

Section 13Further Resources

Further reading: Katz and Lindell (2015), Introduction to Modern Cryptography, the standard reference for the provable-security style used throughout this chapter.

Section 14Exercises

The exercises start with drills, continue with attacks and design questions and end with one project. Every answer is derived independently; the arithmetic in them reproduces the labs on this page.

Solve a toy SIS instance and verify an LWE secret by residuals. Drill

SIS. Let $q = 7$ and

$$A = \begin{pmatrix} 2 & 3 & 5 \\ 4 & 1 & 5 \end{pmatrix} \in \Z_7^{2 \times 3}.$$

The vector $z = (1, 1, -1)$ is a valid short solution: $2 + 3 - 5 = 0$ and $4 + 1 - 5 = 0$, both modulo $7$. Gaussian elimination also finds a solution, for instance by setting $z_3 = 1$ and solving $2 z_1 + 3 z_2 = 2$, $4 z_1 + z_2 = 2$, which gives $z_1 = 3$, $z_2 = 4$ modulo $7$, so $z' = (3, 4, 1)$. Both satisfy the equation; only $z$ is short. The shortness bound $\beta$ is what makes the problem hard, and here $\abs{z}_{\infty} = 1$ while the elimination solution has coefficients up to $4$. A forgery in section 7 needs the short kind.

LWE. Let $q = 17$, $s = (3, 15)$ (that is, $-2$ in centered form), sample rows $a_1 = (5, 7)$, $a_2 = (1, 13)$, $a_3 = (6, 2)$ and errors $e = (1, -1, 2)$. The published vector is $b = (\langle s, a_1 \rangle + 1,\; \langle s, a_2 \rangle - 1,\; \langle s, a_3 \rangle + 2) = (2, 10, 16) \bmod 17$. For the true secret the residuals $b_i - \langle t, a_i \rangle$ are exactly $e_i = (1, -1, 2)$, all within $\pm 2$. For the candidate $t = (4, 15)$ the residuals are $(-4, -2, -4)$ in centered form, and $\abs{-4} > 2$, so the candidate fails the smallness test. Checking a secret is $O(mn)$; finding one means searching $q^{n}$ candidates, and at real parameters no shortcut is known.

Why is a short basis a trapdoor? Quantify it on a two-dimensional lattice. Drill

Take the lattice with basis $b_1 = (2, 1)$, $b_2 = (1, 3)$, determinant $5$. The vectors $b_1' = 2 b_1 - 3 b_2 = (1, -7)$ and $b_2' = 3 b_1 - 4 b_2 = (2, -9)$ form a second basis of the same lattice, since the change-of-basis matrix $\left(\begin{smallmatrix} 2 & 3 \\ -3 & -4 \end{smallmatrix}\right)$ has determinant $1$. Run Babai's nearest-plane algorithm for the target $v = (4, 5)$. With the short basis it returns the coefficients $(2, 1)$, the point $(5, 5)$, at distance $1$, which is the true closest lattice point. With the long basis it returns $(-10, 7)$, the point $(4, 7)$, at distance $2$, missing the closest point. The lab in section 6 reproduces both runs.

The reason is geometric. Nearest-plane rounds one coordinate at a time inside the fundamental parallelepiped of the working basis. A short, nearly orthogonal basis has a small parallelepiped, so every rounded point stays close to the target; a long skewed basis has a large slanted one, so the rounding error can be as large as the basis itself. Inverting the SIS/LWE functions of section 6 is a closest-point computation in the coset $u + \Lambda^{\perp}(A)$, so a short basis for $\Lambda^{\perp}(A)$ makes the inversion efficient while the public description of $A$ leaves it hard. That is the trapdoor, and basis quality is measured by the Gaussian width parameter $s$ the sampler needs.

Prove Regev decryption correct, and check it on a concrete key. Drill

With $b = A^{\top} s + e$, $c_0 = A r$ and $c_1 = \langle b, r \rangle + x \lfloor q/2 \rceil$, the decryption value is

$$v = c_1 - \langle s, c_0 \rangle = \langle A^{\top} s + e, r \rangle + x \lfloor q/2 \rceil - \langle s, A r \rangle = \langle e, r \rangle + x \lfloor q/2 \rceil \pmod q.$$

The terms involving $A$ cancel because $\langle A^{\top} s, r \rangle = \langle s, A r \rangle$. If $\abs{\langle e, r \rangle} < q/4$, then $v$ lies within $q/4$ of the encoding of $x$ and at least $q/4$ from the other one, since the two encodings are $\lfloor q/2 \rceil$ apart, so rounding recovers $x$. With $r \in \{0,1\}^{m}$ the error sum has at most $\abs{r}$ nonzero terms. The noise distribution is chosen so this bound holds with overwhelming probability.

Concrete check with $q = 101$, $s = (3, 99)$, errors $e = (1, -1, 2, 0, -2)$ and the matrix with columns $(4, 55)$, $(11, 7)$, $(87, 31)$, $(22, 90)$, $(60, 14)$: then $b = A^{\top} s + e = (4, 18, 100, 88, 49)$. Encrypting $x = 1$ with $r = (1, 0, 1, 1, 0)$ gives $c_0 = A r = (12, 75)$ and $c_1 = (4 + 100 + 88) + 50 = 40 \bmod 101$. Decryption yields $v = 40 - (3 \cdot 12 + 99 \cdot 75) = 40 - 88 = 53 \bmod 101$, which is $\langle e, r \rangle + 50 = 3 + 50$, at distance $3 < q/4$ from $50$, so the output is $1$. For $x = 0$ the same computation gives $v = 3$, close to $0$, so the output is $0$.

What does each half of the Fujisaki-Okamoto transform contribute, and what breaks if decapsulation skips the re-encryption check? Attack

Transform $\mathsf{T}$ derandomizes: the encryption randomness becomes $r = \Hash_G(m)$, and decryption verifies by re-encrypting the candidate $m' = \Dec(\mathit{sk}, c)$ under $\Hash_G(m')$ and accepting only if the result equals $c$. This moves the scheme from IND-CPA to OW-PCA: even an attacker with a plaintext-checking oracle cannot recover the challenge message, because valid ciphertexts are exactly the re-encryptions of their own plaintexts, and checking a guess $m$ means producing $\Enc(\mathit{pk}, m; \Hash_G(m))$, which for the challenge $c$ is as hard as inverting the one-way scheme.

Transform $\mathsf{U}$ hashes the pair into the key, $k = \Hash_H(c, m)$, and adds explicit rejection: decapsulation outputs $\Hash_H(c, m')$ where $m'$ may be $\bot$. This moves OW-PCA to IND-CCA for the KEM. Suppose the re-encryption check is skipped, so decapsulation returns $\Hash_H(c, m')$ for whatever $m' = \Dec(\mathit{sk}, c)$ produces. In the CCA game the adversary takes the challenge ciphertext $c^{*}$, modifies it to a related $c' \neq c^{*}$ whose plaintext $m'$ it can predict (for deterministic inner schemes, small edits to $c$ often edit $m'$ controllably), queries the decapsulation oracle on $c'$ and compares the returned key with $\Hash_H(c', m_0)$ and $\Hash_H(c', m_1)$ computed for both challenge candidates. The comparison identifies $m'$, and any relation between $m'$ and the challenge bit decides the game. The re-encryption check kills this: a perturbed ciphertext almost surely fails the check and returns the same rejection value for both candidates, so the oracle carries no information about the challenge. Explicit rejection additionally keeps the output distribution identical on invalid inputs, which the proof needs to simulate the oracle without the secret key.

An FHE noise budget. With $n = 8$, $m = 20$, gadget width $N = 7$ and $q = 2^{40}$, what is the largest multiplicative depth $\tau$ the scheme supports? Drill

The GSW correctness bound of section 11 requires, after multiplicative depth $\tau$,

$$n \cdot m \cdot (N + 1)^{\tau - 1} < q/4.$$

Substituting, $n m = 160$, $N + 1 = 8$ and $q/4 = 2^{38} = 274\,877\,906\,944$. The condition is $160 \cdot 8^{\tau - 1} < 2^{38}$. Testing powers: $160 \cdot 8^{10} = 160 \cdot 2^{30} = 171\,798\,691\,840 < 2^{38}$, while $160 \cdot 8^{11} = 160 \cdot 2^{33} = 1\,374\,389\,534\,720 > 2^{38}$. The largest supported depth is therefore $\tau = 11$. One more multiplication multiplies the noise bound by $8$ and crosses the budget, after which decryption rounds to the wrong value and only bootstrapping can continue the computation. The toy tracker in section 11 shows the same cliff: each multiplication scales the bar by the gadget factor until it crosses the $q/4$ line.

The structural point: depth costs a factor of $N + 1$ per level in the noise, so the modulus must grow exponentially in $\tau$. Ciphertexts grow with it. That is the trade levelled FHE accepts. Bootstrapping breaks the dependence.

In the naive lattice identification scheme with $s, u \in \{0,1\}^{n}$ and challenge $\beta = 1$, which coefficients of $\gamma = \beta s + u$ leak the secret, and how does rejection sampling restore HVZK? Attack

Each coefficient satisfies $\gamma_i = s_i + u_i \in \{0, 1, 2\}$. The extremes are deterministic statements about the secret: $\gamma_i = 0$ happens only when $s_i = 0$ and $u_i = 0$, and $\gamma_i = 2$ only when $s_i = 1$ and $u_i = 1$. Only $\gamma_i = 1$ is ambiguous. A verifier reading one transcript learns every coordinate of $s$ whose $\gamma$ coefficient is $0$ or $2$, about half of them in expectation, so the scheme is not HVZK: no simulator given only $\mathit{pk}$ can reproduce a distribution that reveals half the secret.

Widening the mask to $u_i \in \{0, \dots, b - 1\}$ with $b > 1$ moves the leak to the two extremes $\gamma_i = 0$ (forcing $s_i = 0, u_i = 0$) and $\gamma_i = b$ (forcing $s_i = 1, u_i = b - 1$). Every middle value $i \in \{1, \dots, b - 1\}$ occurs with probability exactly $1/b$ regardless of $s_i$, so the middle reveals nothing. Rejection sampling sends $\gamma$ only when every coefficient lies in the middle range and aborts otherwise. Conditioned on not aborting, the distribution of $\gamma$ is independent of $s$, which is HVZK: the simulator samples uniform middle values. The cost is the acceptance probability, $1 - 1/b$ per coefficient, and with $b = mk$ tuned to the number of coefficients per execution, the probability a full run completes is about $1/e$, so the expected number of restarts is the constant $e$. The remaining subtlety, aborts inside the Fiat-Shamir hash, is handled by committing to $\alpha = \Hash(\alpha_1, \dots, \alpha_k)$, which lets the simulator commit to a random $\alpha$ before knowing whether the run aborts.

Exam project shape: implement toy Regev PKE and measure its decryption failure probability. Project

The deliverable has four pieces. (1) Key generation for parameters $n$, $m$, $q$: sample $A \getsr \Zq^{n \times m}$, $s \getsr \Zq^{n}$ and $e$ from a discrete Gaussian (or a bounded uniform distribution, with the deviation stated), and publish $(A, b = A^{\top} s + e)$. (2) Encryption and decryption exactly as in section 9, with the bit encoded at $\lfloor q/2 \rceil$ and decoded by nearest of the two encodings. (3) A failure experiment: for a fixed parameter set, run a few thousand encryptions of random bits and estimate $\Pr[\abs{\langle e, r \rangle} \ge q/4]$, the decryption failure probability. Sweep the noise width and plot the failure rate against it; the cliff where the rate leaves zero is the correctness bound in action. (4) Two negative controls that demonstrate where the security lives: with $e = 0$, Gaussian elimination on the first $n$ samples recovers $s$ and every message, so measure the recovery rate and report it as $1$; and with $m < n$, the system is underdetermined and several secrets fit, so report the number of consistent solutions as the lab in section 3 does.

A strong report states the parameter trade explicitly: larger $q$ widens the correctness margin but grows the keys, larger noise width raises security against LWE solvers but raises the failure rate and $m \ge n \log q + 2n$ is what the leftover hash lemma needs for the statistical-hiding step. Connecting the measured failure cliff to the bound $\abs{\langle e, r \rangle} < q/4$, and the $e = 0$ collapse to the statement that LWE without noise is linear algebra, is the argument the project is really testing.

Authorship

These pages are written by a student of the course. The mathematics is stated in the standard way. The formulation is the author's own, taken from no slide. Errors are the author's alone. Prof. Venturi bears no responsibility for them; where this page and the PDFs differ, the PDFs are authoritative and only material in them is examinable.