JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Time duration on RSA Encryption

JavaCard Applet Development Related Questions and Answers.
AmigoJack
Posts: 17
Joined: Thu Nov 19, 2015 4:56 am
Points :87
Contact:

Time duration on RSA Encryption

Post by AmigoJack » Tue May 02, 2017 3:43 am

I am testing RSA Encryption with keys length 768 and 1024.

In debugging window, about 4000 us for 768 key length, about 3000 us for 1024 key length.

For other keys, the time duration increases from 512 to 1984.

Does anyone have any idea about time duration?


Code: Select all

private final static short RSA_KEY_SIZ = KeyBuilder.LENGTH_RSA_768;

rsa_KeyPair =  new KeyPair(KeyPair.ALG_RSA_CRT, RSA_KEY_SIZE);

cipherRSA  =  Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);

cipherRSA.init(rsa_PrivateCrtKey, Cipher.MODE_ENCRYPT);

 short cyphertext = cipherRSA.doFinal(inpBuffer,(short) 0, (short) (RSA_KEY_SIZE/8), buf, ISO7816.OFFSET_CDATA);
 
 

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3055
Contact:

Re: Time duration on RSA Encryption

Post by UNKNwYSHSA » Tue May 02, 2017 4:30 am

The data length maybe causes this problem.
If the data length is greater than 768 bits (96 bytes) and less than 1024 bits(128 bytes), the encryption with RSA length 768 needs twice calculation for the data block, but encryption with RSA length 1024 needs once only.
sense and simplicity

AmigoJack
Posts: 17
Joined: Thu Nov 19, 2015 4:56 am
Points :87
Contact:

Re: Time duration on RSA Encryption

Post by AmigoJack » Wed May 03, 2017 11:23 pm

Thank you UNKNwYSHSA. It helps.

In fact, my goal is to find difference of duration on card for different length of key. So that I can evaluate the RSA performance on real card. Do you have any conclusion or experience on this?

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 70 guests

JavaCard OS : Disclaimer