--Greetings to you all.1. I do not really know, if my question fits into this forum.2. Already tried reading through the algorithm to use in decrypting this data, but still not getting the needed result ought to be gotten.This is where my challenge comes fromin the process of trying to decrypt an encrypted (track2 data) from a device, i am having a little challenge while trying to decrypt this data, so as to be able to get my PAN and some other data from it (in carrying out a transaction).
In decrypting this data (after reading through the document that was been given), while taking note of its Base Derivation Key(BDK), Initially loaded key serial number and the initially loaded pin entry device key.
I have the below example in the document given, i was made to know that they actually used a 3DES-128 bits CBC Mode (padding zero) method.
and, the following are the data that were been used for its encryption.
Base Derivation Key (BDK): 0123456789ABCDEFFEDCBA9876543210
Initially Loaded Key Serial Number (KSN): FFFF9876543210E00000
Initially Loaded PIN Entry Device Key: 6AC292FAA1315B4D858AB3A3D7D5933A
Data Encryption key variant
Initially Loaded Key Serial Number (KSN): FFFF9876543210E00001
Data Encryption key variant: 448D3F076D8304036A55A3D7E0055A78
Track 2 Data (Plaintext): 1234567890ABCDEFFEDCBA0987654321
(Encrypt by 3DES-128 bits CBC Mode (padding zero))
Track 2 Data (Encrypted): D0911CD510047AC6AEE9CE8AFEDA9301
my question now is, how was the plaintext gotten from the encrypted data, because i tried using the below method below in carrying out this operation, and also used the JPOS security package, but wasn't close to getting the accurate result.
Although, this is what i have been able to do..trying to make use of this simple algorithm, but not getting it at all.
public String do3DESDecryption(String key, String text) {
String decryptedInfo = null;
try {
String key1 = key.substring(0, 16);
String key2 = key.substring(16);
decryptedInfo = doDESDecryption(key1, text);
decryptedInfo = doDESEncryption(key2, decryptedInfo);
decryptedInfo = doDESDecryption(key1, decryptedInfo);
} catch (Exception ex) {
System.out.println("What's happening"+ex.getMessage());
ex.printStackTrace();
}
return decryptedInfo;
}Will be so glad, if i can see where i am getting this wrong.Thanks for your time in reading this.Hoping to hearing from you all.
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/4b682646-892b-4b81-bfb9-328ec751af08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAgSK%3DnMre2%3DT0Rp009gG2jgC70D01yPfAjCZ%3DvNcU2XcUWKdw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAgSK%3DnMre2%3DT0Rp009gG2jgC70D01yPfAjCZ%3DvNcU2XcUWKdw%40mail.gmail.com.
Key derived = sm.getDerivedKey(bdk, ksn,true);
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/4b682646-892b-4b81-bfb9-328ec751af08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
Take a look at https://github.com/jpos/jPOS/blob/master/jpos/src/test/java/org/jpos/security/jceadapter/DUKPTTest.javaPerhaps you can load your test data into a test and see if it works for you.
--
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/00141b63-47ab-4a92-a0c4-80b41ebf94cd%40googlegroups.com.
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/cf259fc5-ac88-45cf-adf4-613751c9478f%40googlegroups.com.
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/c274eea3-2f53-45c1-9d19-0b19cd92e871%40googlegroups.com.
Hi:You need to understand the cryptography behind the operations you are doing./V
On Wed, Sep 21, 2016 at 5:01 AM, <derin...@gmail.com> wrote:
Thanks so much for your time @Victor, you have been so much of a help, and I am so glad you have been so much of help.I also tried using the decryptPIN method, in the BaseSMAdapter in the JPOS security package, to see if i can actually get the data from the Encrypted data (trying to see, if i can reverse engineer it). i.e getting the PIN and PAN from the encrypted dataAfter carrying out this operation, using this method, i was getting 00�8�������NOTE: I used the ISOUtil.hexString and the BouncyCastleProvider
but, was getting same result.Thank you so much ONCE AGAIN
On Tuesday, September 20, 2016 at 11:17:55 PM UTC+1, Victor Salaman wrote:
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.