Excited to tell you that our welfare activity has been upgraded - Paying only $5.00 + Freight to get JCOP J3H145 card and A40CR card.
Please check this post for more details.

Moreover, if you want to get Free Samples by Paying Freight only , please check this page.

Why the byte length of KeyAgreement.generateSecret() is 20

JavaCard Applet Development Related Questions and Answers.
DaHuFa
Posts: 36
Joined: Mon Jun 04, 2018 5:07 am
Points :256
Contact:

Why the byte length of KeyAgreement.generateSecret() is 20

Post by DaHuFa » Fri Jul 13, 2018 5:10 am

Hello,
I write a applet to implement KeyAgreement recently. I create a 256 bits EC key, then call KeyAgreement.generateSecret(). In the end, the length of result is 20 bytes. Why? My EC key length is 256 bits, 32 bytes. Why my result length is 20 bytes?

happy123654
Posts: 29
Joined: Wed Jun 20, 2018 4:06 am
Points :162
Contact:

Re: Why the byte length of KeyAgreement.generateSecret() is 20

Post by happy123654 » Fri Jul 13, 2018 5:12 am

Because the function implements SHA_1 calculation in the last step.

DaHuFa
Posts: 36
Joined: Mon Jun 04, 2018 5:07 am
Points :256
Contact:

Re: Why the byte length of KeyAgreement.generateSecret() is 20

Post by DaHuFa » Fri Jul 13, 2018 5:29 am

But my sample card which installed other's applet return 32 bytes. I think there maybe something I don't know....

BirdKing
Posts: 41
Joined: Wed Nov 04, 2015 7:23 am
Points :294
Contact:

Re: Why the byte length of KeyAgreement.generateSecret() is 20

Post by BirdKing » Fri Jul 13, 2018 5:42 am

The sample applet maybe use ALG_EC_SVDP_DH_PLAIN.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 5 guests

JavaCard OS : Disclaimer