I'm basing code on: https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption#Authenticated_Encryption_using_GCM_mode

If I send the same plaintext twice, encrypting each with a different key and IV, am I compromising the strength of the encryption?

(Eve would have access to the two ciphertexts of each message, and would know that they were encryptions of the same plaintext. Eve would not know the keys or IVs used.)


1 Answer 1


No, it would not compromise the strength of the encryption (assuming that you didn't use a key that the attacker could guess).

We can take it much further; you could give the attacker a billion encrypted messages, all being encryptions of the same plaintext. It wouldn't matter if you told the attacker what IVs you used (or AADs, should you decide to use them), or if you used the same keys or different ones. As long as:

  • You didn't pick a key that the attacker could guess; for example, you picked the keys randomly

  • You didn't reuse a (key, IV) pair (which in this specific case would matter if the two messages had different AADs, but it's always a good thing to remember when you're using GCM)

Then the security of the system is not weakened; the attacker would have no information (other than length) of the encrypted message, nor could he generate (with nontrivial probability) another encrypted message that would be accepted by the decryption process.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.