I've noticed quite a handful people have asked this question, and have gotten vague answers, but it is still unclear to me how to RSA encrypt messages with the private key.
Wei Dai,
First of all, I just wanted to say, I love your Crypto++ library :).
Anyway, in the mailing list, you have said it is possible to sign files with an RSA private key, and verify them with a public key.
Code from test.cpp:
bool RSAVerifyFile(const char *pubFilename, const char *messageFilename, const char *signatureFilename)
{
<snip>
VerifierFilter *verifierFilter = new VerifierFilter(pub);
verifierFilter->Put(signature, pub.SignatureLength());
FileSource f(messageFilename, true, verifierFilter);
return verifierFilter->GetLastResult();
}
This function only returns a boolean result, but, is it also possible to retrieve the message from the Signature ? This would be great to encrypt strings with a private key..
I've done some research on RSA, and the encryption/decryption works like this I think:
Cipher = Text ^ EncryptExponent mod PQ
Text = Cipher ^ DecryptExponent mod PQ
So, shouldn't it be possible to encrypt messages with a large EncryptExponent, and a small DecryptExponent?
Slap me if I'm wrong :)
Cheers, neimod.
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail
