Hi, all. As you may have seen, I've tried some to help Stephen torri with his encryption and decryption. Now I'm getting wrapped around the axle with using filters... as I told him in another posted message, I don't use the filter chains much. I still want to help him, but I don't think I'm being very effective.
It has to do with HMAC<SHA>... I'm not figuring out very quickly how (or if it's possible) to use it in / as a filter. It's pretty easy to set up a filter chain to start with a String(or File)Source feeding a StreamTransformation that feeds a Base64Encoder that feeds a String(File)Sink. I don't see a way (an obvious way) to cause the output of the encrypter to simultaneously go through a b64 encoder to a sink and go to an HMAC, have the HMAC output go through a (separate???) b64 encoder and that output be appended to the sink.... the HMAC output should be appended to the ciphertext and both b64 encoded so that the encoded string is all one string. Does it take three separate filter chains to do this? Like (pseudocode): string source; string stringsink1; string stringsink2; string outputString; StringSource source -> encrypter -> StringSink stringsink1 HMAC<SHA> mac(key, keylen) StringSource(stringsink1) -> mac -> StringSink stringsink2 stringsink1.append(stringsink2, stringsink2.length()) StringSource stringsink1 -> Base64Encoder -> outputString Will this even work? If it does, it becomes relatively easy to separate the MAC from the message after decoding it with Basae64Decoder, since the receiver knows that HMAC<SHA> is used. Can I attach an HMAC<SHA> to a StringSource, and a StringSink to the HMAC? It seems like I should be able to because SHA is a HashTransformation.. I seem to remember (vaguely) that there was a class, I think a hash, that passed its input to its attached output until it received messageEnd(), then finalized its calculation and passed that to its output, then sent messageEnd() to its output.... it's late, and I'm beginning to run around in circles in the source code... Rickey
