DesfireEV1 Change the Default DES Key (all 0's) to AES

Forum / MIFARE general topics and applications / DesfireEV1 Change the Default DES Key (all 0's) to AES

  • 2. August 2016 at 19:38
    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
    Res = AF5039C16807AB67FE
    DesSessionKey= 9B2B0E919B9E37C69B2B0E919B9E37C6



    KEYNO= 80 (Aes)



    Data To Decrypt=00000000000000000000000000000000C8B6000000000000

    Decrypted Dta = 90133EAF84AA8BC5D9EEBA4BDD20CE93C97026E54C44738C


    RES= 1E !!

    Please Advise
    + 0  |  - 0

    Re: DesfireEV1 Change the Default DES Key (all 0's) to AES

    8. August 2016 at 18:31
    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,

    + 0  |  - 0
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.