Forum / MIFARE general topics and applications / DesfireEV1 Change the Default DES Key (all 0's) to AES
Tagged: Mifare Desfire EV1
-
everything is working on my side ,
i have one problem in changing the Default PICC Master Key from DES to AES (iam
stuck at this point from 5 days!!),, below is my logs : please take a look and let
me know what iam doing wrong
CMD=0A00
Res = AF5039C16807AB67FE
RNDB=9B9E37C66B060449
RNDA=9B2B0E915D85DF96
DesSessionKey= 9B2B0E919B9E37C69B2B0E919B9E37C6
ChangeKey:
CMD=C4
KEYNO= 80 (Aes)
NewKey=00000000000000000000000000000000
CRC16=C8B6
Data To Decrypt=00000000000000000000000000000000C8B6000000000000
Decrypted Dta = 90133EAF84AA8BC5D9EEBA4BDD20CE93C97026E54C44738C
CMD=C48090133EAF84AA8BC5D9EEBA4BDD20CE93C97026E
RES= 1E !!
Please Advise
+ 0 | - 0
Dear User,
What I can see here is that you forget to include the KeyVersion into the data preparation before encryption. When updating a key from 2K3DES or 3K3DES to AES, the 16 bytes long key needs to be concatenated with the key version (which I guess is 00 in your case), the CRC16, and filled up with padding in order to reach a multiple of the blocksize.
The data to encrypt would look like this = 0000000000000000000000000000000000 C8B60000000000, so one more bytes of zeros needs to be added before the CRC16 and the padding.
Afterwards you need to encrypt it and send the command Cmd = C4 || encrypted data.
I hope with including the key version it is working for you.
Best regards,
Sandra
+ 0 | - 0
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.