2

I have a project to create attendance system using MIFARE DESFIRE EV1 cards.

The reader brand that I need to use for this project only supports ISO 7816-x so I need to use DESFIRE ISO7816-4 APDU Wrapping mode to send commands to Card Reader.

I also have access to NXP document resources.

Up to now I can run A few commands like Get Version, Get Application IDs, Free Memory on card. all these commands can be run in plain with no security required. however I couldn't create application on this card yet.

I'm sure my command for creating application is correct but it is failing with code 0x7E (Length Error).

here is my create application code which is failing.

-> 90 CA (00 00 05) 414141 0F 0E (00)
<- 91 7E

I like to know:

  • Am I running the command in correct sequence?
  • Is it required to authenticate before creating applications in card
AaA
  • 3,600
  • 8
  • 61
  • 86
  • Why the parentheses around some of the bytes? They seem oddly placed... – Maarten Bodewes Oct 25 '12 at 18:11
  • 1
    those parenthesis are to separate ISO-7816 APDU from ISO 14443-4 data commands `CA 414141 0F 0E` is ISO 14443-4 command and 90 00 00 05 00 is ISO-7816 APDU command. – AaA Oct 29 '12 at 01:48
  • Did you manage to resolve this problem? I'm stuck at the exact same command. – sventevit Feb 28 '13 at 16:30
  • 1
    Yes, I did, different readers, react differently. some of them need the last 00 and some add it themselves. when sending commands directly from API calls I didn't have this problem anymore – AaA Mar 01 '13 at 04:16

2 Answers2

0

The last byte represent the number of keys you want to use in that application. For every Desfire card, only 14 keys can be created per application. So, the number of keys should be from 0x01 to 0x0E.

0

This command creates an application for me (with AES keys, hence the 0x80 bit in the num_keys byte).

(90) ca (00 00 05) 33 22 11 0b 84 (00)
m_eiman
  • 431
  • 4
  • 8