Unable to authenticate to a MIFARE Classic tag used as NDEF tag

随声附和 提交于 2019-12-04 20:16:17

The status word 6300 indicates that authentication fails. Thus you are most likely using the wrong key for authentication.

You currently try to authenticate with key A (0x60) with the key value FFFFFFFFFFFF to sector 1 (0x04, since it starts at block 4).

NXP's proprietary NDEF mapping specification defined in the following datasheet is used when a MIFARE Classic tag is formatted for use as an NDEF tag:

That NDEF mapping changes the access keys to well-defined values:

  • MAD sector 0 (and sector 16 on 4K cards):

    • Key A will be set to A0A1A2A3A4A5.
    • Key B may be set to any value. Android, for instance, will leave it at the default value FFFFFFFFFFFF.
    • Access conditions may be set to either allow read/write access with both keys or to allow read-only access with key A and read/write access with key B.
  • NDEF sectors (as declared in the MAD, within the range 1..15 (and 17..39 on 4K cards)):

    • Key A will be set to D3F7D3F7D3F7.
    • Key B may be set to any value. Android, for instance, will leave it at the default value FFFFFFFFFFFF.
    • Access conditions may be set to either allow read/write access with both keys or to allow read-only access with key A and read/write access with key B.
  • Other sectors (as declared in the MAD, within the range 1..15 (and 17..39 on 4K cards)) that are not used for the NDEF mapping:

    • Keys and access conditions are set to their application-specific (or default) values and are not touched by the NDEF mapping specification.

Thus, as the tag uses the NDEF mapping and you try to authenticate to the first NDEF sector, you would instead need to use the NDEF key A with the value D3F7D3F7D3F7 instead:

FF 82 0000 06 D3F7D3F7D3F7
FF 86 0000 05 01 00 04 60 00

Note that depending on the configuration of the access bits you might only have read access with key A.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!