Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

Do hash on PC and send digest to my card for signing

Algorithm School

Moderator: UNKNwYSHSA

Christy16
Posts: 11
Joined: Wed Dec 21, 2016 11:45 pm
Points: 154
Contact:

Do hash on PC and send digest to my card for signing

Postby Christy16 » Tue Mar 14, 2017 3:33 am

My card supports ALG_ECDSA_SHA. As we all know,for java card, hash calculation is time-consuming,let along data transferring time. Thus I want to do hash on pc and then send digest to my card for signing.
But I don't know how to do this. Any help?
Last edited by Christy16 on Tue Mar 14, 2017 6:11 am, edited 1 time in total.

popmun09
Posts: 36
Joined: Tue Feb 16, 2016 9:49 pm
Points: 226
Contact:

Re: Do hash on PC and send digest to my card for signing

Postby popmun09 » Tue Mar 14, 2017 5:14 am

Try to use cipher instead of hash.

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

Re: Do hash on PC and send digest to my card for signing

Postby mabel » Tue Mar 14, 2017 6:18 am

Use signPreComputedHash, which can help you generate the signature of the precomputed hash data. But you java card version should support
since 3.

Detailed info:
signPreComputedHash

public abstract short signPreComputedHash(byte[] hashBuff,
short hashOff,
short hashLength,
byte[] sigBuff,
short sigOffset)
throws CryptoException

Generates the signature of the precomputed hash data.

A call to this method also resets this Signature object to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to sign another precomputed hash.

Note:
This method throws an exception if the underlying signature algorithm does not compute a distinct message digest value prior to applying cryptographic primitives. These algorithms throw exception - DES, triple DES, AES, and KOREAN SEED.
Any data previously accumulated from previous calls to the update method are discarded.
The hash and output buffer data may overlap.

Parameters:
hashBuff - the input buffer of precomputed hash to be signed
hashOffset - the offset into the buffer where the hash begins
hashLength - the byte length of the hash
sigBuff - the output buffer to store signature data
sigOffset - the offset into sigBuff at which to begin signature data

Returns:
number of bytes of signature output in sigBuff

Throws:
CryptoException - with the following reason codes:
CryptoException.UNINITIALIZED_KEY if key not initialized.
CryptoException.INVALID_INIT if this Signature object is not initialized or initialized for signature verify mode.
CryptoException.ILLEGAL_USE if one of the following conditions is met:
if the hashLength value is not equal to the length of the algorithm's message digest length.
if this Signature algorithm includes message recovery functionality.
if the Signature algorithm does not compute a distinct message digest value prior to applying cryptographic primitives



Sheley
Posts: 1
Joined: Tue Jul 04, 2017 5:54 am
Points: 12
Contact:

Re: Do hash on PC and send digest to my card for signing

Postby Sheley » Tue Jul 11, 2017 2:26 am

popmun09 wrote:Try to use cipher instead of hash.


Why's that?

Arynews
Posts: 1
Joined: Wed Apr 04, 2018 7:39 am
Points: 12
Contact:

Re: Do hash on PC and send digest to my card for signing

Postby Arynews » Wed Apr 04, 2018 7:40 am

Use signPreComputedHash, which can help you generate the signature of the precomputed hash data. elections results But you java card version should support since 3.

timros
Posts: 2
Joined: Mon Jun 04, 2018 9:04 am
Points: 12
Location: United States
Contact:

Re: Do hash on PC and send digest to my card for signing

Postby timros » Mon Jun 04, 2018 9:11 am

Why's that?[/quote]

It is clear why
The crazy bulk could be quite a good help https://diets-usa.com/crazy-bulk-reviews/

timros
Posts: 2
Joined: Mon Jun 04, 2018 9:04 am
Points: 12
Location: United States
Contact:

Re: Do hash on PC and send digest to my card for signing

Postby timros » Mon Jun 04, 2018 9:12 am

good info
The crazy bulk could be quite a good help https://diets-usa.com/crazy-bulk-reviews/


Return to “Algorithm School”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer