Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I get a request from a client who encrypts the message with the wrong AES key. Is there a way for me to know what AES key the client actually used? I understand I may get the decrypted msg which is likely to be wrong, but from what I understand, the key itself cannot be retrieved from the request sent by the client.

In other words, is there a way for me to do something like this -

if (client.aeskey != server.aeskey), print Error.

Please confirm if my understanding is correct.

share|improve this question
AES is just a block cipher. That's a very low level primitive. The verification you are asking about belongs at a much higher level in the protocol design. This is concerning because it sounds like you don't know about the layers which would go in between. –  kasperd Jun 15 at 16:40

1 Answer 1

It is suspicious that the client have send to the server something with a different key than the symmetric one they had agree before, isn't it?

A way how one side could known that the other has used a different key is when the decrypted message doesn't have sense (like doesn't pass a validation system you prepare).

Your server can detect if the key it has, works, but it is cryptanalysis to request which unknown key was used.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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