At 09.42 07/12/2006 +0800, you wrote:
In 5.x, you'll want the factory to return a SymmetricCipher *, which is
the interface supported by both block ciphers (when used with a Mode
class) and stream ciphers. Then you can use StreamTransformationFilter to
use it with the BufferedTransformation interface.
StreamTransformationFilter also takes the object by reference. If you want
the StreamTransformationFilter object to delete the SymmetricCipher object
for you, you have to derive your own class from StreamTransformationFilter
and delete it in the destructor of the derived class.
Ok, I did as you say and it works (thank you).
It remains to be seen where and how I can supply the IV vector when I need to.
I suspect I should use the SetKey function to do this. For example:
CryptoPP::SymmetricCipher *sc = new
CryptoPP::CBC_Mode<CryptoPP::DES_EDE3>::Encryption();
sc->SetKey(key,keysize);
CMyStreamTransformationFilter stf( sc );
thorws an exception on setkey because it expects an IV.
However I do not know how to feed this strange beast named "NameValuePairs"
with the IV as the SetKey prototype suggest I should do ?
Regards,
Giuliano Bertoletti