I have an enc/dec process set up for a system where a user edits a file. If the encrypted file has been modified maliciously, I want to be able to handle it and say "oh decryption failed, gonna start with a clean file"... something like that. But I'm not sure how to handle the exception in a way that doesn't stop program execution.
TO reiterate, I am NOT having a problem with decrypting perfectly valid data. I am encountering the Bad Data error with actual bad data, and am simply wondering how to handle it gracefully. When the error occurs the CryptoStream can't close the file, so I can't overwrite it with the plaintext file or use it for any other stuff.
BTW this is .NET code being used in LabView. Can't really paste the code here.