简体   繁体   English

MSR DUKPT的MAC变种?

[英]MAC variant of MSR DUKPT?

Currently I am working on a ChipCard EMV device decryption. 目前我正在进行ChipCard EMV设备解密。 Down below is the related data I have after using the transaction (TLV format as Tag Length Value): 下面是我使用事务后的相关数据(TLV格式为Tag Length Value):

<DFDF54> --- It means KSN
0A
950003000005282005B4 


<DFDF59>---- per instruction, it is called Encrypted Data Primative
82      ---- length of value in hex, when more than 255 degits, use 82
00D815F35E7846BF4F34E56D7A42E9D24A59CDDF8C3D565CD3D42A341D4AD84B0B7DBFC02DE72A57770D4F795FAB2CE3A1F253F22E0A8BA8E36FA3EA38EE8C95FEBA3767CDE0D3FBB6741A47BE6734046B8CBFB6044C6EE5F98C9DABCD47BC3FD371F777E7E1DCFA16EE5718FKLIOE51A749C7ECC736CB7780AC39DE062DAACC318219E9AAA26E3C2CE28B82C8D22178DA9CCAE6BBA20AC79AB985FF13611FE80E26C34D27E674C63CAC1933E3F9B1BE319A5D12D16561C334F931A5E619243AF398D9636B0A8DC2ED5C6D1C7C795C00D083C08953BC8679C60

I know BDK for this device is 0123456789ABCDEFFEDCBA9876543210 . 我知道这个设备的BDK是0123456789ABCDEFFEDCBA9876543210 Per decryption instruction, it mentioned that DFDF59 contains the following tags: 根据解密指令,它提到DFDF59包含以下标记:

FC<len>/* container for encrypted generic data */
    F2<len>/*container for Batch Data*/
           ... /*Batch Data tags*/
    F3<len>/*container for Reversal Data, if any*/
           ... /*Reversal Data tags*/

Per instruction, it mentioned " MAC variant of MSR DUKPT ", where MAC stands for message authentication code, and " Parse the data through TLV format. For encrypted data tag, use TDES_Decrypt_CBC to decrypt it ". 根据指令,它提到了“ MSR DUKPT的MAC变体 ”,其中MAC代表消息认证码,“ 通过TLV格式解析数据。对于加密数据标签,使用TDES_Decrypt_CBC对其进行解密 ”。

I tried to use 3DES DUKPT using KSN, BDK, and encrypted data DFDF59. 我尝试使用KES,BDK和加密数据DFDF59来使用3DES DUKPT。 It wouldn't work. 它不会起作用。 Can anyone in decryption field give me some advice? 解密领域的任何人都可以给我一些建议吗? Our vendor is very reluctant to share their knowledge ... 我们的供应商非常不愿意分享他们的知识......

I have no idea how MAC is really playing a role here in decryption.... I thought MAC is just an integrity check.... I am using session key for 3DES DUKPT that was generated from KSN and BDK. 我不知道MAC在解密方面是如何真正发挥作用的......我认为MAC只是一个完整性检查....我正在使用从KSN和BDK生成的3DES DUKPT的会话密钥。 this works for other decryptions in this device, but doesn't solve the DFDF59 (chip card EMV decryption).... That is why I start to wonder whether I am using the right session key or not.... Feel free to just throw ideas out there. 这适用于此设备中的其他解密,但不解决DFDF59(芯片卡EMV解密)....这就是为什么我开始怀疑我是否使用正确的会话密钥....随意只是把想法扔出去。 Thank you! 谢谢!

If you look closely at DUKPT internals it generates a transaction key out of the current future keys and encryption counter. 如果仔细观察DUKPT内部,它会从当前的未来密钥和加密计数器中生成一个事务密钥。 This 'transaction key' for a specific KSN has several variants (which effectively are just xor masks that you put on the transaction key to differentiate it for PIN, MAC req, MAC rsp, data encryption req and rsp usages). 特定KSN的这个“事务密钥”有几种变体(实际上只是xor掩码,您可以将其放在事务密钥上,以区分PIN,MAC req,MAC rsp,数据加密请求和rsp使用)。 These variants mean that you use a different key to generate PIN and different key to encrypt data (so that you cannot ie. decrypt/attack PINblock when able to select data buffer arbitrarily). 这些变体意味着您使用不同的密钥生成PIN和不同的密钥来加密数据(这样您就无法在任意时选择数据缓冲区时解密/攻击PINblock)。 Using MAC variant means only that for the encryption operation you will be using a certain mask for the DUKPT transaction key. 使用MAC变量仅表示对于加密操作,您将使用DUKPT事务密钥的某个掩码。

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

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