Home▸Articles▸Cybersecurity

AES Avalanche Diffusion Map: Bit-Flip Probability by Round

A visualization of how AES encryption's diffusion property ensures that even a single-bit change in plaintext results in significant changes in ciphertext.

mysimulator teamUpdated June 2026≈ 4 min read▶ Open the simulation

What the Avalanche Effect Is

The avalanche effect is a critical property of cryptographic functions that ensures even minor changes in input (plaintext) result in substantial differences in output (ciphertext). This property enhances security by making it extremely difficult for attackers to predict or reverse-engineer the encryption process.

In AES-128, each round of the encryption process transforms the input data in a way that spreads any change throughout the entire block. The avalanche effect is quantified through the bit-flip probability, which measures how likely a single-bit difference in plaintext will result in a specific bit being flipped in ciphertext.

Why It Happens

The avalanche effect in AES-128 is achieved through a series of non-linear transformations and mixing operations. Each round involves substitution, permutation, and key addition steps that are designed to ensure that any change in the input data cascades throughout the entire block.

This property is mathematically formalized by the strict avalanche criterion (SAC), which states that flipping any single bit in the plaintext should result in a 50% probability of flipping each corresponding bit in the ciphertext. The Monte-Carlo simulations in this map help visualize how closely AES-128 adheres to this criterion.

live demo · related simulation● LIVE

How It Is Measured

The bit-flip probability is measured by running multiple encryption trials with different plaintext pairs, each differing by a single bit. By observing the resulting ciphertext differences, one can calculate the probability that any given bit in the ciphertext has flipped compared to its counterpart in the original ciphertext.

In this simulation, thousands of independent AES-128 trials are run, and the results are aggregated into a 128-bit x 11-round heatmap. This heatmap shows how the bit-flip probabilities evolve over the rounds, converging towards the ideal avalanche behavior as more data is accumulated.

Why It Matters

The avalanche effect ensures that small changes in plaintext do not result in easily detectable differences in ciphertext. This property is crucial for maintaining the security of encrypted communications and data storage, making it difficult for attackers to exploit patterns or predict encryption outcomes.

By verifying that AES-128 meets the strict avalanche criterion through these simulations, we can have confidence in its robustness against various cryptographic attacks.

Frequently asked questions

What is the strict avalanche criterion (SAC)?

The strict avalanche criterion states that flipping any single bit of the input should result in a 50% probability of flipping each corresponding bit in the output. It ensures that small changes in plaintext lead to significant and unpredictable changes in ciphertext.

Why is the avalanche effect important for encryption?

The avalanche effect ensures that even minor changes in input data result in substantial differences in output, making it difficult for attackers to predict or reverse-engineer the encryption process. This property enhances security by providing strong resistance against various cryptographic attacks.

How does AES-128 ensure the avalanche effect?

AES-128 ensures the avalanche effect through a series of non-linear transformations and mixing operations in each round, including substitution boxes (S-boxes), permutation steps, and key addition. These operations are designed to spread any change throughout the entire block.

What does the heatmap in the simulation represent?

The heatmap represents the bit-flip probability across different rounds of AES-128 encryption. Each cell in the 128-bit x 11-round grid shows the likelihood that a specific bit has flipped, allowing us to visualize how closely the encryption process adheres to the strict avalanche criterion.

Try it live

Everything above runs in your browser — open AES Avalanche Diffusion Map: Bit-Flip Probability by Round and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open AES Avalanche Diffusion Map: Bit-Flip Probability by Round simulation

What did you find?

Add reproduction steps (optional)