SAM AV2 ChangeKeyEntry error 0x6982

Forum / MIFARE general topics and applications / SAM AV2 ChangeKeyEntry error 0x6982

  • 22. March 2018 at 19:34
    I’ trying load new AES-128 keys into a SAM AV2 (not converted to AV2 mode) and I get some problems with the ChangeKeyEntry command.
    The AuthenticationHost command is executed successfully using a AES-128 key and a session key is generated. The Authentication is done using the KeyChangeNo required to change the requested key.

    The problem occurs in the ChangeKeyEntry command that always returns 0x6982. I think that the problem is the CRC32… I’m not sure which data must be used to calculate the CRC32.

    Can you indicate which data must be used to calculate the CRC32?
    Where I can found a sample of the CRC32 algorithm used by SAM AV2 (SAM not converted to AV2 mode)?

    Below you can find a sample of my CRC32:
    KeyNo: 0x01
    ProMask: 0xff
    KeyEntryData: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF2001000102
    CRC32: 0x37c54191

    + 0  |  - 0

    Re: SAM AV2 ChangeKeyEntry error 0x6982

    23. March 2018 at 10:21
    Hi Hugo,

    Your CRC32 calculation is correct! I get the same result.

    Please note: you must successfully authenticate to the key entry before you can change the key! This is a protection mechanism to prevent unintended changing of keys. Take in mind: you cannot readout key values.

    The TapLinx team
    + 0  |  - 0

    Re: SAM AV2 ChangeKeyEntry error 0x6982

    23. March 2018 at 11:31
    I do an authentication with the key required to change this keyentry. I believe that the authentication is performed correctly.
    Below you can find the steps executed. Can you verify if the steps are correct?

    Thanks in advance.

    AutheticationHost AES-128
    Key : 6E40CAFEC6AB18BCB41FFA3F379ACDF6
    KeyNo : 0x00
    KeyVer : 0x00

    CAPDU (8): 80A4000002000000
    RAPDU (18): 8573385F5644106B3985FF45EA110B9590AF

    Random B ENC (16): 8573385F5644106B3985FF45EA110B95
    Random B (16): 272C63E00A540A04F46F60B36AC2EA8A
    Random B' (16): 2C63E00A540A04F46F60B36AC2EA8A27
    Random A (16): C94F85B6F8ABA21424A044A8FA36347F
    Random AB' (32): C94F85B6F8ABA21424A044A8FA36347F2C63E00A540A04F46F60B36AC2EA8A27
    Random AB' ENC (32): E9D492D45A4751DB452EE7536DCD0A466DCC004FB8EADAA86F0AB7FFF75144DC

    CAPDU (38): 80A4000020E9D492D45A4751DB452EE7536DCD0A466DCC004FB8EADAA86F0AB7FFF75144DC00
    RAPDU (18): AB6F8E07EC73588845C5133420B959BD9000

    Random A' ENC (16): AB6F8E07EC73588845C5133420B959BD
    Random A' (16): 4F85B6F8ABA21424A044A8FA36347FC9
    Random A' INT (16): 4F85B6F8ABA21424A044A8FA36347FC9 (calculated internally based on Random A)
    Session Key AES (16): C94F85B6272C63E0FA36347F6AC2EA8A
    Session IV (16): 00000000000000000000000000000000
    AuthenticateHostAES_AV1 OK

    KeyNo : 0x01
    ProMask : 0xFF
    Current CEKeyNo : 0x00
    Current CEKeyV : 0x00

    DataToCRC32 (60): 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF2001000102
    CRC32 value (4) : 37C54191
    DataToEncrypt (64): 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF200100010237C54191
    CipheredData (64): 2CE7A49BDEACCCB2D54E3BC9A1529BA019BB2376BE663757D651758E9BF85CDAABB9D6B7EB83D01C68DDD3C8A8602DF47EA022B6CF1B5E9708C6C4841A15F0B7

    CAPDU (69): 80C101FF402CE7A49BDEACCCB2D54E3BC9A1529BA019BB2376BE663757D651758E9BF85CDAABB9D6B7EB83D01C68DDD3C8A8602DF47EA022B6CF1B5E9708C6C4841A15F0B7
    RAPDU (2): 6982

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

You must be logged in to reply to this topic.