Search code examples
nfcsmartcardmifaresmartcard-readercontactless-smartcard

Cheap DIY Desfire EV1 reader to identify students


I would like to build a (cheap) device to identify students at my university using their Student Card (called "ISIC").

My Phone (via its NFC reader on Android) tells me that these cards are :

NXP MIFARE DESFire / NXP MIFARE DESFire EV1

So far, I've tried hooking up an RC522 chip to an arduino board but wasn't able to communicate with the card (libraries are under development but I can't seem to get them working with this setup).

This is what I had in mind :

  • Raspberry pi 0
  • PN532 NFC/RFID controller breakout board
  • v1.6 by adafruit (which seems to be the best choice possible according to the nfc-tools wiki)

Before buying everything, here are my questions :

  • Has someone ever tried reading that kind of card with this board ?
  • Is there a cheaper and/or easier solution ?

Thanks a lot !


Solution

  • Depending on the situation I would recommend one of 2 options:

    1. If you can firstly read all cards of your students and correlate the unique-UID (unique ID number for each contactless card) of each card with each student.

    2. If you need to read the information of the card to get the student identification.

    For Case 1: If your situation is "1", I would recommend that you just read the UID of each MIFARE DESFire EV1 and as far as you know the card UID of each student you would be able to identify them. Reading the UID of a MIFARE DESFire card is very easy and immediate with any reader or Android Smartphone; but before going forward with this option you should firstly check that the MIFARE DESFire cards are configured to have a non-Random UID. To do so just read the UID of a single MIFARE DESFire card and check that the 1st byte of the UID:

    • If 1st byte = 0x08 -> Random UID (4 byte length)
    • If 1st byte = 0x04 -> You can use this proposal (7 byte length)

    If "1st byte = 0x04" then you can just develop an Android application or a C application with a PC/SC reader or Raspberry PI very easily.

    For Case 2:Then you need to understand how is the data stored in the MIFARE DESFire cards, if they have encription keys... You can develop applications with Android, Raspberry PI or desktop reader, but you'll need to understand better how does MIFARE DESFire EV1 works and of course the protection keys (if they have).

    I hope it helps!