MIFARE – Desfire EV2: Authenticate with 6A81 Response

Forum / MIFARE general topics and applications / MIFARE – Desfire EV2: Authenticate with 6A81 Response

Tagged: , ,

  • 29. October 2019 at 16:27
    Hi,

    I am trying to authenticate a block on a MIFARE Desfire EV2 card using C# but I get a result code of 6A81. Any idea what that means?

    Here is the important piece of the code:
               
    byte[] data = new byte[5];
    data[0] = 0x01; //Version: Default to 1 for now
    data[1] = 0x00;
    data[2] = (byte)int.Parse("4"); // Block #4
    data[3] = 0x60;
    data[4] = (byte)int.Parse("1"); // Key #1

    var apdu = new CommandApdu(IsoCase.Case3Short, smartCardReader.Protocol)
    {
    CLA = 0xFF,
    INS = 0x86,
    P1 = 0x00,
    P2 = 0x00,
    Data = data,
    };

    var sendPci = SCardPCI.GetPci(smartCardReader.Protocol);
    var receivePci = new SCardPCI(); // IO returned protocol control information.
    var receiveBuffer = new byte[255];
    var convertedCommand = apdu.ToArray();
    int result = smartCardReader.Transmit(sendPci, convertedCommand, convertedCommand.Length, receivePci, receiveBuffer, receiveBuffer.Length);
    var responseApdu = new ResponseApdu(receiveBuffer, result, IsoCase.Case3Short, smartCardReader.Protocol);



    Any help will be appreciated.

    Regards,
    Jacques
    + 0  |  - 0

    Re: MIFARE – Desfire EV2: Authenticate with 6A81 Response

    30. October 2019 at 10:03
    Hi Jacques,

    Error 6A81 is not a MIFARE DESFire EV2 error code. I assume it comes from the transport layer. In doubt I would check the error on Global Platform specification.

    If you use the PC/SC interface, it is also very important to check the user manual of the reader. Very often you must use so called wrapping commands for a specific card type. Please check this for your reader.

    The TapLinx team

    + 0  |  - 0

    Re: MIFARE – Desfire EV2: Authenticate with 6A81 Response

    6. December 2019 at 15:20
    Thank you, you were correct.
    This was not related to the DesFire2.
    + 0  |  - 0
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.