Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

DES Encryption

Algorithm School

Moderator: UNKNwYSHSA

Joanly
Posts: 5
Joined: Tue May 03, 2016 3:44 am
Points: 192
Contact:

DES Encryption

Postby Joanly » Tue Jul 04, 2017 2:10 am

I would like to implement secure channel protocol. Now I have already completed authentication with the card.
But when I tried to decrypt the data, the error exception "60 66" is thrown.

My code

Code: Select all

try{
scChannel=GPSystem.getSecureChannel();
LC= apdu.setIncomingAndReceive();
numBytes=scChannel.unwrap(buffer,(short)ISO7816.OFFSET_CDATA,(short)LC);
apdu.setOutgoingAndSend((short)ISO7816.OFFSET_CDATA,(short)LC);
}
catch(Exception e)
{
ISOException.throwIt((short0x6066);
}


Can anybody help me to find out where I made mistake? It's hard for me to solve this problem. Thanks so much.

tay00000
Posts: 112
Joined: Tue Sep 27, 2016 10:58 am
Points: 1478
Contact:

Re: DES Encryption

Postby tay00000 » Tue Jul 04, 2017 6:52 am

Please catch and throw a proper exception. 0x6066 is your own exception code and not the standard defined ISO7816 exception codes.

Please modify your catching of exception by throwing a proper ISO7816 standardized exception otherwise it is very hard to debug.


Return to “Algorithm School”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer