← 🔐 Cryptography
Two blocks
Original input
One bit flipped
Byte differs from original

🔐 Avalanche Lab

Operation:
Round:
Diffusion: 0%
Drag — rotate · Scroll — zoom

🔐 Symmetric-Key Avalanche Lab: Substitution-Permutation Networks

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.

🔬 What It Demonstrates

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.

🎮 How to Use

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.

💡 Did You Know?

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.