Datasheet
BNW Block Not Writable
BAE Block Access Error
BNA Block Not Authenticated
AKW Access bits or Keys not Writable
UKB Use Key B for authentication
UKA Use Key B for authentication
KNC Keys not changeable
BIH Block is too high (i.e. bigger than 63 at MiFare 1k)
ATE Authentication Error (i.e. wrong key)
NKS No Key Select, select a temporary or a static key
CNS Card is Not Selected
NB0 Number of Blocks to Read is 0
Table 13: Overview of error codes
Appendix 3: General Information on MiFare Systems
Since MiFare transponders have serveral specialties esp. with regard to the access system
used, this paragraph is meant to give a quick overview about these topics. For an even
deeper understanding of the matter, please refer to the respective datasheets of the MiFare
transponders you are using. You can get these directly from NXP after signing an NDA via
their website.
Memory Organisation
The memory of MiFare classic chips is organized in sectors composed of several numbers of
data blocks and one trailer. MiFare 1K chips contain 16 sectors of 3 data blocks and one (the
fourth) trailer (Table 14). For the lower 32 sector of MiFare 4K chips the same applies. The
higher 8 sectors are composed of 15 data blocks and one (the 16th) trailer block(Table 15).
All blocks are read-/writable only if the corresponding sector was successfully authenticated.
The Trailer Block:
The trailer contains two secret keys (A and B) to authenticate the corresponding sector and
information about access rights (the access bits). Teh trailer block is always the last block in a
sector. This means that each sector can have its own keys for giving write or read access.
Data blocks:
The data blocks contain 16 read-/writable bytes depending on the access bits in the sector
trailer, except block 0 in sector 0, which is a read-only manufacturer block. These blocks can
configured as normal read/write blocks or as value blocks.
metraTec MiFare Protocol Guide Page 33 of 38