Mifare Card,Mifare Cards

The mifare Classic is the most widely used contactless smart card in the market. Its design and implementation details are kept secret by its manufacturer.  The wireless interface has practical advantages: without mechanical components between readers and cards, the system has lower maintenance costs, is more reliable, and has shorter reading times, providing higher throughput. There is a huge variety of cards on the market. They differ in size, casing, memory and computing power. They also differ in the security features they provide. A well known and widely used system is mifare. mifare is a product family from NXP miconductors (formerly Philips). According to NXP there are about 3,5 billion mifare cards in use around the world, covering 85% of the contactless smartcard market.The mifare family contains four different types of cards: Ultralight, Classic, DESFire and SmartMX. The mifare Classic cards come in three different memory sizes:320B, 1KB and 4KB. The mifare Classic is the most widely used contactless card in the market.

Contactless smartcards are used in many applications nowadays. Contactless cards are based on radio frequency identification technology (RFID). In 1995 NXP,Philips at that time, introduced mifare. Some target applications of mifare are public transportation, access control and event ticketing. The mifare Classic card is a member of the mifare product family and is compliant with ISO 14443 up to part 3. ISO 14443 part 4 defines the high-level protocol and here the implementation of NXP differs from the standard.

Mifare Classic card is in principle a memory card with few extra functionalities.The memory is divided into data blocks of 16 bytes. Those data blocks are grouped into sectors. The mifare Classic 1k card has 16 sectors of 4 data blocks each. The first 32 sectors of a mifare Classic 4k card consists of 4 data blocks and the remaining 8 sectors consist of 16 data blocks. Every last data block of a sector is called sector trailer. A schematic of the memory of a mifare Classic 4k card.Note that block 0 of sector 0 contains special data. The first 4 data bytes contain the unique identifier of the card (UID) followed by its 1-byte bit count check (BCC). The bit count check is calculated by successively XOR-ing all UID bytes. The remaining bytes are used to store manufacturer data. This data block is read-only.The reader needs to authenticate for a sector before any memory operations are allowed. The sector trailer contains the secret keys A and B which are used for authentication.The access conditions define which operations are available for this sector.The sector trailer has special access conditions. Key A is never readable and key B can be configured as readable or not. In that case the memory is just used for data storage and key B cannot be used as an authentication key. Besides the access conditions (AC) and keys, there is one data byte (U) remaining which has no defined purpose. A data block is used to store arbitrary data or can be configured as a value block. When used as a value block a signed 4-byte value is stored twice non-inverted and once inverted. Inverted here means that every bit of the value is XOR-ed with 1. These four bytes are stored from the least significant byte on the left to the most significant byte on the right.The four remaining bytes are used to store a 1-byte block address that can be used as a pointer.The command set of mifare Classic is small. Most commands are related to a data block and require the reader to be authenticated for its containing sector. The access conditions are checked every time a command is executed to determine whether it is allowed or not. A block of data might be configured to be read only. The write command can be used to format a data block as value block or just store arbitrary data.Decrement, Increment, Restore and Transfer These commands are only allowed on data blocks that are formatted as value blocks. The increment and decre-ment commands will increment or decrement a value block with a given value and place the result in a memory register. The restore command loads a value into the memory register without any change. Finally the memory register is transferred in the same block or transferred to another block by the transfer command.