Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

Throw CryptoException when signing

JavaCard Applet Development Related Questions and Answers.
mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

Throw CryptoException when signing

Post by mose05 » Thu Oct 27, 2016 11:07 pm

When I used Signature to sign, it always threw CryptoException, reason value is 5. Does anyone have this experience? How can I solve this issue?
Thanks a lot.

User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1705
Contact:

Re: Throw CryptoException when signing

Post by mabel » Fri Oct 28, 2016 3:55 am

Tell us the Signature algorithm and padding type you used.
Last edited by mabel on Fri Oct 28, 2016 4:33 am, edited 1 time in total.

mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

Re: Throw CryptoException when signing

Post by mose05 » Fri Oct 28, 2016 3:58 am

mabel wrote:Tell us the Signature algorithm and filler type you used.


Signature algorithm: ALG_RSA_SHA_512_PKCS1

RSA key length: 512bits

User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1705
Contact:

Re: Throw CryptoException when signing

Post by mabel » Fri Oct 28, 2016 4:54 am

The Signature data length that pkcs1 padding algorithm needs should be less than (64-11) bytes.
However, SHA512 Hash result is just 512, which doesnot satisfy with Signature data length requirement. So it will throw exception.

tomc2016
Posts: 12
Joined: Tue Feb 16, 2016 3:45 am
Points :109
Contact:

Re: Throw CryptoException when signing

Post by tomc2016 » Fri Oct 28, 2016 5:08 am

Don't use RSA512 to do the computations. Use RSA1024 or RSA2048 instead. The computation speed of RSA1024 and RSA2048 is also very fast.

mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

Re: Throw CryptoException when signing

Post by mose05 » Fri Oct 28, 2016 5:12 am

Thanks for all the help. I got it.

tay00000
Posts: 161
Joined: Tue Sep 27, 2016 10:58 am
Points :2324
Contact:

Re: Throw CryptoException when signing

Post by tay00000 » Mon Oct 31, 2016 9:50 am

Just curious, which card are you using that will support Signature.ALG_RSA_SHA_512_PKCS1 ?

I am interested in getting one too.

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

Re: Throw CryptoException when signing

Post by UNKNwYSHSA » Mon Oct 31, 2016 10:42 pm

Same question.
sense and simplicity

mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

Re: Throw CryptoException when signing

Post by mose05 » Mon Oct 31, 2016 11:26 pm

tay00000 wrote:Just curious, which card are you using that will support Signature.ALG_RSA_SHA_512_PKCS1 ?

I am interested in getting one too.

My colleague gave it to me. I don't know the card model either. It's just a white blank card. Sorry.

mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

Re: Throw CryptoException when signing

Post by mose05 » Mon Oct 31, 2016 11:28 pm

UNKNwYSHSA wrote:Same question.


My colleague gave it to me. I don't know the card model either. It's just a white blank card. Sorry.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 118 guests

JavaCard OS : Disclaimer