Read the documentation you referred to more carefully. It's all explained in there. Hint: AES::Encryption inherits from BlockCipher. CBC_Mode<AES>::Encryption inherits from SymmetricCipher. SymmetricCipher inherits from StreamTransformation, so it can be used with StreamTransformationFilter. As the documentation for BlockCipher says:
These objects usually should not be used directly. See BlockTransformation for more details. On Wed, Mar 26, 2003 at 06:48:56PM -0500, Walton, Jeffrey wrote: > Hi Group, > > I having some trouble with a compile, and I want to get this correct: > > I have a private class member. It could be any symmetric: > BlockCipher* m_cipher; > > At construction: > m_cipher = new > > Later, in a method (before any information is encrypted/decrypted) _when_ > choosing ECB or CBC mode: > StreamTransformationFilter( > *((SymmetricCipher*)m_cipher), NULL ); > > StreamTransformationFilter needs a StreamTransformation&. > > I don't think it is going to work, since BlockCipher inherits from > BlockTransformation and SimpleKeyingInterface. > > How can I attach a filter (when in ECB or CBC mode) to get the effect I > want? > > Thanks, > Jeff > > For reference, BlockCipher class heirarchy: > http://cryptopp.sourceforge.net/docs/ref5/class_block_cipher.html > > and StreamTransformationFilter: > http://cryptopp.sourceforge.net/docs/ref5/class_stream_transformation_filter > .html > > I've also looked at: > http://www.eskimo.com/~weidai/cgi-bin/fom-serve/cache/79.html
