MIFARE® Classic card or tag settings
A list of valid configuration settings for the config.txt file, which relate to extracting block data from MIFARE Classic cards or tags. (MIFARE is a registered trademark of NXP B.V.) You will also need to use some of the general Card or tag settings alongside these.
The setting MIFAREClassic is used to direct the VTAP reader to read various types of data from any MIFARE Classic cards that are presented.
To read blocks of data from MIFARE cards, you will need to use the other settings prefixed MIFAREClassic#... to identify the key to use and which blocks (or parts of blocks) to read. You will need to specify MIFAREClassicBlockNum, MIFAREClassicKeySlot and MIFAREClassicKeyType as a minimum. Together these define which block to read and provide the key information needed to decode that block.
Note: In the MIFAREClassic#... settings # is a number from 1 to 6. This shows which settings form a group, for reading from up to 6 different MIFARE Classic cards or tags. If you use multiple MIFAREClassic#... settings, then the setting MIFAREClassicMultiMode determines how the VTAP reader will use these groups of settings. (For Wiegand data multiple reads are not supported. In this case only the lowest numbered MIFAREClassic#... settings will be used.) If no number is used in the setting name, the setting will be treated as belonging to set 1.
MIFAREClassicMultiMode=0 (default) requires all groups of settings are tested for every MIFARE tag read, with all values read being output together, spaced by the MIFAREClassicSeparator string. MIFAREClassicMultiMode=1 requires the VTAP reader to stop trying other groups of settings as soon as has a successful read, and output only the payload from that successful attempt.
If you want to read a single block of data from only one format of MIFARE Classic card or tag, or to read from other NFC cards or tag types, you can use settings prefixed TagRead.... Refer to Card or tag settings.
Settings below: MIFAREClassic | MIFAREClassicBlockNum | MIFAREClassicFormat | MIFAREClassicKeySlot | MIFAREClassicKeyType | MIFAREClassicLength | MIFAREClassicMinDigits | MIFAREClassicMultiMode | MIFAREClassicOffset | MIFAREClassicSeparator
Definition:
Permits MIFARE cards or tags to be read, and defines which part of the card/tag data will be read. This can be the UID (4 or 7 bytes usually in the first block) or up to 16 bytes of data from another specified block. (Similar to NFCType for NFC cards).
Options:
=U or 1 to permit MIFARE UID to be read,
=N or 2 to read NDEF data (not currently supported on MIFARE Classic),
=B or 3 to read or decode a memory block.
=0 is disabled (default).
An order of precedence allows multiple selections, from MIFARE cards. So =BU or =UB would read the UID, if block data cannot be read.
Default value: =0
Example value: =U
Definition:
Select a block number to read.
Options:
MIFARE Classic 1K cards have 64 blocks (16 sectors of 4 blocks each) and 4K cards have 256 blocks (32 sectors of 4 blocks and 8 sectors of 16 blocks). These are numbered in decimal from 0 to 255. (Must also set MIFAREClassic=B or =3).
Default value: =0
Example value: =56
Definition:
Choose to format the extracted block data as ASCII, hex or decimal.
Options:
=a for ASCII characters (each byte is an ASCII character);
=d for decimal (interpret binary data as a 64 bit decimal value and output as ASCII decimal digits), in this case MIFAREClassicLength should not exceed 4 bytes;
=h for hexadecimal (convert binary data to ASCII hex digits with 2 digits per byte).
Default value: =h
Example value: =d
Definition:
Identifies which uploaded appkey#.txt file contains the key for accessing the block data from a MIFARE Classic card or tag, or from a MIFARE Ultralight AES card.
Options:
=1 to =9, to refer to the application key files uploaded as appkey1.txt through appkey9.txt
=0 means no key specified (unless TagReadKey is set)
Default value: =0
Example value: =1
Definition:
This is the key type, for the key selected by MIFAREClassicKeySlot, or set by TagReadKey.
Options:
=A or =B to describe the MIFARE Classic key type to be used with block data,
=C to enable AES CMAC secure message authentication / verification of block data. (Only applicable if NFCType2=B is also used with secured MIFARE Ultralight AES cards).
Default value: =A
Example value: =B
Definition:
The number of bytes of block or UID data to read from a MIFARE tag or card.
Options:
=1 byte to =16 bytes
This number should not exceed =4 if MIFAREClassicFormat is 'd'ecimal, as no more than 4 bytes are used in this case.
If this offset is used together with MIFAREClassicOffset, MIFAREClassicOffset + MIFAREClassicLength must be less than or equal to 16. (If it is not, the length will be reduced by truncating data.)
Default value: =16
Example value: =4
Definition:
Require fixed-width UID output by adding leading zeros as necessary. The MIFAREClassic#MinDigits setting will take precedence if any is set.
Options:
1 to 20 digits, corresponding to the maximum number of decimal digits in a 64 bit value.
=0 or omitted has no effect.
=A for automatic padding with leading zeros to length for UID: 10 digits for 32bit UID, 17 digits for 56bit UID or 20 digits for 64bit UID.
=X for extended automatic padding: 10 digits for 32bit UID, 18 digits for 56bit UID or 20 digits for 64bit UID.
Default value: =0
Example value: =10
Definition:
Determines how the VTAP reader will use the groups of MIFAREClassic#... settings.
Options:
=0 (default) requires all groups of settings are tested for every MIFARE tag read, with all values read being output together as a single string, spaced by the MIFAREClassicSeparator string.
=1 requires the VTAP reader to stop trying other groups of settings as soon as it has a successful read, and output only the payload from that successful attempt.
Default value: =0
Example value: =1
Definition:
The byte offset within block or UID data. Describes the position to start reading data from, within a block.
Options:
=0 to =15
If this offset is used together with MIFAREClassicLength, MIFAREClassicOffset + MIFAREClassicLength must be less than or equal to 16.
Default value: =0
Example value: =5
Definition:
Defines a string to include in between the data obtained from separate MIFARE Classic card reads, when there is more than one.
Options:
Choose any separator that suits your application, up to 16 characters. (Note: Pre/postfix strings can still also be applied to the combined DESFire read output over a given interface.)
Default value: =,
Example value: =|