chrissimpkins / crypto

Simple symmetric GPG file encryption and decryption
http://chrissimpkins.github.io/crypto
MIT License
48 stars 27 forks source link

Validation of encrypted file. #13

Open chrisidefix opened 9 years ago

chrisidefix commented 9 years ago

How could we validate that the encryption was really successful after completion?

I assume such an option (e.g. --validate or --verify) would be a good addition to crypto. The only feasible solution I can see right now, though, is to decrypto the file as a new temporary file and then compare this result with the original input file (maybe by comparing md5/sha256 hash values).

Ok, theoretically it could still be the decryption that is messing up in this scenario, but I don't exactly see a better solution.

chrissimpkins commented 9 years ago

GPG errors are raised if there are problems with encryption and the non 0 exit status code indicates a problem. I think that we need to rely on GPG to handle that.