Block Cipher Modes: ECB vs CBC
Encrypt a grid of plaintext blocks under ECB and CBC modes with a toy block cipher and watch identical plaintext blocks leak a visible pattern under ECB while chaining under CBC hides it completely.
Cryptography basics usually stop at "encrypt the message," but a block cipher only ever encrypts one fixed-size block, and how those blocks are chained together — the mode of operation — matters as much as the cipher itself. This simulator arranges a grid of plaintext blocks in 3D and encrypts every block with the same toy keyed cipher under two real modes: Electronic Codebook (ECB), which encrypts each block independently, and Cipher Block Chaining (CBC), which XORs each block with the previous ciphertext block before encrypting. Switch between a flat background pattern and a "background + subject" layout to reproduce the classic ECB failure — identical plaintext blocks always produce identical ciphertext, so structure leaks straight through — while CBC's chaining scrambles the same data into something with no visible repetition, and live readouts count exactly how many ciphertext blocks collide under each mode.
Encrypt a grid of plaintext blocks under ECB and CBC modes with a toy block cipher and watch identical plaintext blocks leak a visible pattern under ECB while CBC's chaining hides it completely.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install