Writing data to a mifare desfire card

754 views Asked by At

According to this link:

https://www.mifare.net/support/forum/topic/native-commands-sending-to-mifare-desfire-ev1/

I should be able to write data to a mifare desfire card using the "D6" command

the public ISO commands:

– INS code ‘A4’ SELECT
– INS code ‘B0’ READ BINARY
– INS code ‘D6’ UPDATE BINARY
– INS code ‘B2’ READ RECORDS
– INS code ‘E2’ APPEND RECORD
– INS code ‘84’ GET CHALLENGE
– INS code ‘88’ INTERNAL AUTHENTICATE
– INS code ‘82’ EXTERNAL AUTHENTICATE

Also I'm using an hid omnikey reader to do this so I should have to wrap the apdu command like so:

CLA    | INS     | P1    | P2    | LC        | Data        | LE
0x90     MIFARE    0x00    0x00    Length of   MIFARE        0x00
         DESFire                   wrapped     DESFire EV1
         EV1 CMD                   data        command
         Code                                  parameter(s)

So I came up with the following apdu command to write data to the card...:

90-D6-00-00-10-0C-0C-0C-0C-0C-0C-0C-0C-0C-0C-0C-0C-44-44-44-44-00

Broken down it should be:

CLA = 90

Ins Mifare desfire ev1 cmd = D6

P1 = 00

P2 = 00

LC = 10 (which in decimal is 16)

Data = 0C-0C-0C-0C-0C-0C-0C-0C-0C-0C-0C-0C-44-44-44-44

LE = 0x00

the response I get is:

91, SW2: 1C

Which appears to be "Command code not supported" according to this link:

https://www.eftlab.com/knowledge-base/complete-list-of-apdu-responses

Is the command code actually not supported (d6)..? or am I just inputting things in the wrong way.?

0

There are 0 answers