Lesson 4.4: Modes, IVs and authenticated encryption
AES on its own encrypts one 16-byte block. How a mode of operation handles longer data, why the same message must never give the same ciphertext (salts, IVs and nonces), why ECB mode leaks patterns, why old ciphers like DES are refused, and why modern systems use authenticated encryption (AES-GCM, ChaCha20-Poly1305) that also detects tampering. In the lab you encrypt the same note twice with and without a salt and compare, watch OpenSSL refuse DES, see why openssl enc doesn't offer GCM, and see the warning for weak key derivation.
17 min
You will learn to
- Explain block ciphers and modes of operation
- Explain salts, IVs and nonces and why reuse is dangerous
- Explain why ECB leaks patterns
- Recognise legacy ciphers
- Explain authenticated encryption (AEAD)
Key terms
- Block cipher
- A cipher that encrypts fixed-size blocks; AES uses 16-byte blocks.
- Mode of operation
- The rule for applying a block cipher to data longer than one block.
- IV and nonce
- An initialisation vector or 'number used once': a value that makes each encryption under the same key different.
- Authenticated encryption (AEAD)
- Encryption that also produces a tag proving the ciphertext wasn't changed; decryption fails on any tampering.
- Legacy cipher
- An algorithm that's broken or too weak for today.
← SQL injection · All lessons · Common attacks: phishing, malware, password attacks, denial of service →