简体   繁体   English

ACR122U 的 MIFARE Classic 1K 加载身份验证密钥失败

[英]MIFARE Classic 1K load authentication keys failure with ACR122U

I am using an ACR122U NFC reader/writer and a MIFARE Classic 1K card.我使用的是 ACR122U NFC 读写器和 MIFARE Classic 1K 卡。 To load authentication keys for the MIFARE card, I use the following APDU command:要加载 MIFARE 卡的身份验证密钥,我使用以下 APDU 命令:

FF 82 20 00 06 FF FF FF FF FF FF

The reader responds with 90 00 (indicating success).阅读器响应90 00 (表示成功)。 However, on another PC I have the same reader/writer and the same tag but I receive the response code 63 00 , which means that the operation failed.但是,在另一台 PC 上,我有相同的读取器/写入器和相同的标签,但我收到响应代码63 00 ,这意味着操作失败。

When I read the ACR122U documentation it states the command as当我阅读 ACR122U 文档时,它将命令声明为

FF 82 00 00 06 <KEY>

This byte is named key structure and its value is 00 in the documentation.这个字节被命名为密钥结构,在文档中它的值为 00。 Can this byte be the source of this problem?这个字节可能是这个问题的根源吗?

Can anyone help me on this and explain the value of the key structure byte?任何人都可以帮助我并解释密钥结构字节的值吗?

I'm rather surprised that you found one ACR122U that supports key structure (P1) set to 0x20.我很惊讶您发现一个 ACR122U 支持设置为 0x20 的密钥结构 (P1)。 The API manual of the reader (see section 5.1 Load Authentication Keys ) clearly indicates that values other than 0x00 are reserved (ie must not be used). 阅读器API 手册(请参阅第 5.1 节加载验证密钥)明确指出 0x00 以外的值是保留的(即不得使用)。 This means that the ACR122U only supports card keys (ie authentication keys for cards) in volatile memory (ie keys are cleared from memory when the reader is unplugged).这意味着 ACR122U 仅支持易失性存储器中的卡密钥(即卡的验证密钥)(即当读卡器拔下时,密钥会从存储器中清除)。

You can find the definition of the key structure (P1) byte in the PC/SC specification (in Part 3. Requirements for PC-Connected Interface Devices ):您可以在PC/SC 规范中找到密钥结构 (P1) 字节的定义(在Part 3. Requirements for PC-Connected Interface Devices 中):

  • Bit 7: This bit indicates if the key transmitted in this command is a card key ('0') or a reader key ('1').位 7:该位指示此命令中传输的密钥是卡密钥 ('0') 还是读卡器密钥 ('1')。 Reader keys are keys used to encrypt card keys during transmission in the LOAD KEYS command (see bit 6).读取器密钥是用于在 LOAD KEYS 命令中传输期间加密卡密钥的密钥(参见位 6)。
  • Bit 6: The key transmitted in this command is transmitted in plain text ('0') or encrypted ('1') using a reader key (see bits 3..0).位 6:此命令中传输的密钥以纯文本 ('0') 或使用读取器密钥加密 ('1') 传输(参见位 3..0)。
  • Bit 5: This bit indicates if the transmitted key should be stored in volatile ('0') or non-volatile ('1') memory.位 5:该位指示传输的密钥应存储在易失性 ('0') 或非易失性 ('1') 存储器中。
  • Bit 4: Reserved and always set to '0'.位 4:保留并始终设置为“0”。
  • Bit 3..0: The reader key number used for encrypteion of the transmitted key if bit 6 is set.位 3..0:如果设置了位 6,则用于加密传输密钥的阅读器密钥编号。

Load Authentication Keys加载身份验证密钥

find the attached picture找到附加的图片

load key Image加载密钥图像

Key Structure: 00 key loaded into the reader volatile memory Key Number: 00~01 key location on the reader Key: the key value loaded into the reader eg {FF FF FF FF FF FF}密钥结构:00 密钥载入读写器易失性存储器 密钥编号:00~01 读写器上的密钥位置 密钥:载入读写器的密钥值,例如 {FF FF FF FF FF FF}

the response : 90 00 the operation completed successfully : 63 00 the operation failed响应:90 00 操作成功完成:63 00 操作失败

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM