Forums user Elmue’s already-awesome DIY RFID e-lock was recently upgraded to be compatible with Desfire EV1 cards, which required a complete reverse-engineer of their source code. As Elmue explains,
The difficult part is not the DES / AES encryption itself. The difficult thing is that NXP does not publish the documentation for these cards. You have to make a Non Disclosure Agreement (NDA) with them and promise that you will not give their holy documentation to anybody else. But this NDA is only made with companies. And in internet you find only very very sparse information about Desfire EV1.
As I don’t have that documentation I had to study the source code of some open source projects on Github, and in an endless try and error write my code for Teensy. My project is the first code that has ever been written for the Arduino family of boards! (The Adafruit library supports only Mifare Classic cards which are completely obsolete because they have been cracked in 2008 and can be cloned in a few seconds.)
View the entire project here on Code Project.
Tested with Teensy but Arduino-friendly, that means the project should be compatible with both the PN532 breakout board and the PN532 controller shield for Arduino.
View the entire project here on Code Project.
Featured Adafruit Products!
PN532 NFC/RFID controller breakout board – v1.6: The PN532 is the most popular NFC chip, and is what is embedded in pretty much every phone or device that does NFC. It can pretty much do it all, such as read and write to tags and cards, communicate with phones (say for payment processing), and ‘act’ like a NFC tag. If you want to do any sort of embedded NFC work, this is the chip you’ll want to use! Read more.