Hi Mouse I tested your code in VS2005. I have got a couple of
questions and appreciate that you can help me on any of them.

+ Take the encryption code for example. You allocate memory for
'encryptor' but I never see you delete them in your code. I ran the
code in a debug mode and found out after the FileSource is called the
memory of 'encryptor' object is freed magically. Is this a smart
pointer design in CryptoPP?

+ Does CryptoPP AES implementation support 32-byte block size? Seems
not.

+ As you know, we need to consider the padding when using CBC mode so
that we can process data in multiple of block size. According to
CryptoPP's FAQ:

"Alternatively, you can wrap StreamTransformationFilter around the
mode object and use it as a Filter object. StreamTransformationFilter
will take care of buffering data into blocks for you when needed.

  std::string ciphertext;
        StreamTransformationFilter cfbEncryptor(cfbEncryption, new
StringSink(ciphertext));
        cfbEncryptor.Put(plaintext, 100);
        // input more plaintext here if needed
        cfbEncryptor.MessageEnd(); "

Your decryption code throws an exception saying the data is not a
multiple of block size. Is this because padding should be added in the
encryption code and how?

I can't get help from the sample code because it uses MessageEnd() at
the end of the encryption. I can't use encryptor->MessageEnd() in your
code because the encryptor object is destroyed after the
FileSource(...).

Many thanks


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