Message authentication
MAC · HMAC and authenticated encryption
Loading slides…
Open the PDF file
Summary
Encryption gives confidentiality but not integrity or authenticity: in CTR mode, changing one ciphertext byte turns “100 dollars” into “900 dollars”. The lecture covers MAC and its EUF-CMA security definition, the length-extension attack on H(k ‖ m) and its fix HMAC (RFC 2104), CMAC, ways of combining encryption with a MAC (Encrypt-then-MAC), and AEAD (AES-GCM, ChaCha20-Poly1305). The practical part shows nonce reuse, padding oracle and timing attacks, plus HMAC and AES-GCM in Python.
Key terms
MAC
HMAC
EUF-CMA
length extension
CMAC
Encrypt-then-MAC
AEAD
AES-GCM
GHASH
ChaCha20-Poly1305
nonce
padding oracle
Lecture outline
- The problem: encryption does not give integrity
- Bit-flipping attack in CTR mode
- MAC: concept and security definition
- MAC versus digital signature
- The danger of H(k ‖ m): length extension
- HMAC construction and RFC 2104
- CMAC and encryption + MAC combinations
- AEAD: AES-GCM and ChaCha20-Poly1305
- Nonce reuse and timing attacks
- Python practice and conclusions