Hi Giuliano,

> to reduce the overall filesite (clearly the deflator has to proces data
> before the encryptor).
This is usually preferred - compression before encryption. It adds
entropy to the data before encryption.

> DefaultEncryptor happens however to be a
> 3DES EDE CBC data processor.
>From default.h:

typedef DES_EDE2 Default_BlockCipher;
typedef SHA DefaultHashModule;
typedef HMAC<DefaultHashModule> DefaultMAC;

//! Password-Based Encryptor using DES-EDE2
class DefaultEncryptor : public ProxyFilter
{
   public:
   ...
};

Jeff

On 10/8/07, Giuliano Bertoletti <[EMAIL PROTECTED]> wrote:
>
> 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() );
>
> [ SNIP ]

--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to