AES Modes of Operation
How one 16-byte block cipher encrypts messages of any length: padding, ECB, CBC and CTR, what a flipped bit does in each, why a padding error is a signal, and why none of the modes detects a change. Real AES-128 through OpenSSL, with test keys.
Blocks and Chaining
Padding to whole blocks, ECB with its repeats, and CBC with its chain and its IV.
- One Block at a Time
why a 20-byte message becomes 32 bytes
- ECB Shows the Pattern
equal blocks in, equal blocks out
- CBC Chains the Blocks
the chain from the IV through every block
- The IV Must Not Repeat
what a repeated IV gives away
Streams and Failures
CTR as a keystream, what a flipped bit does, padding errors, and the lack of authentication.
- CTR Turns AES Into a Keystream
counter blocks make a keystream, with no padding
- A CBC Bit Flip Garbles a Block
one flipped bit changes two plaintext blocks in different ways
- Padding Errors Leak Information
whether the padding is valid is itself information
- Modes Do Not Authenticate
no mode notices a change; each spreads it differently