On Sat, 2003-11-15 at 16:19, Rickey Braddam wrote:
> Hello again, Stephen.
> 
> If you encrypt then base-64 encode, you must base-64 decode then decrypt. You
> are attempting to decrypt base-64 encoded ciphertext, not the ciphertext
> itself.
> 
> >From test.cpp:
> string DecryptString(const char *instr, const char *passPhrase)
> {
>     string outstr;
> 
>     HexDecoder decryptor(new DefaultDecryptorWithMAC(passPhrase, new
> StringSink(outstr)));
>     decryptor.Put((byte *)instr, strlen(instr));
>     decryptor.MessageEnd();
> 
>     return outstr;
> }
> 
> Which means your cfbDecrypter should look more like:
> StreamTransformationFilter *cfbDecryptor =
> new StreamTransformationFilter (aes_decrypt,
> new StringSink (plaintext));
> 
> 
> and your StringSource should look more like:
> StringSource source (new Base64Decoder(ciphertext), true, cfbDecryptor);
> 
> NOTE that I haven't tested this, you may have to make some "adjustments" to
> it.
> I don't use them quite like that.
> 
> Rickey

Ultimately the transformations to the plain text I would are to compress
the data first then encrypt.

What would you do? I am open to suggestions and education.

Stephen

Reply via email to