I'm working on processing a data-stream based on some conditions.
Data is read from an input pipe, processed, and pushed down a Crypto++ CBC_Mode<AES>
filter ending in a FileSink
.
Now, I'd like to "snoop" on the data flowing between the encryption and file-store, calculating a checksum. For performance reasons, I want to do this while streaming, re-opening the output file and calculating a hash-sum after is not reasonable for my need.
From what I can see, what's missing for this to work, is some form of "tee" filter. Something splitting the data chain into two new chains, one for storing to file, and one chain for the hash-calculation.
Are there such functionality in Crypto++? Can I implement such filter myself, and if so, are there some guidelines or examples on what's needed for a custom Crypto++ filter? Are there some other way to calculate checksum on the fly?