Advanced

AES Mode Comparison

See, visually, why ECB mode is unsafe — the same repeating pattern in the input stays visible after "encryption", while CBC and GCM hide it completely.

This demo repeats a simple striped pattern across a block of data, encrypts it with real AES-128 in each mode using the same key, and displays the encrypted bytes as pixels.

About this tool

ECB encrypts each block independently, so identical input blocks always produce identical output blocks — patterns in the plaintext remain visible. Browsers deliberately don't offer ECB through Web Crypto, because it's unsafe, but it can be built exactly from what they do offer: encrypting a single block with CBC and an all-zero IV gives AES(block XOR 0), which is precisely ECB's per-block encryption. So the ECB picture is real AES-ECB output, not a simulation. Each 16-byte block of the data is drawn as one pixel, coloured by its first three bytes, so identical blocks show up as identical colours. CBC chains each block with the previous one's ciphertext, and GCM (used by the site's own AES tool) additionally authenticates the data — both destroy the visible pattern entirely.