1 of 12
fgrieu
• 117.3k
• 10
• 253
• 491

If I pass the wrong key will AES (decryption) in GCM mode detect that I am using the wrong key and give me an error message (..) ?

Yes, inasmuch as the implementation gives an error message when the authentication check fails (which is expected from any good implementation).

Argument: from the structure of GCM it can be shown, under a model of AES as a PRP, that the AES-GCM authenticator tag is a PRF of the key and IV; thus that if one changes the key randomly, and nothing else, the probability that the unchanged message (including IV) is accepted is about $$2^{-k}$$, where $$k$$ is the bit size of the authenticator tag; thus negligible.

fgrieu
• 117.3k
• 10
• 253
• 491