简体   繁体   English

如何在Java中解码DUKPT CBC模式?

[英]How to decode DUKPT CBC mode in Java?

我无法解码DUKPT滑动数据,我正在尝试使用其他示例,但信用卡信息尚未编码。

I had a headache trying of decoding the swipe information: 我在尝试解码滑动信息时感到头疼:

This example can help you to do it: 此示例可以帮助您做到这一点:

To Download the Java Example here: https://github.com/ricardojava/mobile/tree/master/TEST_GATE2all/src/com/bbpos To Modify the file: https://github.com/ricardojava/mobile/blob/master/TEST_GATE2all/src/com/bbpos/SimpleMain.java 要在此处下载Java示例: https : //github.com/ricardojava/mobile/tree/master/TEST_GATE2all/src/com/bbpos修改文件: https : //github.com/ricardojava/mobile/blob/master /TEST_GATE2all/src/com/bbpos/SimpleMain.java

String bdk = "0123456789ABCDEFFEDCBA9876543210"; 字符串bdk =“ 0123456789ABCDEFFEDCBA9876543210”; String ksn = "00000232100117e00027"; 字符串ksn =“ 00000232100117e00027”; String tk1 = "de8bfe769dca885cf3cc312135fe2cccfacf176235f4bdee773d1865334315ed2aefcab613f1884b5d63051703d5a0e2bd5d1988eeabe641bd5d1988eeabe641"; 字符串tk1 =“ de8bfe769dca885cf3cc312135fe2cccfacf176235f4bdee773d1865334315ed2aefcab613f1884b5d63051703d5a0e2bd5d1988eeabe641bd5d1988eeabe641”

   String key = DUKPTServer.GetDataKey(ksn, bdk);

String decryptedTLV = TripleDES.decrypt_CBC(tk1, key); 字符串解密的TLV = TripleDES.decrypt_CBC(tk1,key);

byte[] s = DatatypeConverter.parseHexBinary(decryptedTLV);

    System.out.println(new String(s));

} I hope it can help you!........ }希望它能对您有所帮助!

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

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