Week 3 · Block ciphers · KL 7.2

AES diffusion

ShiftRows and MixColumns are the diffusion half of AES. One moves bytes across columns, the other mixes within a column. Change a single input byte and step through the round to watch its influence reach the entire 4×4 state in just two rounds.

The avalanche, step by step

The state is the 16-byte AES block written as a 4×4 grid of bytes, column by column. A shaded cell marks a byte whose value would change because of the one flipped input byte. Use Next and Prev, or the arrow keys, to move through the operations.

Where it sits in the SPN

AES is a substitution–permutation network. Each round does three jobs, and the four named operations map onto them: SubBytes is the substitution, ShiftRows and MixColumns together are the permutation and diffusion layer, and AddRoundKey is the key mixing. SubBytes and AddRoundKey act byte-by-byte, so only the two diffusion steps move influence between cells.

Substitution

SubBytes

S-box on each byte, in place.

Permutation

ShiftRows

Row r rotates left by r — moves bytes across columns.

Permutation

MixColumns

Mixes the four bytes within each column over GF(2⁸).

Key mixing

AddRoundKey

XOR the round key into the state.

↑ ShiftRows + MixColumns = the diffusion layer

Ten rounds, and a missing MixColumns

AES-128 repeats this round ten times, after an initial AddRoundKey before the first round. The final round keeps SubBytes, ShiftRows and AddRoundKey but drops MixColumns.

rounds 1–9

The full round

SubBytes → ShiftRows → MixColumns → AddRoundKey.

round 10 · final

No MixColumns

SubBytes → ShiftRows → AddRoundKey.

Two reasons it is dropped. A MixColumns at the very end adds no security, because an attacker can simply invert it before the last AddRoundKey — it mixes nothing they cannot unmix. And omitting it lines encryption and decryption up into the same sequence of layer types, which lets a decryption round reuse the structure of an encryption round.

← back to all demos