Hi all.
I have been using Crypto 4.2 in a project I'm working on for encryption of
network data. The implementation is rather simple:
init()
{
itsCipher = new CryptoPP::AESEncryption(itsPassphrase, 16);
itsCFBEncoder = new CryptoPP::CFBEncryption(*(itsCryptor->itsCipher),
itsIV);
itsCFBDecoder = new CryptoPP::CFBDecryption(*(itsCryptor->itsCipher),
itsIV);
}
netWrite(const void* inDataBuffer, mmUn32 inDataSize)
{
byte *tmpBuf= ...;
itsCFBEncoder->ProcessString(tmpBuf, (const byte *)inDataBuffer,
inDataSize);
// write tmpBuf of size inDataSize to network
...
}
netRead(void* outDataBuffer, mmUn32& ioDataSize)
{
// read to outDataBuffer of max ioDataSize from network. After reading
// ioDataSize will contain the number of bytes read
...
if (ioDataSize == 0) {
return;
}
itsCFBDecoder->ProcessString((byte *)outDataBuffer, ioDataSize);
}
This is all working well but what I want to do now is to add compression and
I was planning of using CryptoPP::Inflator and CryptoPP::Deflator but I'm
not sure what would be the best way to do that. The size of the packets that
are being read and written can differ in size from 12 bytes and up to 10kb
Should I create a new Inflator / Deflator every time a new packet needs to
be written? Should I use static compression or dynamic? Anyone?
Thanks in advance,
Indridi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Crypto++
Users" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cryptopp-users?hl=en
-~----------~----~----~----~------~----~------~--~---