Crib Dragging: Why You Shouldn’t Ever Reuse a Nonce With the Same Key in AES-GCM?

A nonce is a kind of word or expression you only use once.

Photo by Markus Spiske on Unsplash

Hermione’s stolen treasure

How in the world that happened?

Counter (CTR) mode encryption

IKM = Intermediate Key Material

Counter (CTR) mode decryption

What’s wrong with reusing a nonce?

P1 = Dear Harry, I’ve found a goblin secret. meet me at the library.P2 = My Love ron, I’ve found a goblin secret. meet me at the library.
C1 = P1 ⊕ IKM
C2 = P1 ⊕ IKM
C1 ⊕ C2 = (P1 ⊕ IKM) ⊕ (P2 ⊕ IKM) = (P1 ⊕ P2) ⊕ (IKM ⊕ IKM) = (P1 ⊕ P2)
Crib = Dear
C1 ⊕ C2 = P1 ⊕ P2
leaked_message = C1 ⊕ C2 ⊕ Crib = My l
Dear Harry.............
⊕ My love................
⊕ Dear
-----------------
My l
Crib = My love
C1 ⊕ C2 = P1 ⊕ P2
leaked_message = C1 ⊕ C2 ⊕ Crib
Dear Harry.............
⊕ My love................
⊕ My love
-----------------
Dear Ha
IKM = (C1 ⊕ P1)

Now you know

Software Engineer | Food Enthusiast | Cook not a Chef | Guitar Player & Music Lover