A service encrypts records with AES-128-GCM under a static key and uses a message counter as the nonce. After a restart the counter resets to zero, so stored records now share nonces. What is the BEST remediation?
Show the answer
Correct answerD. Guarantee a unique nonce per message under each key
AWhy not this: A fixed IV in CBC repeats the same weakness, leaking matching plaintext prefixes, and loses GCM's authentication.
BWhy not this: A 256-bit key is no stronger against nonce reuse, because the keystream repeats whatever the key length.
CWhy not this: A plaintext hash adds no protection against keystream reuse and can itself reveal whether plaintexts match.
DWhy this is right: Unique nonces per key restore GCM's confidentiality and authentication guarantees, which nonce reuse breaks.
GCM is only secure if each nonce is used once per key. Reusing one leaks the XOR of plaintexts and lets attackers forge tags, so nonces must be unique, for example a persisted counter or a key rotated at restart. A longer key does not help, because the flaw is in how the mode is used, not in key strength.