I am writing some code to authentificate and overwrite some data on rfid chip. I am using javax.smartcardio and the reader is ACR122U. Now if I try to send a APDU-command like: ff860000050100066100a0a1a2a3a4a5 (authentificate with standard key at sector 2) I get Error. But I am sure that I have the right key. I tested it in acr122utools. What is the problem? Please help.
Asked
Active
Viewed 104 times
0
-
Please include the error stack trace and the code where it is caused. – forgivenson Apr 16 '14 at 19:32
-
The "APDU command" is not a valid C-APDU (as per ISO/IEC 7816-4). Lc = 0x05 while sending 11 data bytes makes no sense. – Michael Roland Apr 16 '14 at 20:11
-
It is not a programm error, it is a return value from the card of 63 (authentication error). – user3542567 Apr 17 '14 at 20:46
-
Did you check if the error is a result of the invalid Lc byte? – Michael Roland Apr 18 '14 at 20:58
1 Answers
1
There is a bit different way to authenticate to the card via acr122u. At first you have to load you key to the reader memory (example: ff 82 00 00 06 a0 a1 a2 a3 a4 a5). Then you have to tell, that you will authenticate with key from memory:(example ff 86 00 00 00 50 10 00 66 10). It should be done this way, because the authentication is a "challange response". Only the parts of the key will be crypted with a random number and transfered between card and reader. I think, that own implementation of challange response is not the way you would like to go.

Watsche
- 438
- 2
- 13