On Tue, Apr 5, 2011 at 03:04, Ahewd.com <[email protected]> wrote: > > So to rephrase the question, is it possible that the file would > decrypt with a wrong key without throwing an exception? Or do i have > to append some checksum of original file and then compare it to > checksum of the decrypted file to detect if the key was good and the > result is not just some garbage? >
It's highly improbable, but I wouldn't be comfortable saying it's impossible. Integrity isn't explicitly guaranteed by CBC. I'd expect a wrong key, wrong IV or corrupt data stream to throw this exception for CBC, and don't know of a means for distinguishing which caused it without layering some other primitive. I'd suggest a signature and/or an HMAC-based scheme for verifying message integrity if you need to do that. Geoff -- 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.
