RSA failed to decrypt.

19 views
Skip to first unread message

Romij Uddin

unread,
Jul 1, 2019, 3:54:27 AM7/1/19
to Crypto++ Users
Hello ,
I have used following code to generate key.
    CryptoPP::AutoSeededRandomPool rng;
    CryptoPP::InvertibleRSAFunction parameters;
    parameters.GenerateRandomWithKeySize( rng, 1024 );

    CryptoPP::RSA::PrivateKey privateKey( parameters );
    CryptoPP::RSA::PublicKey publicKey( parameters );

 
This code works fine for encryption/deception on single application.

But when i tried to send encrypted message,
from one computer to another computer. Then it failed to decrypt.

And error message is following :
terminate called after throwing an instance of 'CryptoPP::InvalidCiphertext'
  what():  RSA/OAEP-MGF1(SHA-1): invalid ciphertext
fish: “./CryptoPP” terminated by signal SIGABRT (Abort)



How to fix such thing?

John Paul Hayes II

unread,
Jul 1, 2019, 1:42:10 PM7/1/19
to Romij Uddin, Crypto++ Users
You'll probably need to share how you are sending the encrypted message. Maybe you simply need to use a base64 encoder to get crazy characters out of the data you send.

--
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 cryptopp-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/091b0c56-5aa4-4ac7-a128-f25e9932728f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages