user1223802
user1223802

Reputation: 31

Authentication failure for Mifare 1K NFC tag using ACR122U NFC reader

I always get the failure result when using ACR122U tool to authenticate Mifare 1K NFC tag, but I can use Android phone to read/write this tag.

ACR122U Load Authentication Keys
< FF 82 00 00 06 FF FF FF FF FF FF 
> 90 00 
< Key Structure: 00    < Key Number: 00
< Key: FF FF FF FF FF FF
Load Authentication Keys Success

ACR122U Authentication
< FF 86 00 00 05 01 00 00 60 00 
> 63 00 
Operation failed

Upvotes: 3

Views: 20052

Answers (4)

ThomasRS
ThomasRS

Reputation: 8287

I have written an utility for some ACR readers and the ACR 122U with Mifare classic cards is hitting some kind of bug. The identical code works for ACR 1222L.

However Mifare Classic cards are crap, so I suggest switching cards to work around the problem.

Upvotes: 0

Batuhan
Batuhan

Reputation: 100

Use "NFC TagInfo" application for android. You can read hex data with that app and find out your correct keys. In the end of every sectors there will be "keya, access, keyb" data. First 6 byte (12 hex character) is key a and last 6 byte (12 hex character again) is key b. Use new keys for reading and writing to card.

Upvotes: 1

Shihab
Shihab

Reputation: 121

The authentication of a MF Classic 1k card can be failed with different reasons.

  1. Wrong Key

    a. Length : It should be 6 bytes (12 Hex chars).

    b. Key Matching : The key will be the hex FFFFFFFFFFFF in transport mode (by default) and it can be changed by a card providing vendor. You have to get the exact key from the vendor.

  2. Key Category : The access condition (6-9 bytes of Block 3 of all sectors) will explain which key you have to use to authenticate a corresponding sector for a particular memory operation .To know more details please refer

http://www.nxp.com/documents/data_sheet/MF1S50YYX.pdf

Upvotes: 0

NFC guy
NFC guy

Reputation: 10228

Your remark about an Android phone being able to read and write this tag suggests it is formatted to contain NDEF data. Instead of the factory default key 0xFFFFFFFFFFFF, you could try to use the MIFARE Application Directory key 0xA0A1A2A3A4A5 for the first sector (blocks 0-3) and the NFC Forum key 0xD3F7D3F7D3F7 for the following sectors. See NFC Type MIFARE Classic Tag Operation for more details.

Upvotes: 5

Related Questions