This simulator runs two 16-byte (4×4) blocks through the same simplified substitution-permutation network (SPN) round function — one holding the original input, the other with a single input bit flipped. Watch both grids evolve side by side through S-box substitution, byte permutation and round-key XOR.
Each round applies three steps: SubBytes looks up every byte in a fixed non-linear substitution table (S-box); Permute scatters the 16 bytes to new grid positions (a P-box); AddRoundKey XORs the block with that round's key. Flipping a single input bit changes one byte before round 1 — but after a few rounds the two blocks look almost completely unrelated. That's the avalanche effect: a well-designed cipher should flip roughly half the output bits from a one-bit input change.
Set the round count, choose which input bit gets flipped in the second block, adjust animation speed, and watch the live diffusion percentage — the share of output bits that differ between the two blocks — climb toward 50% as rounds accumulate.
Real AES needs only 4-5 rounds before a single flipped input bit statistically scrambles about half of the output bits — full AES-128 uses 10 rounds specifically to leave a wide security margin beyond the point where diffusion is already complete.
Two 4×4 byte blocks — one holding the original input, one with a single input bit flipped — run through identical rounds of a simplified AES-like substitution-permutation network (SPN). Watch S-box substitution, byte permutation and round-key XOR scramble both blocks, and see how quickly they become statistically unrelated.
Modern symmetric ciphers like AES protect data by repeating a simple round function — substitution (S-box), permutation (P-box), and key mixing (XOR) — enough times that a single flipped input bit statistically flips about half of the output bits. This simulator runs that round function on two nearly-identical blocks side by side and tracks the live "diffusion" percentage: the share of output bits that differ between them. That climb toward 50% is the avalanche effect, and it is what makes brute-force pattern analysis of a symmetric cipher's ciphertext hopeless after only a handful of rounds.
Set the round count (1–8) to see how quickly diffusion saturates, choose which of the 8 bits in the first byte gets flipped in the second block, and adjust playback speed. Press "New block & key" to randomize the demonstration, or drag to orbit and scroll to zoom the two grids.
The strict avalanche criterion — every output bit should flip with roughly 50% probability whenever one input bit flips — is a formal design goal cipher designers test their S-boxes and P-boxes against; a symmetric cipher that fails this test leaks structure an attacker can exploit statistically, no brute-force key search required.