How to decode DUKPT CBC mode in Java?

404 Views Asked by At

I can't decode the DUKPT swipe Data, I'm trying using differers examples but the credit card information is encoded yet.

1

There are 1 best solutions below

0
On

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

String bdk = "0123456789ABCDEFFEDCBA9876543210"; String ksn = "00000232100117e00027"; String tk1 = "de8bfe769dca885cf3cc312135fe2cccfacf176235f4bdee773d1865334315ed2aefcab613f1884b5d63051703d5a0e2bd5d1988eeabe641bd5d1988eeabe641";

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

String decryptedTLV = TripleDES.decrypt_CBC(tk1, key);

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

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

} I hope it can help you!........