Skip to main content
Presentation 13 of 16

Message authentication

MAC · HMAC and authenticated encryption

Slides: 24 PDF · 1007 KB
Loading slides…

Keyboard: Left arrow Right arrow Slides; F — fullscreen

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

  1. The problem: encryption does not give integrity
  2. Bit-flipping attack in CTR mode
  3. MAC: concept and security definition
  4. MAC versus digital signature
  5. The danger of H(k ‖ m): length extension
  6. HMAC construction and RFC 2104
  7. CMAC and encryption + MAC combinations
  8. AEAD: AES-GCM and ChaCha20-Poly1305
  9. Nonce reuse and timing attacks
  10. Python practice and conclusions
Related lesson Message Authentication Codes (HMAC) & Integrity