Reply To: Trying to read DESFire EV1 Card, requires Authentication.

Forum MIFARE SDK Trying to read DESFire EV1 Card, requires Authentication. Reply To: Trying to read DESFire EV1 Card, requires Authentication.

Re: Trying to read DESFire EV1 Card, requires Authentication.

22. February 2016 at 18:08
Hey there,

Thanks for the response! As I specified above, I was under the assumption that the cards did not require authentication to read, after reading the specification for the card as designed. I have colleagues that have had similar results of being able to read the card without having to authenticate first. Are you saying that this is not a feature that is present in the DESFire EV1 cards?

Also, I have tried to use the authenticate method previously, but got this error:

02-22 09:06:51.121 21544-21544/com.example.nfcreader E/MainActivity: Error reading from DESFire card.
com.nxp.nfclib.exceptions.DESFireException: invalidResponse: Authentication Error
at com.nxp.nfclib.desfire.DESFireEV1.ˎ(:5500)
at com.nxp.nfclib.desfire.DESFireEV1.ˎ(:1405)
at com.nxp.nfclib.desfire.DESFireEV1.authenticate(:1055)
at com.nxp.nfclib.desfire.ˊ.authenticate(:48)
at com.nxp.nfcliblite.cards.DESFireEV1.authenticate(:471)
at com.example.nfcreader.MainActivity$2.onDESFireCardDetected(MainActivity.java:129)
at com.nxp.nfcliblite.NxpNfcLibLite.ˊ(:573)
at com.nxp.nfcliblite.NxpNfcLibLite.filterIntent(:369)
at com.example.nfcreader.MainActivity.onNewIntent(MainActivity.java:73)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1212)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1224)
at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2545)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:2557)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2566)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1416)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


The line the stack trace is pointing to is here:
// Authenticate so we can read.
idesFireEV1.authenticate(masterKey, appId, appKey);


Unfortunately I can't include the keys for obvious reasons, but I've converted them from Strings (in hex format) into byte arrays for passing.

I'd love to know a little more about the reason I'm getting these errors if possible, since neither of them are very verbose.

Thanks,
Michael
+ 0  |  - 0