Thank you, Eventually I've decided to extract data from the Filter instead of encapsulating a sinklike component to stream data to a CFile. I need an auxiliary buffer to do so, but that's ok.
I stumbled however upon another problem while playing with filters. I need to chain a deflator and a CBC encryptor (such an AES for example) in order to reduce the overall filesite (clearly the deflator has to proces data before the encryptor). I managed to use a default encryptor which seems to expose a buffertransformation interface and it's then compatible with Deflator/Inflator filter, producing code like this: bft = new CryptoPP::Deflator( new CryptoPP::DefaultEncryptor((const char *)key, new CryptoPP::TransparentFilter() ) ); In this way I can write code such: bft->Put( buffer, buffersize ); // feed the system plaintext data ... // get deflated and encrypted data back bft->Get( outbuff, outbuffsize ); DefaultEncryptor happens however to be a 3DES EDE CBC data processor. Although it's not a big issue (I don't even need such a strong encryption), I would like to know if there's an equally easy way to instantiate an AES cbc encryptor or in general another StreamTransformation derived component which can process compressed data. There appears to be also an asymmetric chaining of components which make me wonder if I'm doing things correctly, for the Decryptor / Inflator structure is a bit different, since there's no need for a TransparentFilter: bft = new CryptoPP::DefaultDecryptor( (const char *)key, new CryptoPP::Inflator() ); Regards, At 11.13 24/09/2007 -0700, you wrote: >Look at FileSink and see what it derives from. Actually you might want to >make a copy of FileSink and modify it to write to a CFile instead of >starting from scratch. > >-------------------------------------------------- >From: "Giuliano Bertoletti" <[EMAIL PROTECTED]> >Sent: Monday, September 24, 2007 6:50 AM >To: <[EMAIL PROTECTED]> >Subject: Finding the proper class to derive from > > > > > > > Hello, > > > > I have an MFC application which serializes data to disk through a > > proprietary object (i.e. CFile for those accustomed with MFC). > > Now I wish to implement encryption / compression on the fly over the > > stream, so my idea was to chain Crypto++ filters. > > > > To accomplish this I need to create an object which can be chained to the > > compression and encryption filters and which can manipilate my CFile > > object. So my idea is to override the Put, MessageEnd, etc... members and > > let my code properly call the CFile methods. > > In other words something similar to a FileSink with its standard interface > > but custom implementation. > > > > My question is: from which class should I derive my object from ? > > > > Regards, > > > > > > Giuliano Bertoletti. > > > > > > > > > > Giuliano Bertoletti. e-Security Manager Intrinsic - Security Monitoring http://www.intrinsic.it **** <http://www.extensivecontrol.it/>eXtensiveControl La nuova soluzione di Content Filtering per la PMI http://www.extensivecontrol.it/ Symbolic S.p.A. / Intrinsic S.r.l. V.le Mentana, 29 I-43100 Parma Italy SYMBOLIC S.p.A. / Intrinsic S.r.l. Tel: +39 0521 708811 / Fax: +39 0521 776190 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [EMAIL PROTECTED] More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
