Lion Cipher Lab

Forge an AES-GCM tag by reusing a nonce (the forbidden attack)

Why it matters

AES-GCM is the default authenticated cipher of the modern internet -- TLS, VPNs, disk and message encryption all lean on it. It is fast and safe with one non-negotiable condition: a given key must NEVER encrypt two messages under the same nonce. Break that rule once and an attacker who sees the two ciphertexts can recover the secret authentication subkey and forge tags at will -- total loss of integrity, without ever learning the AES key. Nonce reuse has broken real TLS implementations, and once you have forged a tag by hand you will treat 'never repeat a nonce' as the load-bearing rule it is.

What you'll learn

Steps in this lab

  1. What AES-GCM actually is, in one breath
  2. The one number GCM's security rests on: H = AES_K(0^128)
  3. The forbidden rule: never reuse a (key, nonce) pair
  4. Set up a clean workspace
  5. Lay down the field arithmetic: GF(2^128)
  6. Play the buggy sender: two messages, one nonce
  7. The algebra: why two same-nonce pairs leak H
  8. Forge a tag the library accepts
  9. The fix: never repeat a nonce -- and prove it
  10. The judgment call: which AEAD, and the birthday trap

Open the full interactive lab →