the problem with ChangeKey at DesFire EV1

Forum / MIFARE SmartCard IC`s / MIFARE DESFire / the problem with ChangeKey at DesFire EV1

  • 12. October 2016 at 5:55
    Hi all,

    I'm leaning Desfire EV1, now I have a problem with the ChangeKey. Please help me to solve this problem!
    My English is not good,I will try my best to explain the problem.
    there is the detail:

    Authenticate : (with key number 0x00)

    >0A 00
    AF 49 1E 89 0D E9 AC E9 32 9C 5C 6D 55 D9 FA 36 D7
    54 CB 64 3F D0 30 E6 87 DA
    c4 00 ce 27 61 0e 8c 09 01 39 df 05 52 4a d9 6f 76 b1 9a 18 52 e9 12 68 12 e3
    <1E

    I get the error 0x1E...
    don't know where it went wrong.Please Help me to solve this problem.
    Thanks!
    + 0  |  - 0

    Re: the problem with ChangeKey at DesFire EV1

    12. October 2016 at 6:01
    oh God,I wrote a lot of content has disappeared.
    here is my detail completly:

    Authenticate : (with key number 0x00)

    to PICC :0A 00
    from PICC:AF 63 C5 4D CF 6F 3A 6F C9
    to PICC :AF 49 1E 89 0D E9 AC E9 32 9C 5C 6D 55 D9 FA 36 D7
    from PICC:00 B7 D1 DA 7C E0 DD 98 6B

    I'm success in Authenticate, and get SessionKey 00 01 02 03 f6 b0 33 39(for easy to read the Key I set the RndA = 00 01 02 03 04 05 06 07).

    next I send the ChangeKetSettings, set the keySetting to 0x0f. I get the CRC of 0x0f is 0x09,0xa9, so my SendData is 0f 09 a9 00 00 00 00 00
    then i do DECRYPT with SendData , the result is cb 64 3f d0 30 e6 87 da

    to PICC :54 CB 64 3F D0 30 E6 87 DA
    from PICC:00

    success! so is My Des code and CRC code are Correct ?

    next i send the ChangeKey, I want to change the key 00 (master key), and I Authenticated with key 00 successful, so according to the document I need to send 16Byte New Key + 2Byte CRC + 6Byte 0x00
    New Key = 11 22 33 44 55 66 77 88 11 22 33 44 55 66 77 88
    Get the CRC = F 02
    so SendData = 11 22 33 44 55 66 77 88 11 22 33 44 55 66 77 88 BF 02 00 00 00 00 00 00
    then i do DECRYPT with SendData , the result = ce 27 61 0e 8c 09 01 39 df 05 52 4a d9 6f 76 b1 9a 18 52 e9 12 68 12 e3

    to PICC :c4 00 ce 27 61 0e 8c 09 01 39 df 05 52 4a d9 6f 76 b1 9a 18 52 e9 12 68 12 e3
    from PICC:1E

    + 0  |  - 0

    Re: the problem with ChangeKey at DesFire EV1

    4. November 2016 at 9:52
    I found my fault,My CBC mode are wrong.
    + 0  |  - 0

    Re: the problem with ChangeKey at DesFire EV1

    29. November 2016 at 16:01
    Hi,

    Im tryng to change the key of picc level for DES to AES but I cant the card alwasy response me with 0x1E. Can you give me more information about the secuencial steps to follow in this case.

    writing my log below.

    Forgive but I have been wrong with some dates, so I rewrite a new log:

    Current DES key: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00.

    New AES key: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00.

    Session key: 0x00, 0x00, 0x00, 0x00, 0x74, 0x92, 0xaf, 0xb0.

    CRC16 :0x1B, 0x5B.
    the CRC16 is calculated over: 0xC4, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01.

    finally (before encrypted to send): 0xC4, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1B, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x00.

    finally (encrypted to send): 0xC4, 0x80, 0x39, 0x2A, 0xE1, 0xF2, 0x27, 0xB9, 0xD8, 0xA8, 0x58, 0x24, 0x79, 0x63, 0x49, 0x66, 0xB4, 0x1B, 0x1B, 0x1F, 0x1E, 0x64, 0xEB, 0x8F, 0x7F, 0xB6.

    thanks and regards.
    + 0  |  - 0

    Re: the problem with ChangeKey at DesFire EV1

    17. July 2019 at 18:27
    please let me know what is the CBC mode
    + 0  |  - 0
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.