NFC door lock
Firmware for a door lock that checks MIFARE DESFire EV3 cards with AES-128 challenge-response.
Status: In progress
Door closedDoor open
- Card detected
- Lock sends a random number
- Card answers encrypted
- Answer matches, door open
Simplified simulation in the browser
The software for a door lock that reads MIFARE DESFire EV3 cards. It runs on an ESP32-S3, a microcontroller with Wi-Fi, and talks to a PN532 NFC reader. The interesting part isn’t the lock itself but the check behind it.
How the lock checks a card
Lock and card share the same secret key (AES-128). When someone holds a card to the reader, the lock sends it a random number. The card answers in encrypted form and the lock checks the answer. This is called challenge-response: the key itself is never transmitted, and a recorded answer won’t work next time because the random number is different every time.
The simulation on this page shows the process in a simplified way.
Screenshots
Questions about NFC door lock? Email me at contact@