Hi, all Crypto++ Users,
I used secp160k1 to create a pair of publick/private key into files,
the length for private.key is 408 byte and for public.key is 428 byte.
How can I convert the file into a 160bit length, that is, 20 byte
length string?
This is the code:
char* seed = "1234567890";
char* privFilename = "Private.key";
char* pubFilename = "Public.key";
CryptoPP::ECIES< CryptoPP::ECP >::PrivateKey PrivateKey;
CryptoPP::ECIES< CryptoPP::ECP >::PublicKey PublicKey;
CryptoPP::AutoSeededRandomPool rng;
rng.Put((byte *)seed, strlen(seed));
PrivateKey.Initialize( rng, CryptoPP::ASN1::secp160k1() );
PrivateKey.MakePublicKey( PublicKey );
CryptoPP::HexEncoder privFile(new
CryptoPP::FileSink(privFilename));
PrivateKey.Save(privFile);
privFile.MessageEnd();
CryptoPP::HexEncoder pubFile(new
CryptoPP::FileSink(pubFilename));
PublicKey.Save(pubFile);
pubFile.MessageEnd();
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---