How to authenticate NTAG213 with ACR122U

旧巷老猫 提交于 2019-12-06 07:28:15

问题


I'm using an ACR122U reader with an NTAG213 card. The card is password (reading and writing) protected with the password 52 84 00 08. What are the APDU commands I should run to authenticate the card and also to read pages 30 and 31 of it once authenticated?

I know with the MiFare 1k I could load the password and authenticate a sector, but I'm not sure how authentication works with the NTAG213 cards with the ACR122U readers.


回答1:


With the ACR122U you would need to send direct commands to the PN532 NFC controller chip inside the reader in order to exchange such low-level commands. For instance, you could use the InCommunicateThru command to send a raw command to the tag:

+-----+-----+-----+-----+--------------+-----------+-----+
| CLA | INS | P1  | P2  | Lc           | DATA      | Le  |
| FF  | 00  | 00  | 00  | 2 + len(CMD) | D4 42 CMD | --  |
+-----+-----+-----+-----+--------------+-----------+-----+

That way, you could send the password authentication command (PWD_AUTH) to the tag:

FF 00 00 00  07  D4 42  1B  52 84 00 08
                        --  -----------
                        |   |
                        |   \-> password
                        \-> command: PWD_AUTH

The response to this command should be something like

D5 43 00  PACK  90 00

Similarly, you can send a READ command to read any page:

FF 00 00 00  04  D4 42  30  XX

where XX is the 1-byte page address.

Note that the read command should also work using the (more robust?) InDataExchange command:

FF 00 00 00  05  D4 40 01  30  XX


来源:https://stackoverflow.com/questions/44237726/how-to-authenticate-ntag213-with-acr122u

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