CTR Mode & Stream-Cipher Behavior
Use counter mode to turn a block cipher into a keystream generator.
Welcome
Counter (CTR) mode transforms any block cipher into a stream cipher. It is parallelizable, requires no padding, and is the basis for AES-GCM. Let's master it.
CTR Mode Concept
Generate a keystream by encrypting successive counter values:
Keystream[i] = AES(K, Nonce || Counter_i)
Ciphertext = Plaintext XOR Keystream
The counter increments for each block. Decryption is identical to encryption.
All lessons in this course
- Block Cipher Fundamentals & Padding
- ECB vs CBC: Patterns & IVs
- CTR Mode & Stream-Cipher Behavior
- GCM & Authenticated Encryption