On Tue, 2003-11-18 at 19:14, Scott Barnhart wrote: > Stephen, > > Based on the code in test.cpp for GzipFile and GunzipFile, I have always > used the following, and it should work for you: > > // Gzip contents of plaintext into gzip_text; > StringSource(plaintext, true, new Gzip(new StringSink(gzip_text))); > > // Ungzip contents of gzip_text into unzip_text; > StringSource(gzip_text, true, new Gunzip(new StringSink(unzip_text))); > > Maybe I am missing something in your requirements? (I have been pretty much > following your whole thread.) > > You can also string these together, so if you want to gzip then B64 encode, > you could: > > StringSource(plaintext, true, new Gzip(new Base64Encoder(new > StringSink(b64_text)))); > > And then to undo it back to plaintext, you do: > > StringSource(b64_text, true, new Base64Decoder(new Gunzip(new > StringSink(unb64_text))));
A couple more steps here.
I want to take the plain text and produce an encrypted text using AES.
I want to create a MAC of the encrypted text.
I want to create a single string containing the encrypted text and MAC.
So I can use what you gave to produce a compressed string. So
<encrypt>
plain text -> compress text (Use what you gave me above)
code: StringSource(plaintext, true, new Gzip(new
StringSink(gzip_text)));
compress text -> encrypted text (base64 encoded)
Q: What do you use for encrypting a std::string?
- A StringTransformationFilter?
mac text = mac of encrypted text
Q: What do you use for generating a MAC?
Q: Is a MAC a fixed size for all types? (e.g. SHA512 and SHA256)
cipher text = encrypted text + mac text
code: stringstream str;
str << encrypted text << mac text;
return str.str();
Stephen
--
Stephen Torri
GPG Key: http://www.cs.wustl.edu/~storri/storri.asc
signature.asc
Description: This is a digitally signed message part
