13.56MHz MIFARE Reader Module

Sector Trailer and Access Conditions

The last block of each sector contains configuration data for the sector. This configuration data includes key A, key B and the access conditions. The first six byte (byte 0…5) of the Sector Trailer contain key A data, the last six bytes (byte 10…15) contain key B data. Byte number 6 to byte number 9 contain the access conditions for each block of the sector. It is possible to configure the access rights (read, write, increment, decrement, restore) different for each block in the sector and in dependence to the key used in the authentication (login) procedure. Access conditions for the Sector Trailer himself are different form access conditions of a data block (increment, decrement, copy is never allowed for the Sector Trailer as of course this block never contains value data). The access conditions are stored redundant for data security reasons. Examples for Sector Trailers / Access Conditions Ticketing Applications For ticketing applications it is recommended to use both keys of the MIFARE® card. Key A as a field key with rights for read, copy and decrement only. Key B is used as master key with full access rights (including increment and changing the access conditions and keys). Data Handling Applications For data handling Applications it is recommended to disable ticketing operations (increment, decrement, copy). Key A is user as slave key with reading rights only. Key B is used as master key with read/write access to all blocks. No Security, open configuration For open configuration applications it always possible not to change the sector trailer (FF 07 80 xx) and use the configuration as defined by the card manufacturer. Key A is set as master key with full access rights and key B is disabled.

Please consider that enabled keys are not readable and therefore return 00 on reading.

It is possible to configure each block of one sector as Value Block (Ticketing) or Data Block. As an example you may uses following values for the access rights.

Block 0 Block 1 Block 2 Sector Trailer
V V V 08 77 8F FF
V V D 48 77 8B FF
V D V 28 77 8D FF
V D D 68 77 89 FF
D V V 18 77 8E FF
D V D 58 77 8A FF
D D V 38 77 8C FF
D D D 78 77 88 FF

Where “D” denotes a data block and “V” value block. All access conditions are configured that way that key B has write access to the Sector Trailer and so may change the configuration. Each of the 16 sectors consists of 4 blocks (including the sector trailer). Block 0 of sector 0 contains the serial number and some manufacturer data, it is read only. For detailed description of the Sector Trailer /Access Conditions please refer to the datasheets of your chip manufacturer. As it is possible to destroy the tag (permanently make a block read and write protected) it is strongly recommended not to change the Sector Trailer without detailed knowledge and under safe environment with good reading/writing only.

Examples:

To use a whole sector number 4 for data storage with key A (read only key) set to 001122334455 and key B (read/write key) set to 66778899AABB the following instruction sequence should be used.

“s” select a single TAG “l04<CR>” login to the sector (or appropriate login) “w13001122334455787788FF66778899AABB” write keys and access conditions This command will cause a “read after write” error, due to the fact that key areas are read only. “poff” turn off the field (reset TAG) “s” reselect the TAG “l04…” do login with new keys (test writing)

To set the first two blocks of a sector for ticketing (f.e. value and backup block) and the third block to data mode and the keys same as above set the sector trailer to the value: ”00112233445548778BFF66778899AABB”

Mifare Classic 4K Card,Mifare 4K Full Colour Printing Cards,Mifare 4K RFID Cards,NXP Mifare 4k Pre-printed cards,

1 This values are defined by tranmission speed (RS232 @ 9600/19200/38400/57600,n,8,1 ~ 1,041/0,52/0,26/0,17 ms/character). The timing
data in this table is calculated for 9600 baud. No delay between characters is assumed and the timing data is calculated for ASCII mode.
When using binary mode this values will increase due to the binary mode frame, which requieres more data tranmitted (STX, …).
2 Execution time on faulty communication or data failure (f.e. key wrong, no value block, access to unauthenticated sector). Timing data in this
table is typical error detection time and will vary with error type.
3 If the a data byte of the command instruction does not match the ASCII Hex Format (f.e. “r0G”) the reader module is responding almost
immediately (<170us) after the second nibble of the faulty data byte by transmitting a question mark, carriage return and linefeed
(“?<CR><LF>”).
4 Execution time on operation success.
5 Execution time on “no Tag”/timeout-error (max. processing time)
6 In binary Mode the reader module does not send a response to the reset command. Nevertheless the reader is executing a power on reset
and ready again in approximately 68 ms.
7 If no TAGs is present the reader will wait until a TAG enters the field. If the TAGs remains in the field the serial numbers are repeated
continuously.
8 This command will not terminate automatically (refer “4.3.3 Continuous Read” on page 14)
9 Select includes a card reset before (10 ms).
10 All write operations include a read after write.