Block Ciphers · Cryptography and Network Security

Linear Cryptanalysis

Watch lectures

Linear Cryptanalysis

1. Core Idea: Linear Approximations with Bias

Linear cryptanalysis (Matsui, 1993) is a known-plaintext attack: find linear equations Pi1⊕⋯⊕Cj1⊕⋯⊕Kk1⊕⋯=0P_{i_1} \oplus \cdots \oplus C_{j_1} \oplus \cdots \oplus K_{k_1} \oplus \cdots = 0 that hold with probability $p
e 1/2.The∗∗bias∗∗. The **bias** \epsilon = |p - 1/2|isthesignal—idealciphergives is the signal — ideal cipher gives \epsilon = 0$; S-box nonlinearity leaves small biases attackers amplify. Needs only known (not chosen) plaintext — weaker attacker assumption than differential, but far more data.

2. Piling-Up Lemma (Worked)

Combine approximations: bias of XOR of nn independent approximations:

ϵ1..n=2n−1∏i=1nϵi(Piling-Up)\epsilon_{1..n} = 2^{n-1}\prod_{i=1}^{n}\epsilon_i \quad \text{(Piling-Up)}

Worked: S-box approximations with biases ϵ1=1/4\epsilon_1 = 1/4, ϵ2=1/8\epsilon_2 = 1/8, ϵ3=1/8\epsilon_3 = 1/8: combined ϵ=22×14×18×18=4256=164\epsilon = 2^2 \times \frac{1}{4} \times \frac{1}{8} \times \frac{1}{8} = \frac{4}{256} = \frac{1}{64}. Data needed ≈c/ϵ2\approx c/\epsilon^2 (Matsui's rule: N≈1/ϵ2N \approx 1/\epsilon^2 pairs): here N≈642=4096N \approx 64^2 = 4096 known plaintexts. Each added round multiplies biases (shrinking fast) — same exponential-rounds defense as differential.

S-box linear table logic: for S-DES S0S0, mask relation a⋅X=b⋅S(X)a \cdot X = b \cdot S(X) over GF(2)GF(2) inner products: count agreements over 16 inputs; 10/16→ϵ=10/16−1/2=1/810/16 \to \epsilon = 10/16 - 1/2 = 1/8. Best nonzero entry per S-box is its linear strength; DES S-boxes keep max bias ≤1/4\le 1/4-ish per box.

3. Matsui's Algorithm 1 and 2 (Key Recovery)

  • Algorithm 1 (key-bit decision): use r−1r-1-round approximation with bias ϵ\epsilon: count agreements over NN known pairs; if agreements >N/2> N/2, key-XOR sum =0= 0, else 11. Success rate from normal approximation: N=1/ϵ2N = 1/\epsilon^2 gives ≈97.7%\approx 97.7\%.
  • Algorithm 2 (key extraction): peel last round — for each candidate last-subkey, partially decrypt and measure bias of the approximation; right key shows ∣ϵ∣|\epsilon|, wrong keys ≈0\approx 0. Recovers 26 key bits of DES with 2432^{43} known plaintexts; remaining 30 by brute force → total ≈243\approx 2^{43} data + 2432^{43} work (1994 experiment: 50 days).
  • DES full-16 needs 2432^{43} known pairs (≈1\approx 1 TB) — impractical; 8-round DES needs only ≈221\approx 2^{21}.

4. Differential vs Linear (Exam Table)

Point Differential (Topic 5) Linear (this topic)
Plaintext Chosen pairs with fixed Δ\Delta Known (arbitrary) pairs
Signal S-box difference non-uniformity, prob pp Linear-approximation bias ϵ=∥p−1/2∥\epsilon = \|p-1/2\|
Combiner P=∏piP = \prod p_i ϵ=2n−1∏ϵi\epsilon = 2^{n-1}\prod\epsilon_i (Piling-Up)
Data ≈c/P\approx c/P ≈c/ϵ2\approx c/\epsilon^2
DES-16 cost 2472^{47} chosen 2432^{43} known (Matsui experiment)
Designer defense Low max differential prob + rounds Low max linear bias + rounds (wide trail bounds both)

AES: max S-box bias 2−42^{-4} with branch number 5 → 4-round bias ≤2−75\le 2^{-75}, data 21502^{150} — immune.

Exam Points

  • Bias definition + Piling-Up formula with 1/4,1/8,1/8→1/641/4, 1/8, 1/8 \to 1/64 worked combiner — 5-mark numerical core.
  • N≈1/ϵ2N \approx 1/\epsilon^2 rule + Matsui Algorithm 1 majority logic.
  • Known-vs-chosen distinction + full table differential-vs-linear — guaranteed 5-marker.
  • DES numbers (2432^{43} known, 50-day experiment) vs AES immunity line.
Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.

← All Cryptography and Network Security modules