-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed as not planned
Description
Expected behavior
RSA Cipher requires only the public key to generate a valid ciphertext
Actual behavior
Without a private key supplied on encryption, the ciphertext generated is not decipherable. An exception whose .what() is I/O Error is thrown by decryptString.
Steps to reproduce the problem
auto decrypt_key = new Poco::Crypto::RSAKey(
std::string("./key.pub"),
std::string("./key.priv"),
std::string("")
);
auto encrypt_key = new Poco::Crypto::RSAKey(
std::string("./key.pub")
);
Poco::Crypto::CipherFactory factory;
auto iengine= factory.createCipher(*encrypt_key);
auto oengine= factory.createCipher(*decrypt_key);
std::string SS = "test_str";
auto enc = iengine->encryptString(SS);
auto SS2 = oengine->decryptString(enc);
assert(SS==SS2);
delete decrypt_key;
delete encrypt_key;
key.pub being a valid public key for key.priv
POCO version
1.9.0
Compiler and version
GCC 7.3.0
Operating system and version
Debian/Linux testing x64
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels