MIFARE Application Directory (MAD)

Data elements for application directories and selection:

Application identifier:
Is a unique 16 bit code divided into two fields:

Table 2. Application identifier                    
bit             bit bit             bit
15             8 7             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.    



Table 3. CRC-byte                        
bit 7   bit 6   bit 5   bit 4   bit 3   bit 2   bit 1   bit 0  
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
0×00) or Info-byte and ID$11 to ID$27 (sector 0×10) (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.                


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 … 5pointer to card publisher sector                
0×10 shall not be used.                      
0×28 … 0x3F shall not be used.                    
Bit 6, 7RFU (reserved for future use)                  

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 10th byte of block 3. The code 0×69 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    
ADV(MAD version code): 01 for MAD version 1 (Sectors 1 … 00xF)          
10 for MAD version 2 (Sectors 1 … 0×27)                  
MA (multiapplication card) 1yes                      
0 monoapplication card                        
DA (MAD available) 1yes                        
0 sector 0 does not contain MAD (all further MAD conventions are not considered)    
The GPB for MAD version 2 in sector 16 will be set to RFU (0×00).          

Read-key A:

Table 6. Read-key A                              
Key A of sector 0 should be public and                        
set to the following code:     bit 5   bit 4   bit 3   bit 2   bit 1   bit 0  
              a5 a4 a3 a2 a1 a0


Write-key B:
Key B of sector 0 is programmed by the card issuer and should be kept secret. If additional applications join the same MIFARE card key B may be forwarded to the organization which provides the new services in order to enable directory (MAD) adaptation during re-initialization of the MIFARE cards.