Home/Tools/Security/Cryptographic Mode Visualizer

Cryptographic Mode Visualizer

Visualize the difference between ECB and CBC encryption modes with pixel-level demonstrations using the Canvas API. Upload images or use built-in test patterns to see why ECB mode leaks information. Compare ECB, CBC, CFB, OFB, CTR, and GCM modes.

Loading Cryptographic Mode Visualizer...
Loading interactive tool...

Need Professional Security Testing?

Our penetration testers find vulnerabilities before attackers do. Get a comprehensive security assessment.

What Is a Cryptographic Mode of Operation

A cryptographic mode of operation defines how a block cipher (like AES) processes data larger than a single block. Since AES encrypts exactly 128 bits at a time, a mode of operation specifies how to handle messages of arbitrary length — how blocks relate to each other, whether encryption can be parallelized, and whether the mode provides authentication in addition to confidentiality.

Choosing the right mode is as important as choosing the right cipher. A strong cipher like AES can be rendered insecure by a poorly chosen mode, and the wrong mode can introduce vulnerabilities even when the underlying algorithm is sound.

How Block Cipher Modes Work

All modes take a block cipher, a key, and (usually) an initialization vector (IV) or nonce as inputs. They differ in how they chain blocks together:

ModeFull NameTypeParallel EncryptParallel DecryptAuthentication
ECBElectronic CodebookBlockYesYesNo
CBCCipher Block ChainingBlockNoYesNo
CTRCounterStreamYesYesNo
GCMGalois/Counter ModeStreamYesYesYes (AEAD)
CCMCounter with CBC-MACStreamNoNoYes (AEAD)
CFBCipher FeedbackStreamNoYesNo
OFBOutput FeedbackStreamNoNoNo

AEAD (Authenticated Encryption with Associated Data) modes like GCM and CCM provide both confidentiality and integrity in a single operation, eliminating the need for a separate HMAC.

Visual Differences Between Modes

This tool visualizes how each mode processes plaintext blocks. The key differences to observe:

  • ECB encrypts each block independently — identical plaintext blocks produce identical ciphertext blocks, visibly leaking patterns (the famous "ECB penguin" demonstration)
  • CBC chains each block to the previous ciphertext block via XOR, so identical plaintext blocks produce different ciphertext — but encryption cannot be parallelized
  • CTR converts AES into a stream cipher by encrypting sequential counter values and XORing with plaintext — fully parallelizable in both directions
  • GCM extends CTR with a Galois field multiplication step that authenticates both the ciphertext and any additional unencrypted data (like packet headers)

Common Use Cases

  • Learning cryptography: Visualize why ECB mode leaks information and why CBC/CTR/GCM modes do not
  • Security architecture decisions: Choose the right mode based on performance requirements, parallelization needs, and whether authentication is required
  • Code review: Verify that application code uses appropriate modes — flag ECB usage as a critical vulnerability
  • Compliance documentation: Explain to auditors why your implementation uses GCM over CBC and reference NIST SP 800-38D

Best Practices

  1. Default to AES-GCM — For most applications, GCM provides the best combination of performance, parallelism, and built-in authentication.
  2. Never use ECB for structured data — ECB is only safe for encrypting single blocks (like individual keys). For any multi-block data, it leaks patterns.
  3. Never reuse nonces in GCM — GCM nonce reuse is catastrophic: it reveals the authentication key and enables plaintext recovery. Use a counter or random 96-bit nonce with collision probability tracking.
  4. Use CTR+HMAC if GCM is unavailable — Encrypt-then-MAC using CTR mode and HMAC-SHA256 provides equivalent security to GCM when AEAD is not available in your library.
  5. Understand IV requirements — CBC requires unpredictable IVs (use CSPRNG). CTR/GCM require unique nonces (counters are fine). Mixing these requirements causes vulnerabilities.

Frequently Asked Questions

Common questions about the Cryptographic Mode Visualizer

ECB (Electronic Codebook) encrypts each block independently with the same key. Identical plaintext blocks produce identical ciphertext blocks, revealing patterns in the original data. The classic "ECB penguin" demonstration shows that an encrypted image in ECB mode still reveals the shape of the original image.

ℹ️ Disclaimer

This tool is provided for informational and educational purposes only. All processing happens entirely in your browser - no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results. Use at your own discretion.