AN10787
MIFARE Application Directory (MAD)
Rev. 7.4 — 5 November 2018 Application note
001874 COMPANY PUBLIC
Document information
Information Content
Keywords MIFARE Application Directory (MAD), multi-application, function cluster code,
application code, General Purpose Byte (GPB), CRC.
Abstract Presenting the proposed MIFARE Application Directory, its rule and structure
together with examples, which opens the possibility to combine different
applications in one card with certain interoperability.
NXP Semiconductors
AN10787
MIFARE Application Directory (MAD)
AN10787 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2018. All rights reserved.
Application note Rev. 7.4 — 5 November 2018
COMPANY PUBLIC 001874 2 / 25
Table 1. Revision history
Rev Date Description
7.4 20181105 • Figure 4 and Figure 5: updated
7.3 20180925 • Cluster codes added
• Editorial changes
7.2 20160713 • MAD and MIFARE Plus EV1: added
7.1 20130116 • Section 4.5: registration office mail address updated
07 20100707 • Section 3.12 "MAD and MIFARE Plus": added
• Table 16 "Function cluster codes": updated
• Section 10.2 "Disclaimers": updated
06 20091204 • Table 13 "MIFARE DESFire AID": updated
• Section 3.10.1 "Example": updated
05 20091013 • Section 3.10.1 "Example": section added
• Section 10 "Legal information": updated
04 20090305 Fourth release
(supersedes AN MAD, MIFARE application directory, Rev. 03.00, 4 May 2007)
NXP Semiconductors
AN10787
MIFARE Application Directory (MAD)
AN10787 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2018. All rights reserved.
Application note Rev. 7.4 — 5 November 2018
COMPANY PUBLIC 001874 3 / 25
1 Introduction
Figure 1. MIFARE Application Directory
The MIFARE Application Directory standard proposes the introduction of common data
structures for card application directory entries. Registered application identifiers (AIDs)
in sector 0x00 (and sector 0x10, if applicable) of any MIFARE product-based card enable
identification of all registered card applications. Terminal software should take advantage
of this feature using those sector pointers instead of physical sector addresses.
In this document the term „MIFARE card“ refers to a contactless card using an IC out of
the MIFARE Classic, MIFARE Plus or MIFARE DESFire product family.
The MAD allows for fast selection of the targeted applications even if there are multiple
cards in the field.
The current document describes the MAD version 1, 2 and 3.
MAD1 is limited to 16 Sectors (as used in MIFARE Classic).
MAD2 specifies the usage of the MIFARE Classic or MIFARE Plus with a memory >1k
(e.g. MIFARE Classic 4K, etc.).
MAD2 is fully compatible to the MAD1, i.e. an MAD1 system can use cards, that use
MAD2 without any changes. In this case, only the lower 1k EEPROM can be addressed.
All the relevant changes are described on Table 1.
MAD3 specifies the usage of Registered application identifiers in the context of MIFARE
DESFire.
Observing the following proposed MIFARE Application Directory rules following
proposed opens a lot of future benefits:
NXP Semiconductors
AN10787
MIFARE Application Directory (MAD)
AN10787 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2018. All rights reserved.
Application note Rev. 7.4 — 5 November 2018
COMPANY PUBLIC 001874 4 / 25
Table 2. Future benefits
basic requirements ⇒ additional information ⇒ additional flexibility
• reserve 2 blocks in sector
0(and also reserve 3 blocks
in sector 16 for MAD2)
• keep the given format
• request for AID
[1]
• use public read-key for
sector 0
• use secret write-key for
sector 0
• use indirect addressing mode
in terminal program
⇒ identify any application on
any MIFARE card together with
the sectors in use
⇒ identify card issuer
⇒ identify free or blocked
sector
⇒ already existing MIFARE
cards may serve for new
additional applications
⇒ already existing MIFARE
applications on multiple cards
may be combined on one
single card
⇒ easy adaptation of memory
structure in case of additional
features or blocked sectors
[1] AID application identifier request form can be found in annex A
NXP Semiconductors
AN10787
MIFARE Application Directory (MAD)
AN10787 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2018. All rights reserved.
Application note Rev. 7.4 — 5 November 2018
COMPANY PUBLIC 001874 5 / 25
2 Data elements for application directories and selection
2.1 Application identifier
Is a unique 16-bit code divided into two fields:
Table 3. Application identifier
bit
15
bit
8
bit
7
bit
0
(8 bit) function cluster code (8 bit) application code
To enable easy classification of the whole range of possible applications, the function
cluster code is used. Some codes are already prepared and outlined in annex C.
2.2 CRC-byte
8 bits include a cyclic redundancy code according to the 8-bit CRC coprocessor. The
coprocessor should be reset and afterwards either the Info-byte and ID1 to ID$F (sector
0x00) or Info-byte and ID$11 to ID$27 (sector 0x10) (lower byte followed by higher byte)
should be passed to the CRC coprocessor exactly in this order. This code allows an
integrity check of the directory blocks.
2.3 Info-byte
Table 4. info-byte
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
free pointer to CPS
The information of the card publisher sector is particularly useful if somebody needs
to find out the organization responsible for distribution of free card sectors for new
applications. These free card sectors may easily be used for additional applications.
Bit 0 … 5 pointer to card publisher sector (see Section 3.8)
0x10 shall not be used.
0x28 … 0x3F shall not be used.
Bit 6, 7 RFU (reserved for future use)
2.4 General-purpose byte (GPB)
The general-purpose byte of the access condition field of sector trailer 0 describes further
details of the MAD standard. It is the tenth byte of block 3. The code 0x69 should not be
used for standardized cards and refers to non-personalized cards.
Table 5. General purpose byte
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
DA MA RFU ADV