Hi Stephen, Generally, one would compress first. This helps develop entropy (iirc - its been a while since my crypto class). However, it may be a moot point considering the algorithms you are using.
Jeff > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Stephen torri > Sent: Saturday, November 15, 2003 5:40 PM > To: cryptopp > Subject: Re: Decryption in CFB_Mode<AES> > > > 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 >
