It's our great honour to announce the Industry’s First VHBR CCID reader - VHBR Dual interface smart card reader vR504. It is able to support the world’s fastest ePassports.

To celebrate the new product release, there is Special Discount for New Registered Members in our store.
- Get $20.00 OFF instantly for smart card reader vR504, R502 and bR301

Come to get the readers now!

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

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

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

Postby 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: 11
Joined: Wed Jun 20, 2018 4:06 am
Points: 70
Contact:

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

Postby happy123654 » Fri Jul 13, 2018 5:12 am

Because the function implements SHA_1 calculation in the last step.

DaHuFa
Posts: 14
Joined: Mon Jun 04, 2018 5:07 am
Points: 100
Contact:

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

Postby 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: 31
Joined: Wed Nov 04, 2015 7:23 am
Points: 206
Contact:

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

Postby BirdKing » Fri Jul 13, 2018 5:42 am

The sample applet maybe use ALG_EC_SVDP_DH_PLAIN.


Return to “Questions & Answers”

Who is online

Users browsing this forum: No registered users and 0 guests

JavaCard OS : Disclaimer