Go Down

Topic: NFC - auth (Read 382 times) previous topic - next topic

Rolandk

Hi, I am using the RC522, nfc ring (ultralight or ultralight c) and an Uno R3 with the MCRC-Library/Example from: https://github.com/ljos/MFRC522
I would like to read previously written data from the nfc-tag.
The problem is, that I can not access the data on the nfc-tag. I always get authentification errors...

I thought that the problem is the authentication key. So I changed it from
Code: [Select]
byte keyA[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, };
to
Code: [Select]
byte keyA[16] = {0x49, 0x45, 0x4d, 0x4b, 0x41, 0x45, 0x52, 0x42, 0x21, 0x4e, 0x41, 0x43, 0x55, 0x4f, 0x59, 0x46};
which should be the right one according to several internet sites.
But I still get that error.

This script (with old key) works with other tags, that I have (Mifare Classic). So I doubt that there is a principle error.

I have also found another example which works. There, the key is read by
Code: [Select]
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
Without any visible authentication whatsoever.

Could anybody tell me which key this "DumpToSerial" uses? Or is there another function like mfrc522.PICC_DumpToArray or so?^^

Thank you very much!

PaulS

Quote
Could anybody tell me which key this "DumpToSerial" uses?
You could. You have the source code.

You'll see that that function expects the uid field of the mfrc522 instance to have already been populated, which, presumably, means that you would have had to supply a correct key at that time.

Go Up