Hi
I think that it is a problem of printing the output.
try to put your output in an Integer object.
Integer d = privkey.GetDecryptionExponent();
Integer q = privkey.GetPrime2() ;
Integer e = privkey.GetExponent();
and use the Integer Object functions like ByteCount() and GetByte()
I think that GetExponent and GetDecryptionExponent() functions always return 1 to you because the second byte value in the (Integer Object returned) equals 0.
for information about Integer Class
Regards
Haytham
"generalz (sent by Nabble.com)" <[EMAIL PROTECTED]> wrot! e:
I use crypto++ v4.2 !
My code is below:
void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const
char *pubFilename, const char *seed)
{
RandomPool randPool;
randPool.Put((byte *)seed, strlen(seed));
RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
InvertibleRSAFunction privkey(randPool, keyLength);
cout << "d= " << privkey.GetDecryptionExponent()<< endl;
cout << endl;
cout << "p= " <cout << endl;
cout << "q= " << privkey.GetPrime2() <cout << endl;
cout << "e= "<< privkey.GetExponent() << endl;
}
Thank in advanced!
generalz
--
View this message in context: http://www.nabble.com/how-to-get-the-e-and-d-in-rsa--t1250344.html#a3352426
Sent from the Crypto++ foru! m at Nabble.com.
Yahoo! Mail
Use Photomail to share photos without annoying attachments.
