Hi all,

We are trying to sign a message with the ECDSA algorithm, for that we
want to use a key we have inside a file. We have already done the same
thing  for the RSA_PKCS1 and the RSA_PSS algorithms and with these
both algorithms it works very well ! But with ECDSA it doesn’t work
and we don’t understand why. Actually, we always have a data abort at
run time…


You can find below the code for RSA_PKCS1 and RSA_PSS and also the
code we try to do to use ECDSA.


/////////////////////////////////////////////

// encryption: RSASSA_PKCS1_V1_5_SIGNATURE //

/////////////////////////////////////////////


      if(hashIndex==SHA1_HASH &&
encryptIndex==RSASSA_PKCS1_V1_5_SIGNATURE)

      {

            CryptoPP::RandomPool randomPool;

            CryptoPP::FileSource privFile(keyFileName.c_str(), true,
new CryptoPP::HexDecoder);

            CryptoPP::RSASS<CryptoPP::PKCS1v15,
CryptoPP::SHA1>::Signer priv(privFile);

            priv.SignMessage (randomPool, (const byte *)pMsgBuffer,
msgLength,(byte *) pCertificateBuffer);

      }


//////////////////////////////////////

// encryption: RSASSA_PSS_SIGNATURE //

//////////////////////////////////////


      if(hashIndex==SHA1_HASH && encryptIndex==RSASSA_PSS_SIGNATURE)

      {

            CryptoPP::RandomPool randomPool;

            CryptoPP::FileSource privFile(keyFileName.c_str(), true,
new CryptoPP::HexDecoder);

            CryptoPP::RSASS<CryptoPP::PSS, CryptoPP::SHA1>::Signer
priv(privFile);

            priv.SignMessage (randomPool, (const byte *)pMsgBuffer,
msgLength,(byte *) pCertificateBuffer);

      }


/////////////////////////////////

// encryption: ECDSA_SIGNATURE //

/////////////////////////////////


      if(hashIndex==SHA1_HASH && encryptIndex==ECDSA_SIGNATURE)

      {

            CryptoPP::RandomPool randomPool;

            CryptoPP::FileSource privFile(keyFileName.c_str(), true,
new CryptoPP::HexDecoder);

            CryptoPP::ECDSA<ECP,SHA1>::Signer priv(privFile);

            priv.SignMessage (randomPool, (const byte *)pMsgBuffer,
msgLength,(byte *) pCertificateBuffer);

      }


We have also tried to find another way to use this algorithm: in using
this kind of code for example:



    ECIES<ECP>::PrivateKey privateKey;
        ByteQueue bq;
        StringSource(base32encodedKey, true, new Base32Decoder(new
Redirector(bq)));
        privateKey.Load(bq);



But it doesn’t work better because we don’t know how to use our own
key.



Can you help us? Can't we use the same method as for PSS/PKCS ?



We are working with the CryptoPP version 5.5.2 and Visual studio 2005.



Regards,

Julie

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

To unsubscribe from this group, send email to 
cryptopp-users+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to