Block Ciphers · Cryptography and Network Security

Block Cipher Principles

Watch lectures

Block Cipher Principles

1. What a Block Cipher Is

A block cipher encrypts fixed-size blocks (n=64n = 64 DES, 128128 AES) with a keyed invertible map:

C=E(K,P),P=D(K,C),P,C∈{0,1}nC = E(K, P), \quad P = D(K, C), \quad P, C \in \{0,1\}^n

For fixed KK, EKE_K is a permutation of 2n2^n blocks. Ideal ("random permutation") needs log⁡2(2n!)≈n⋅2n\log_2(2^n!) \approx n \cdot 2^n key bits (huge: 64×26464 \times 2^{64}) — real ciphers approximate it with small keys via iterated rounds (DES 2562^{56}, AES 21282^{128}).

2. Stream vs Block (Exam Contrast)

Point Stream cipher Block cipher
Unit Bit/byte at a time (Ci=Pi⊕kiC_i = P_i \oplus k_i) Whole nn-bit block
Keystream Key + IV expanded; reuse = break Key schedule → round subkeys
Error spread One-bit error → one-bit error One-bit error → full block garbled (with chaining, more)
Padding/mode None needed Padding + mode (ECB/CBC/...) for long messages
Examples RC4, ChaCha20 (Module 4 Topics 6–7) DES, AES (Topics 3, Module 4 Topic 2)

3. Shannon: Confusion and Diffusion (The Design Theory)

Claude Shannon (1949) demands two properties; every exam answer on "principles" centers them:

  • Confusion: ciphertext statistics must not reveal key — complex nonlinear key↔cipher relation. Achieved by substitution (S-boxes): S-DES S0/S1, DES 6→46 \to 4 S-boxes, AES SubBytes inversion in GF(28)GF(2^8).
  • Diffusion: one plaintext bit must spread over many ciphertext bits (and vice versa) — kills frequency/digram statistics. Achieved by permutation/transposition: DES E-expansion + P-box, AES ShiftRows + MixColumns.

Feistel/SPN round = confusion + diffusion layered; after enough rounds (DES 16, AES 10–14) the cipher shows avalanche: 1 input bit flips ≈50%\approx 50\% of output bits; strict avalanche + bit-independence are the measurable criteria.

4. Feistel Structure (Why DES Can Decrypt)

Split block (L0,R0)(L_0, R_0); per round ii with subkey KiK_i:

Li=Ri−1,Ri=Li−1⊕F(Ri−1,Ki)L_i = R_{i-1}, \quad R_i = L_{i-1} \oplus F(R_{i-1}, K_i)

Final (Ln,Rn)(L_n, R_n) (often swapped). Decryption = same circuit, subkeys reversed — because XOR cancels: Li−1=Ri⊕F(Li,Ki)L_{i-1} = R_i \oplus F(L_i, K_i). FF need not be invertible (DES FF expands 32→48→3232 \to 48 \to 32) — Feistel's genius vs SPN (AES), where every layer must invert.

Ideal block cipher checklist (Stallings): large nn (birthday bound 2n/22^{n/2}), large key (2k2^k brute force), complex key schedule (related-key resistance), no statistical weakness (confusion/diffusion), nonlinear S-boxes with avalanche.

Exam Points

  • C=E(K,P)C = E(K,P) definition + stream-vs-block table — 2–5 mark opener.
  • Confusion (S-box, key hiding) vs diffusion (permutation, spreading) with DES/AES examples each — 5-mark theory core.
  • Feistel equations + "F need not invert" + decrypt-with-reversed-keys proof sketch.
  • Avalanche 50% + ideal-cipher checklist.
Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.

← All Cryptography and Network Security modules