Page
38
of
70
Copyright © Access-IS 2016
7.3 MIFARE authenticate block (key A or key B)
Use this command to authenticate the specified MIFARE block against the MIFARE
media’s internal
Key A or B.
You must load the MIFARE key using
(on page 37) before sending this command.
The MIFARE authenticate block command is largely used for test purposes. The other MIFARE
commands use this command internally to check that the key is loaded and responds. It checks
whether the MIFARE keys are correctly loaded.
Note:
This command is NOT applicable to MIFARE Ultralight cards and fails if executed on
Ultralight cards. Ultralight cards do not support the authenticate command.
7.3.1 MIFARE command bytes
MIFARE command bytes
Command header
Command code
Block number
[0x00]
[0x04]
or
[0x44]
- Authenticate block (Key A)
Block number
[0x14]
or
[0x54]
- Authenticate block (Key B)
[0x84]
or
[0xC4]
- RF select and authenticate block (Key A)
[0x94]
or
[0xD4]
- RF select and authenticate block (Key B)
7.3.2 MIFARE response bytes
MIFARE response bytes
Response header
Response code
Block number
Status bytes
[0x00]
Any one of the following
values (Command code + 1)
[0x05]
or
[0x45]
[0x15]
or
[0x55]
[0x85]
or
[0xC5]
[0x95]
or
[0xD5]
Block number
[0x90][0x00]
Success
Failure
Refer to page 48 for information on MIFARE failure status codes.
7.3.3 Example
This command successfully authenticates block number 0 against Key A in the media.
Command:
[0x00][0x04][0x00]
Response:
[0x00][0x05][0x00][0x90][0x00]
7.4 MIFARE read block (key A or key B)
Use this command to authenticate the specified MIFARE block against the MIFARE
media’s internal
Key A or B and then read the contents of the block.
You must load the MIFARE key using
(on page 37) before sending this command.
Note:
This command is NOT applicable to MIFARE Ultralight cards and fails if executed on
Ultralight cards. To read Ultralight cards, use the MIFARE Ultralight read block command (on page
44).