Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PUT KEY - calculation of Encrypted Key value problem

970895Jan 29 2013 — edited Jan 30 2013
Hi,

I have problem with calculation of the Encrypted key value for using in put key command. After calculation the first 8 bytes of the Encrypted Key Value are right and the rest are different. Where can I have a mistake? Similar problem have Kishan Saralaya in this thread 1752421 but he don't write where was the problem.

My algo and results:

Sequence number : 0008 (obtain from INIT UPDATE command)
the default initiate key = 404142434445464748494a4b4c4d4e4f
I want set the New key = 101112131415161718191a1b1c1d1e1f

1.
DECSessionKey = TripleDes in CBC(0181 + 0008 + 00 00 00 00 00 00 00 00 00 00 00 00) with initiate key
DECSessionKey = B4 F7 5C E0 A9 5E A3 F8 6B BD 05 1C B7 7C 0F AE

2.
Encrypted Key Value = TripleDes in CBC mode(101112131415161718191a1b1c1d1e1f) with DECSessionKey
Encrypted Key Value = D6 AA 05 53 6E BB 5C 63 25 D2 82 97 30 75 B3 AD

From JCShell I see, that encrypted Key Value must be D6 AA 05 53 6E BB 5C 63 E0 B1 8D 3A AE 9C D0 A5. As I wrote, there is a mismtach between last 8 bytes of calculated keys.

Does anybody see some mistake in my calculation?
Thank you,
Milanatik
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2013
Added on Jan 29 2013
5 comments
1,192 views