GCM Nonce Reuse is a catastrophic cryptographic failure where the same nonce (number used once) is used twice with the same key in AES-GCM encryption. This completely breaks both confidentiality and authentication guarantees.
AES-GCM generates a keystream by encrypting counter values. If the same nonce is reused, the same keystream is generated. XORing two ciphertexts with the same keystream reveals the XOR of the plaintexts.
// Two messages encrypted with same key and nonce:
C1 = P1 XOR Keystream
C2 = P2 XOR Keystream
// XORing ciphertexts:
C1 XOR C2 = P1 XOR P2
// If P1 is known (or guessable):
P2 = C1 XOR C2 XOR P1
// Also: authentication tags can be forged!
// Common mistake: random nonce generation
nonce = random_bytes(12)
// Problem: With 96-bit nonce, birthday collision
// ~2^48 messages = 50% chance of collision
// At scale, this happens!
// Worse: Counter starting at 0 each session
nonce = 0 // Reused every restart!
With two messages using the same nonce, the authentication key (H) can be recovered through polynomial math, allowing forgery of authentication tags for arbitrary messages.