Datasheet

Accessing EEPROM Memory
To access the EEPROM on the cards, you need to perform the following steps:
1. You must retrieve the 4-byte NUID of the card (this can sometimes be 7-bytes long as well, though rarely for
Mifare Classic cards). This is required for the subsequent authentication process.
2. You must authenticate the sector you wish to access according to the access rules defined in the Sector Trailer
block for that sector, by passing in the appropriate 6 byte Authentication Key (ex. 0xFF 0xFF 0xFF 0xFF 0xFF
0xFF for new cards).
3. Once authenication has succeeded, and depending on the sector permissions, you can then
read/write/increment/decrement the contents of the specific block. Note that you need to re-authenticate for
each sector that you access, since each sector can have it's own distinct access keys and rights!
Note on Authentication
Before you can do access the sector's memory, you first need to "authenticate" according to the security settings
stored in the Sector Trailer. By default, any new card will generally be configured to allow full access to every block in
the sector using Key A and a value of 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF. Some other common keys that you may wish
to try if this doesn't work are:
Example of a New Mifare Classic 1K Card
The follow memory dump illustrates the structure of a 1K Mifare Classic Card, where the data and Sector Trailer blocks
can be clearly seen:
32 15 [-------KEY A-------] [Access Bits] [-------KEY B-------] Sector Trailer 32
14 [ Data ] Data
13 [ Data ] Data
...
2 [ Data ] Data
1 [ Data ] Data
0 [ Data ] Data
0XFF 0XFF 0XFF 0XFF 0XFF 0XFF
0XD3 0XF7 0XD3 0XF7 0XD3 0XF7
0XA0 0XA1 0XA2 0XA3 0XA4 0XA5
0XB0 0XB1 0XB2 0XB3 0XB4 0XB5
0X4D 0X3A 0X99 0XC3 0X51 0XDD
0X1A 0X98 0X2C 0X7E 0X45 0X9A
0XAA 0XBB 0XCC 0XDD 0XEE 0XFF
0X00 0X00 0X00 0X00 0X00 0X00
0XAB 0XCD 0XEF 0X12 0X34 0X56
[--------------------------Start of Memory Dump--------------------------]
------------------------Sector 0-------------------------
Block 0 8E 02 6F 66 85 08 04 00 62 63 64 65 66 67 68 69 ?.of?...bcdefghi
Block 1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Block 2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Block 3 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF ......ÿ.?iÿÿÿÿÿÿ
------------------------Sector 1-------------------------
Block 4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Block 5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Block 6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Block 7 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF ......ÿ.?iÿÿÿÿÿÿ
------------------------Sector 2-------------------------
Block 8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
© Adafruit Industries https://learn.adafruit.com/adafruit-pn532-rfid-nfc Page 18 of 42