-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mifare Classic 1K: Unable to authenticate and read from tag #103
Comments
Probably because the code tries to do multiple authentications in parallel, not sequentially? |
Hello. I got stuck with a similar problem like above: I need to get that actual "Record 0" and I don't really have too much time or knowledge to read through the documentation and wrap my head around exactly how to do it. So I was wondering if there is any simple example of how to just read that "Record0", whether it's a text or URL or whatever is written there. If useful, this is the info of the card I am testing with: Thank you so much in advance for your support! |
EDIT: Actually, using KEY_TYPE_B with key=0xFFFFFFFFFFFF does work. I must have been trying many combinations and missed that. So it looks like the wakdev app blocks reading with KEYA or it changes KEYA to something that is not all 0xFF or all 0x00. My below code works if changing the key type to KEY_TYPE_B. I have the same problem as timonsku: I write data to the card with wakdev's NFC Tools app (Android), and can read it back in that app. I note that the KEYA and KEYB are not readable due to a change in the access bits done by the wakdev app, but I'm assuming that it left them as all 0xFF's. Trying to read the card with nfc-pcsc gives "AuthenticationError: Authentication operation failed: Status code: 0x6300". My cards are MiFare Classics. Below is my relevant code. NB: I wrote a URL record to the Card, so I want to skip into block 5 to avoid the record type bytes and only look at the end of the URL which has text for my application to process.
|
I'm trying to read the NDEF record on a Mifare Classic 1K tag. This works fine using the "NFC Tools" app from WakeDev. I can read and write with that just fine.
With nfc-pcsc I can detect the card but reading from it fails. So I tried to authenticate as explained in the Mifare Classic example but I'm simply not able to authenticate. I tried all known public keys, none of them seem to work. Am I doing something wrong?
Authentication errors out for every key and the read of course subsequentially also fails with the message
error when reading data ReadError: Read operation failed: Status code: 0x6581
The text was updated successfully, but these errors were encountered: