简体   繁体   English

如何计算DESFire EV1上AuthenticateISO的IV

[英]How to calculate IV on AuthenticateISO on DESFire EV1

I'm having troubles creating new IV after authenticating. 验证后创建新IV时遇到麻烦。 I'm not sure if my understanding of the concept is right, even with MIFARE documentation. 即使使用MIFARE文档,也不确定我对概念的理解是否正确。 Data on the card is fully enciphered. 卡上的数据已完全加密。

These are the steps I'm taking: 这些是我正在采取的步骤:

  • AuthenticateISO with zero IV (0x1A with 3K3DES key) 具有零IV的AuthenticateISO(具有3K3DES密钥的0x1A)
  • Response from card (encrypted RandA'): 08 48 CD A3 43 C5 00 FE 1D 78 D1 E5 A9 24 26 5A 91 00 卡的响应(加密的RandA'): 08 48 CD A3 43 C5 00 FE 1D 78 D1 E5 A9 24 26 5A 91 00
  • First 8 bytes should be CMAC and updated IV(?): 08 48 CD A3 43 C5 00 FE 前8个字节应为CMAC并更新IV(?): 08 48 CD A3 43 C5 00 FE
  • Create 3K3DES session key: 74 EF 23 87 10 E4 3B E6 BE C8 4C 41 74 03 08 A9 7F F3 FA 59 15 E4 C5 06 创建3K3DES会话密钥: 74 EF 23 87 10 E4 3B E6 BE C8 4C 41 74 03 08 A9 7F F3 FA 59 15 E4 C5 06
  • Call getValue: 90 6C 00 00 01 [FileID] 00 调用getValue: 90 6C 00 00 01 [FileID] 00
  • Response from card: A2 3C CB 70 BE 4D D5 22 91 00 卡的响应: A2 3C CB 70 BE 4D D5 22 91 00
  • Decrypt first 8 bytes from response with session key and updated IV 使用会话密钥和更新的IV解密响应中的前8个字节
  • Decrypted result: 7F 7D 80 F5 [CRC32] 解密结果: 7F 7D 80 F5 [CRC32]

After the last step, the first four bytes should be the value and the last four CRC32. 在最后一步之后,前四个字节应为值,后四个CRC32。 But for sure I'm not doing something right with IV, because result isn't correct. 但是可以肯定的是,我对IV的处理不正确,因为结果不正确。 It should be 0F A0 00 00 [CRC32] . 它应该是0F A0 00 00 [CRC32]

Could anyone have any pointers to what I'm doing wrong? 有人能指出我在做什么错吗? I've been trying to solve this for at least 2 weeks and have come nowhere. 我已经尝试解决这个问题至少2周,却一无所获。

You put Android Tag in your Question. 您在问题中放入了Android标签。 I would suggest you to use TapLinx SDK which is free of charge and offer Java Level APIs for MIFARE and some other NXP Cards. 我建议您使用免费的TapLinx SDK,并为MIFARE和其他一些NXP卡提供Java级别的API。 It makes communication to card a lot easier and Documentation is good. 它使与卡的通信更加容易,并且文档很好。

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

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