Hi. I found the problem with it. Data.c_str() is byte, so I have to say:
StringSource(data.c_str(),data.size(), true, new PK_EncryptorFilter(randPool, pub, new HexEncoder(new StringSink(output)))); Maybe it will help somebody to do his work :-) Meike -----Urspr�ngliche Nachricht----- Von: Behrens, Meike [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 13. April 2005 09:26 An: [email protected] Betreff: Rsa-encryption like in the test.cpp but with a bytestring. 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
