Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between DESFire and DESFire EV1 cards?

I have a contactless card and I know it is a MIFARE card. I have no document and no authentication key. After a reset, I received the following ATS:


myubuntu@lol-MS-7693:~$ nfc-list 
nfc-list uses libnfc 1.7.1
NFC device: ACS / ACR122U PICC Interface opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 03  44  
       UID (NFCID1): 04  8c  4c  92  e9  48  80  
      SAK (SEL_RES): 20  
                ATS: 75  77  81  02  80  

After searching above ATS in google, I found the following info here:

enter image description here

So, my card is either a DESFire card or a DESFire EV1 card. The question is, how can I detect which of the two my card is precisely?

like image 304
Brad Avatar asked Jan 06 '23 05:01

Brad


2 Answers

MIFARE DESFire EV1 is the followup generation of MIFARE DESFire. DESFire EV1 adds support for new cryptographic algorithms (specifically AES) and improves security of crypto operations against side-channel attacks known for MIFARE DESFire.

You could distinguish the the two versions by sending a GetVersion command (command code 0x60) to the card.

If you are using the native command mode, this would look something like:

READER ---> CARD:  60
CARD <--- READER:  AF 04 01 XX XX XX XX 05
READER ---> CARD:  AF
CARD <--- READER:  AF 04 01 01 HH LL XX 05
READER ---> CARD:  AF
CARD <--- READER:  00 XX XX XX XX XX XX XX XX XX XX XX XX XX XX

The byte HH contains the major software version, which is 0x00 for DESFire and 0x01 for DESFire EV1.

If you are using a PC/SC reader to communicate with the card, you would probably need to use the DESFire APDU-wrapped native command set instead:

READER ---> CARD:  90 60 00 00 00
CARD <--- READER:  04 01 XX XX XX XX 05 91 AF
READER ---> CARD:  90 AF 00 00 00
CARD <--- READER:  04 01 01 HH LL XX 05 91 AF
READER ---> CARD:  90 AF 00 00 00
CARD <--- READER:  XX XX XX XX XX XX XX XX XX XX XX XX XX XX 91 00
like image 196
Michael Roland Avatar answered Feb 15 '23 23:02

Michael Roland


You can identify the card type by the Major Hardware version number which you would get like this

Reader       Card
 60      -> 
         <-  AF 04 01 XX HH LL XX 05
 AF      ->
         <-  AF 04 01 01 XX XX XX 05
 AF      ->  
         <-  00 XX XX XX XX XX XX XX XX XX XX XX XX XX XX

where HH would be:

  • 0x00 = DESFire (MF3ICD40)
  • 0x01 = MIFARE DESFire EV1
  • 0x12 = MIFARE DESFire EV2
like image 44
Omar Jarid Avatar answered Feb 15 '23 23:02

Omar Jarid