Read DESFire cards or tags or Apple Access credentials

MIFARE DESFire cards may contain a number of applications, identified by an application ID. Each application may contain a number of data files and a number of cryptographic keys, for use with either the AES or 3DES ciphers. Each file is identified with a file ID and may be individually protected, requiring authentication with one of the application keys, for read or write access and for communications security.

Apple Access DESFire credentials behave in the same way as DESFire cards or tags. When the AccessTCI setting is used the VTAP reader will operate in ECP2 mode and enable DESFire credential reading. More about this under Apple Access settings

To read data from a DESFire card, the config.txt file for your VTAP reader must specify the application ID and file ID, where the required data is stored. The VTAP reader supports a number of formats and options to read, decode or output the secure data. To read any protected data you also need to load the appropriate key into one of the VTAP reader’s app key slots, and specify in the config.txt file the crypto algorithm, the key number (within the card’s application) and the corresponding VTAP app key slot, where that key has been loaded.

After looking at reading data from individually secured files on DESFire cards in this section, the next page will look at how to Read data when key diversification is used, which adds an extra layer to the decoding process.

VTAP reader configuration to read your secure DESFire cards

Read multiple applications or files in the same DESFire card

You may need to read and output values from multiple applications or files within the same DESFire card, where all the applications may have different security requirements.

The VTAP readers can read up to 6 applications within the same DESFire card, access them separately (according to their corresponding security requirements), and output the values, concatenated with a defined separator.

To use this feature, DESFire... settings become DESFire#... settings, where # is a number from 1 to 6. The number shows which settings form a group for reading each of 1 to 6 values from separate files and or applications on a DESFire card or tag. If you use multiple DESFire#... settings the values read will be output together, spaced by the DESFireSeparator string. The lowest numbered DESFire read will be first in the output string, then continuing in ascending numeric order.

Note: If a number is not used in DESFire... settings, then the VTAP reader would treat those settings as DESFire1... For example DESFireCrypto or DESFireFileID would be considered as DESFire1Crypto and DESFire1FileID.

Use DESFireSeparator (defaults to ",") to set a separator character(s) between the outputs of all the DESFire applications. Up to 16 characters can be used and URL encoding is also supported.

When using the Wiegand interface, multiple reads are not supported. In this case, only the lowest numbered DESFire#... settings will be used, which might not be DESFire1.... If only DESFire3... and DESFire4... settings are defined in config.txt, the DESFire3... settings would then be used for output over Wiegand.

Read Apple Access credentials

In order to read Apple Access DESFire credentials you need to set an AccessTCI value. The TCI is an ID assigned by Apple Access credential issuer. When this setting is used, the VTAP reader will operate in ECP2 mode and enable DESFire credential reading.

Example: Settings in config.txt to read secured data from Apple Access DESFire credentials

Copy
!VTAPconfig

AccessTCI=203C20    ; ID assigned by Apple Access credential issuer

DESFireAppID=F56400 ; 24 bit value (6 hex digits)
DESFireFileID=1     ; File ID within application (decimal 0 to 255)
DESFireCrypto=3     ; 0 = None; 1 = 3DES; 3 = AES (default)
DESFireKeyNum=1     ; Application key number used for authentication
DESFireKeySlot=1    ; Application key slot number on VTAP
                    ; here use appkey 1
DESFireFormat=1     ; How to interpret the data
                    ; =0 no format
                    ; (set DESFireReadLength and TagReadFormat)
                    ; =1 KEY-ID format (26 bit facility code 
                    ; and number, H10301 compatible)