Interactive cryptographic mode visualizer. See why ECB mode is insecure with pixel-level encryption demos. Compare CBC, CFB, OFB, CTR, and GCM modes.
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.
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.
This tool visualizes how each mode processes plaintext blocks. The key differences to observe:
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.
CBC (Cipher Block Chaining) XORs each plaintext block with the previous ciphertext block before encryption. This means identical plaintext blocks produce different ciphertext blocks, hiding patterns. An Initialization Vector (IV) is used for the first block. Changing the IV produces completely different ciphertext for the same plaintext.
ECB encrypts blocks independently (insecure). CBC chains blocks together. CFB converts a block cipher into a stream cipher. OFB generates a keystream independent of plaintext. CTR uses a counter for parallelizable encryption. GCM adds authentication to CTR mode for authenticated encryption. Each has different performance and security tradeoffs.
For most applications, use GCM (Galois/Counter Mode) as it provides both confidentiality and authentication with good performance. Use CBC when GCM is not available. Never use ECB for anything beyond single-block encryption. CTR is good for parallelized encryption. This is covered in CISSP Domain 3.
An IV is a random or unique value used with the encryption key to ensure that the same plaintext encrypts to different ciphertext each time. IVs must be unpredictable (CBC) or unique (CTR/GCM) but do not need to be secret. Reusing IVs with the same key can compromise security, especially in CTR and GCM modes.
Encrypt and decrypt text using AES encryption
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from text or files. HMAC support, multiple output formats, 100% client-side.
Free Shannon entropy calculator for malware analysis. Detect packed, encrypted, or obfuscated binaries with entropy visualization, byte distribution analysis, and section-by-section scanning.