nfc-pcsc icon indicating copy to clipboard operation
nfc-pcsc copied to clipboard

Mifare DESfire EV2 2k - error in step 2 - authenticate

Open SomeDevWeb opened this issue 2 years ago • 1 comments

Hi all, I am quite new in the NFC world, so I apologise for any silly things I say, but I have a Mifare DESfire EV2 2k that already has some employee data and I just need to get the ID from it. I installed this awesome vfc-pcsc package and I tried a Mifare Classic card, which worked fine with the "mifare-classic" example, but when I tried the "mifare-desfire" to read the DESfire EV2 2k, I get this error: This is the whole return code actually

[step 1 - select app] sending <Buffer 90 5a 00 00 03 00 00 00 00>
[step 1 - select app] received data <Buffer 91 00>
[step 2 - authenticate] sending <Buffer 90 0a 00 00 01 00 00>
[step 2 - authenticate] received data <Buffer 91 ae>
11:51:15 – ACS ACR1252 CL Reader PICC 0 error: error occurred during processing steps Error: error in step 2 - authenticate
    at authenticate (C:\Users\User\nfc-pcsc\examples\/mifare-desfire.js:103:11)
    at ACR122Reader.<anonymous> (C:\Users\User\nfc-pcsc\examples\/mifare-desfire.js:175:4)

I read and heard from a person that the card needs to have an original encryption key in order to authenticate. Is that correct? In any case, please shed some light on how to read this type of card. Thank you so much for your help!!!

SomeDevWeb avatar Jun 15 '22 11:06 SomeDevWeb

Hi,

I'm also new to the NFC, but I've noticed a method loadAuthenticationKey() https://github.com/pokusew/nfc-pcsc/blob/8f47cf9e623f45d8318a13460084068889f76ede/src/Reader.js#L342 in the class Reader , which takes the key you pass and transmits it to load the keys to the NFC reader memory.

I am not sure, but probably you also need to have your key in the reader memory before trying to authenticate.

Hope it helps somehow

Eneradler avatar Jul 14 '22 09:07 Eneradler