Reply To: Mifare desfire EV1 and ISO IEC 7816-4 Commands

Forum MIFARE SDK Mifare desfire EV1 and ISO IEC 7816-4 Commands Reply To: Mifare desfire EV1 and ISO IEC 7816-4 Commands

Re: Mifare desfire EV1 and ISO IEC 7816-4 Commands

17. August 2016 at 8:57
Hi Narendc,

The frame size for one APDU is limited to maximum 64 bytes in DESFire EV1. There is no possibility to increase this framesize. When subtracting the 4 bytes which are needed for ISO/IEC 14443-4, actually only 60 bytes can be used for one native DESFire EV1 command APDU. When using one of the ISO/IEC 7816-4 standard commands which are supported by DESFire EV1 (like Cmd.ISOReadBinary) additionally ISO 7816-4 bytes need to be included into the APDU. The needed bytes are: CLA, INS, P1, P2, Lc and Le. The INS byte reflects the native DESFire EV1 command code and the data section actually holds the command header and the command data.

Your conclusion of being able to write only 55 data bytes at a time when using ISO/IEC 7816-4 APDUs is correct. In one command frame you are limited to this size. If you want to send more data at once, you need to implement a so-called chaining mechanism which basically connects multiple command-response pairs. The ISO chaining mechanism according to ISO/IEC 14443-4 can be implemented in order to send/read larger chunks of data at once (by using multiple challenge-response pairs automatically).

The DESFire EV1 allows the creation of 28 applications (PICC = AID using 0x000000 is not included in counting). The reason that you were not able to create more applications could be the configuration of your applications – can you check how much memory is still available on the card? If you created each application with support of multiple keys it could be that you ran out of memory. If the maximum number of applications is reached and you try to create the 29th one, you get the error code 0xCE (count error) returned, which signalized that the application limit has been reached.

Regards,
The MIFARE Team
+ 0  |  - 0