News for hackers. Stuff that matters.
Re:AES-GCM and breaking it on nonce reuse by bux93 on Wednesday June 12, 2024 @03:40AM (#40655566)
I dunno, nonce means number-used-once, it should be kinda obvious that it should be used only once?
Re:AES-GCM and breaking it on nonce reuse by frereit on Wednesday June 12, 2024 @05:30AM (#40656193)
Correct. However, some implementations actually incorrectly refer to the nonce as an "IV" (initialization vector), where it's not so obvious.

Also, it's not entirely clear just how bad a reuse actually is. For example, in AES-CBC, reusing the IV has much less impact than reusing the nonce with AES-GCM.

Re:AES-GCM and breaking it on nonce reuse by kbolino on Wednesday June 12, 2024 @09:08AM (#40657710)
NIST calls it an IV (or at least did when it came out).
Re:AES-GCM and breaking it on nonce reuse by Retr0id on Wednesday June 12, 2024 @06:40AM (#40656562)
And yet...

Aside from just not understanding it, it's plausible that someone would generate nonces weakly, say, from a weak source of randomness.

Even using a strong source of randomness for an AES-GCM nonce is weak over enough messages, since it only gets you 48 bits of collision resistance.

If you're not using random nonces, maybe you want to use a counter, and then you have to worry about race conditions, state resets, etc. (if your system lost power immediately after using nonce n, would it boot back up and reuse it?)

Re:AES-GCM and breaking it on nonce reuse by stouset on Wednesday June 12, 2024 @11:00AM (#40658915)
> Aside from just not understanding it, it's plausible that someone would generate nonces weakly, say, from a weak source of randomness.

This is actually generally fine for nonces (used in CTR and GCM modes, and in ChaCha20). Typically the only requirement for a nonce is that it is only used once. It is even safe to use a simple incrementing counter.

IVs, on the other hand, are required to be cryptographically random.

Re:AES-GCM and breaking it on nonce reuse by Retr0id on Wednesday June 12, 2024 @11:33AM (#40659245)
My point is that a random AES-GCM nonce is a problem because you will end up re-using nonces by chance, assuming multiple messages are being encrypted with the same key. Due to the small nonce size, this is still a problem even with secure randomness, it's just even more of a problem with weak randomness.
Re:AES-GCM and breaking it on nonce reuse by stouset on Wednesday June 12, 2024 @12:19PM (#40659819)
Whoops, sorry. Slept poorly last night and missed this. You're 100% right, GCM doesn't have enough bits in the nonce to safely generate them randomly for any case where keys are reused significantly.
Re:AES-GCM and breaking it on nonce reuse by formerly_proven on Wednesday June 12, 2024 @07:36AM (#40656892)
The consequences that using the number used once twice entail differ wildly between cryptosystems though.
Re:AES-GCM and breaking it on nonce reuse by davidczech on Wednesday June 12, 2024 @01:54PM (#40660957)
I've seen the problem surface in designs where a single key is shared across many devices.
Re:AES-GCM and breaking it on nonce reuse by hifromwork on Thursday June 13, 2024 @12:50PM (#40671907)
Also depending on the cryptosystem, nonce requirements vary wildly. For example using 1, 2, 3, 4... as a nonce for CTR is a recipe for disaster, but it's fine for many asymmetric ciphers.