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.

getS(byte[] buffer, short offset)

JavaCard Applet Development Related Questions and Answers.
Girr16
Posts: 10
Joined: Tue Jun 14, 2016 2:23 am
Points :114
Contact:

getS(byte[] buffer, short offset)

Post by Girr16 » Tue Jul 05, 2016 5:00 am

I am studying ECC on javacard. I cannot understand the related API method:



- getS(byte[] buffer, short offset) : this method returns the value of the secret key in plaintext form.
IMO, the private key is supposed to be secret, and no one can get it. Why does this return the key?
You do not have the required permissions to view the files attached to this post. Please login first.

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

Re: getS(byte[] buffer, short offset)

Post by mabel » Tue Jul 05, 2016 8:39 am

Girr16 wrote:- getS(byte[] buffer, short offset) : this method returns the value of the secret key in plaintext form.
IMO, the private key is supposed to be secret, and no one can get it. Why does this return the key?


The S parameter is indeed the private key of the ECC. The function ECPrivateKey.getS(...) is almost never used since objects KeyAgreement and Signature have a Private key parameter. You might sometimes use the getS function to verify the value of your private key in debug mode.

Girr16
Posts: 10
Joined: Tue Jun 14, 2016 2:23 am
Points :114
Contact:

Re: getS(byte[] buffer, short offset)

Post by Girr16 » Tue Jul 05, 2016 11:32 pm

Thank you for your answer.

But what makes me s little surprised is that we can indeed get the private key via this method.

User avatar
lostsiwonlw
Posts: 55
Joined: Fri Jul 31, 2015 9:09 pm
Points :358
Contact:

Re: getS(byte[] buffer, short offset)

Post by lostsiwonlw » Wed Jul 06, 2016 11:26 pm

Girr16 wrote:But what makes me s little surprised is that we can indeed get the private key via this method.


The card won't stop you from getting the private key in any way. It provides you more flexibility but you also have more responsibility.
Searching for meaning...

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 18 guests

JavaCard OS : Disclaimer