Mifare 变更 KEY A 和 B
我有一个 ACR122U 非接触式 NFC 读卡器。我买了很多空白 RFID Mifare 4k 标签。他们的默认身份验证密钥 A 和密钥 B 是 FF FF FF FF FF FF。
现在我想把它们改成别的东西。我正在使用 APDU 结构。我正在发送这样的命令,效果很好:
byte[] baData = { 0x01, 0x00, (byte)i, 0x60, 0x00 };
APDUCommand apdux3 = new APDUCommand((byte)0xFF, (byte)0x86, (byte)0x00, (byte)0x00, baData, 0x05);
效果很好。我不知道这个接口和模型意味着什么,但是使用这种类型和结构,我想更改KEY A和KEY B。
请帮助我。我找不到任何文件。
问候
I have an ACR122U Contactless NFC reader. I bought a lot of blank RFID Mifare 4k tags. Their default Authentication KEY A and KEY B is FF FF FF FF FF FF.
Now I want to change them to something else. I'm using APDU structure. I'm sending commands like this and it works well:
byte[] baData = { 0x01, 0x00, (byte)i, 0x60, 0x00 };
APDUCommand apdux3 = new APDUCommand((byte)0xFF, (byte)0x86, (byte)0x00, (byte)0x00, baData, 0x05);
It works well. I don't know what this interface and model means, but using this type and structure, I want to change KEY A and KEY B.
Please help me. I can't find any document.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确实如此,芯片在交付时带有密钥 A 和 B 的默认密钥 FF FF FF FF FF FF。
要更改它们,您必须使用正确的访问位对卡进行身份验证。
注意:Mifare 密钥的组成如下:
要更改密钥,您必须验证扇区预告片,然后写入新密钥+新访问条件(如果您也想更改它们)。
示例
新密钥 A = 00 11 22 33 44 55
访问位未被覆盖
未使用密钥 B(因此 FF FF FF FF FF FF)
=>写入扇区预告片 00 11 22 33 44 55 FF 0F 00 FF FF FF FF FF FF FF
更多详细信息请参见 NXP 网站或直接访问 以下链接。
默认访问位通常为 FF 0F 00,允许写入和读取每个块以及读取和写入密钥 B。
That's true, chips are delivered with default key FF FF FF FF FF FF for key A and B.
To change them you have to authenticate the card with the correct access bits.
Note: the Mifare key is composed as follow:
To change your keys you have to authenticate the Sector Trailer and then write your new keys + new access conditions if you want to change them too.
Example
New key A = 00 11 22 33 44 55
Access bits not overwritten
Key B not used (so FF FF FF FF FF FF)
=> Write to Sector Trailer 00 11 22 33 44 55 FF 0F 00 FF FF FF FF FF FF FF
Further details are on the NXP website available or directly at the following link.
Default Access Bits are usually FF 0F 00, and allow to write and read each block and to read and write key B.