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.
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:
| Mode | Full Name | Type | Parallel Encrypt | Parallel Decrypt | Authentication |
|---|---|---|---|---|---|
| ECB | Electronic Codebook | Block | Yes | Yes | No |
| CBC | Cipher Block Chaining | Block | No | Yes | No |
| CTR | Counter | Stream | Yes | Yes | No |
| GCM | Galois/Counter Mode | Stream | Yes | Yes | Yes (AEAD) |
| CCM | Counter with CBC-MAC | Stream | No | No | Yes (AEAD) |
| CFB | Cipher Feedback | Stream | No | Yes | No |
| OFB | Output Feedback | Stream | No | No | No |
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
- Default to AES-GCM — For most applications, GCM provides the best combination of performance, parallelism, and built-in authentication.
- 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.
- 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.
- 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.
- 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.
Explore More Tools
Continue with these related tools
AES Encryption Tool
Encrypt and decrypt text using AES encryption
Free Hash Generator - MD5, SHA256, bcrypt & More
Free online hash calculator with malware checking. Generate MD5, SHA-256, SHA-512, SHA-3, bcrypt & more. Batch file hashing, threat intelligence integration (VirusTotal, MalwareBazaar), hash history tracking. Instant results, no signup.
Entropy Analyzer
Free Shannon entropy calculator for malware analysis. Detect packed, encrypted, or obfuscated binaries with entropy visualization, byte distribution analysis, and section-by-section scanning.
ℹ️ 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.