Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Block ciphers like AES can only encrypt fixed-size chunks of data—typically 128 bits at a time. But real-world data doesn't come in neat 128-bit packages, and encrypting each block the same way creates dangerous patterns. Modes of operation solve this problem by defining how blocks relate to each other, how initialization vectors are used, and whether the mode provides authentication alongside confidentiality. Understanding these modes means understanding the tradeoffs between security, performance, and functionality that cryptographers navigate constantly.
You're being tested on more than just definitions here. Exam questions will ask you to identify which mode is appropriate for a given scenario, explain why certain modes are vulnerable to specific attacks, and compare modes based on properties like parallelizability, error propagation, and authentication. Don't just memorize the acronyms—know what security properties each mode provides and what happens when those properties are violated.
Some modes encrypt data without introducing randomness between blocks. This creates predictable relationships between plaintext and ciphertext—a fundamental weakness that attackers can exploit.
Compare: ECB vs. CBC—both process discrete blocks, but CBC chains blocks together while ECB treats each independently. If an exam question shows you the "ECB penguin" image (encrypted bitmap that still shows the penguin outline), you're seeing pattern leakage in action.
These modes create dependencies between blocks, ensuring that identical plaintext blocks encrypt differently based on their position. The tradeoff is that chaining breaks parallelization.
Compare: CFB vs. OFB—both create stream ciphers from block ciphers, but CFB feeds back ciphertext while OFB feeds back cipher output. OFB's independence from plaintext means errors don't propagate, but it also means IV reuse completely breaks security.
Counter modes achieve the holy grail: they're parallelizable and secure. Instead of chaining blocks, they encrypt unique counter values and XOR the results with plaintext.
Compare: CTR vs. CBC—CTR is parallelizable and supports random access; CBC is sequential but was historically more trusted. Modern systems increasingly favor CTR-based modes, but CTR alone lacks integrity protection.
Modern cryptography demands more than secrecy—you need to detect tampering. Authenticated encryption (AE) modes combine encryption with a message authentication code (MAC), ensuring both confidentiality and integrity in a single pass.
Compare: GCM vs. CTR—GCM is essentially CTR plus authentication. If an FRQ asks about protecting data integrity and confidentiality, GCM (or another AEAD mode) is your answer, not plain CTR.
Disk encryption presents unique challenges: you need random access to sectors, can't expand data size, and must handle partial blocks. Specialized modes address these constraints.
Compare: XTS vs. GCM—XTS is optimized for storage (same-size output, tweakable), while GCM is optimized for network protocols (authentication, streaming). Don't recommend GCM for disk encryption or XTS for TLS.
| Concept | Best Examples |
|---|---|
| Deterministic encryption (avoid) | ECB |
| Block chaining for diffusion | CBC |
| Stream cipher from block cipher | CFB, OFB, CTR |
| Parallel encryption | ECB, CTR, GCM, XTS |
| Parallel decryption | ECB, CBC, CTR, GCM, XTS |
| Authenticated encryption | GCM |
| Disk/storage encryption | XTS |
| No error propagation | OFB, CTR |
| IV/nonce reuse is catastrophic | All modes (especially OFB, CTR, GCM) |
Which two modes convert a block cipher into a stream cipher but differ in how they generate the keystream? What security implication does this difference create?
An attacker intercepts CBC-encrypted traffic and notices the IV is a simple counter. What attack does this enable, and why doesn't the same vulnerability apply to CTR mode's counter?
Compare GCM and CTR: what additional security property does GCM provide, and what cryptographic mechanism enables it?
You're designing encryption for a database that requires random access to individual records. Which modes would support this requirement, and which would not? Explain why.
A developer proposes using XTS-AES for encrypting network traffic because "it's what BitLocker uses." Explain why this is inappropriate and recommend an alternative with justification.