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!

Hi, I have a following code: Cipher cipher = Cipher.getInstance(Cipher.

828571Jan 11 2011 — edited Jan 19 2011
Hi,

I'm using JavaCard Development Kit and I have script file where I place all my apdu commands. I create instance of Cipher object inside my applet constructor. When I use ALG_RSA_NOPAD, my first apdu command fail.
I have a following code:
Cipher cipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
and when I create Cipher object like this, I receive execution error when I send this command to simulator:
//create applet instance
0x80 0xB8 0x00 0x00 0x09 0x07 0xA0 0x00 0x00 0x00 0x03 0x20 0x10 0x00 0x7F;

response on the above apdu command is:
CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 09, 07, a0, 00, 00, 00, 03, 20, 10, 00, Le: 00, SW1: 64, SW2: 44

When I change algorithm, and use ALG_RSA_PKCS1 instead of ALG_RSA_NOPAD, my applet is created succesfully, but I read that I cannot use ALG_RSA_PKCS1 because "This algorithm is only suitable for messages of limited length. The total number of input bytes processed may not be more than k-11, where k is the RSA key's modulus size in bytes", and my message is same size as modulus.

Does anybody have idea how to solve this?

Thanks,
Vuk
This post has been answered by safarmer on Jan 18 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2011
Added on Jan 11 2011
26 comments
1,161 views