Hello,
I hope this will be my last question. I want to encrypt and decrypt some
bytestring just the way it is shown in test.cpp, but with a string as
key. It runs through but my outputstring is empty after it. Colud you
please take a look at it and show me how to do it better or how to get
an encrypted string into my output? Thanks.
Code:
std::string CCryptoBase::AsymmEncryptByte2String(
std::basic_string<byte> & data, std::string & pubKey ){
std::string output;
StringSource pubString(pubKey, true,new HexDecoder);
RSAES_OAEP_SHA_Encryptor pub(pubString); //pubkey is in here I
guess. Shold not be the problem.
RandomPool randPool;
randPool.Put((byte *)"1234567890", 10);
StringSource(data.c_str(), true, new
PK_EncryptorFilter(randPool, pub, new HexEncoder(new
StringSink(output))));
//data.c_str() is HELLO, just like I said, output is "" ...
return output;
}
Meike