← back to cryptography

Block Ciphers

Wikipedia · wpBlock cipher · CC BY-SA 4.0

A block cipher encrypts fixed-size blocks (e.g. 128 bits) using a key. The same key encrypts and decrypts. Security comes from multiple rounds of substitution and permutation, creating confusion (each ciphertext bit depends on many key bits) and diffusion (each plaintext bit affects many ciphertext bits).

L0 R0 F(K1) + swap L1 R1 F(K2) + swap ... Ln Rn Feistel network: split, round function, XOR, swap.

Feistel network

Split the block into left and right halves. In each round: apply a round function F (keyed by a subkey) to the right half, XOR the result into the left half, then swap. After all rounds, concatenate. Decryption runs the same structure in reverse. The round function F does not need to be invertible, because XOR is its own inverse.

Scheme

AES — the modern standard

AES (Rijndael) is not a Feistel network. It operates on a 4x4 byte grid (128-bit block) with four operations per round: SubBytes (nonlinear substitution via an S-box), ShiftRows (cyclic shift of each row), MixColumns (linear mixing within columns), and AddRoundKey (XOR with the round subkey). AES-128 uses 10 rounds. Each operation targets either confusion or diffusion.

Scheme

Confusion and diffusion

wpClaude Shannon identified two properties every good cipher needs. Confusion: each ciphertext bit should depend on many key bits (SubBytes provides this). Diffusion: changing one plaintext bit should change about half the ciphertext bits (ShiftRows and MixColumns provide this). Multiple rounds amplify both.

Scheme
Neighbors

Foundations (Wikipedia)