Search code examples
smartcardapdusmartcard-readercontactless-smartcard

How do I distinguish different ISO 14443-4 cards?


There are different smart cards supporting ISO 14443-4. For example, Mifare Plus with its native command set. Or other cards with different command sets (i.e. 7816-4 APDUs).

I develop some software for a card reader and I need to identify which commands the card supports (for example, if it supports commands in ISO 7816-4 structure or not).

What is the recommended way to distinguish between them? Should I just try some commands from Mifare Plus command set and check if I get correct replies? Or is there any smarter way to do it?


Solution

  • During the connection protocol some parameters are exchanged that you can use to determine the card's capabilities. For example, the SAK byte will inform the reader whether the card is ISO 14443-4, and even if it is MIFARE Plus (there is an NXP document explaining which bits you have to read). Then you have ATS (Answer To Select), which contains a lot of useful information about the card. Have a look at ISO 14443-4 and at ISO 7816-4.