I am interested in integrating the RFID1356MIFARE with the ESP32-EVB and using it as a card reader over UART. Basically reading UIDs, writing commands to UART serial and granting access or not based on what the reader output is. Initially I've tried using this library: https://github.com/elechouse/PN532 but I found out that the RFID1356MIFARE firmware is not compatible with it.
I would like to understand how does a RFID reader grant access to a card, to open a door for example. Thanks to this thread: Mifare 1K authentication keys I am starting to understand how the two Authentication keys work.
What I still don't get is:
- who sets the authentication keys ?
- are these keys unique to every card ?
- are these keys stored in a reader ?
- can I read the keys from a card ? If yes, how ?
- are these keys the one that grant access to, say, a door that's linked to the reader ? If not, what makes a card to have access or not ?
- are these keys the only form of authentication ?
- is the UID used only for identification ?
- why are there 16 sectors if all the information is available in the first sector ? What is the purpose of being able to set different keys to each sector ?
The most important question I have is: what makes a card reader give "Access Granted" to a card ?
I've found these docs on Mifare Authentication and they mention Load Authentication Keys
and Authentication
commands for that specific reader. The reader that I am using has no such commands. Looking at this thread Mifare card security also made me realise that my card reader lacks some commands or that they are just very poorly documented.
I have also read the MIFARE docs from NXP, but there is nothing in there that I actually need.