My server and my smartcard (MIFARE DESFire) want to establish that they have the same shared AES key. They want to do that with an untrusted client in the middle.
Usually it works like this:
Now this requires that I store RndA on the server between Generate RndA
and Decrypt and compare RndA' with Rotate(RndA)
.
My question is: Instead of storing RndA on the server, can I safely use the same AES key to encrypt RndA and pass it on to the client for storing?
The sequence becomes:
I feel uneasy about providing the Client with both AES(RndA || RndB')
and AES(RndA)
, but I'm not sure if that is justified.
If that is unsafe, what about the alternatives? Encrypt RndA with a fixed key shared among all smartcards? Or store one more key per smartcard to encrypt RndA?