> When using a FileSource/Sink with a HashFilter, there is an option to
> append the hash code to the output file when encoding. It would be
> cool if there were a complementary option to strip the hash out of the
> file when verifying. Perhaps through the use of a tag to mark where
> the hash code starts.

Do you mean verifying file once and saving a copy without a hash? That
would mean you can only verify once.

If you mean "writing file, appending hash" and then "reading file,
verifying hash and passing the file itself further up the filter
chain" then that is there already. Look at HashVerificationFilter and
PUT_MESSAGE flag.

SHA1 sha;

// Creating "signed" file with digest at the end
FileSource("original_file", true, new HashFilter(sha, new FileSink
("file_with_digest"), true));

// Verifying file and passing stripped out version up the chain,
FileSink in this case
FileSource("file_with_digest", true, new HashVerificationFilter(sha,
new FileSink("file_without_digest"),
HashVerificationFilter::THROW_EXCEPTION |
HashVerificationFilter::PUT_MESSAGE));


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to