On Tue, 2003-11-11 at 01:34, Rickey Braddam wrote:
> ********* I think this might happen if you tried to use a block cipher in CBC
> mode in the StreamTransformationFilter... try CFB or OFB mode with the
> block cipher.... also, make sure you're using the same mode in encryption
> and decryption.

Here is what I am using:

CFB_Mode<AES>::Encryption aes_encrypt (m_encryKey,
AES::DEFAULT_KEYLENGTH, m_iv);

StreamTransformationFilter *cfbEncryptor =
new StreamTransformationFilter (aes_encrypt, new Base64Encoder (new
StringSink (ciphertext)));

StringSource source (plaintext.ascii(), true, cfbEncryptor);


The path of the data I am encrypting is:

1. User enters text in a QTextEdit object (QT program)

2. Grab plaintext via QTextEdit->text()

3. call encrypt() on CipherEngine object (wrapper class for Crypto++)

4. call the code above which is inside the encrypt()

5. return data to caller

6. write data to file via a QTextStream

It would probably be best to talk via IRC so I can share code. The code
above was put together from the code available from the Crypto++ FAQ
pages.

Stephen

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to