Hello,
I am using the cryptopp 7.0 on a project,
I am wondering if i can use keys generated with ECDSA on a ECIES encryption
process,
bellow what i am doing:
void LoadPrivateKey(PrivateKey& key, const std::string& file =
> "private.ec.der");
> void LoadPrivateKey(PrivateKey& key, const std::string& file)
> {
> FileSource source(file.c_str(), true /*pump all*/ );
> key.Load(source);
> }
on my main function
> //GENERATE ECDSA PRIVATEKEY
> AutoSeededRandomPool privRng;
> FileSink fs( "private.ec.der", true /*binary*/ );
> ECDSA<ECP, SHA1>::PrivateKey privKey;
> privKey.Initialize( privRng, ASN1::secp160r1() );
> const Integer& x1 = privKey.GetPrivateExponent();
> privKey.Save( fs );
> std::cout << "Private Key: " << std::hex << x1 << std::endl;
>
> //trying to use the same key for ECIES
> ECIES<ECP>::Decryptor d0;
> LoadPrivateKey(d0.AccessPrivateKey());
and i got these exceptions:
terminate called after throwing an instance of 'CryptoPP::BERDecodeErr'
> what(): BER decode error
> Abandon (core dumped)
Many thanks for any help.
Abdelkarim.
--
You received this message because you are subscribed to "Crypto++ Users". More
information about Crypto++ and this group is available at
http://www.cryptopp.com and
http://groups.google.com/forum/#!forum/cryptopp-users.
---
You received this message because you are subscribed to the Google Groups
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.