How to verify the file was successfully encrypted...

Robert J. Hansen rjh at
Wed Jul 12 12:14:03 CEST 2006

Benny Helms wrote:
> I'm looking for a way to gpg encrypt a file, test that the encryption
> was good and that the file can be extracted, and then to delete the
> original file.

Forgive a silly question, but what's wrong with decrypting the file as a
way of verifying the encryption worked?

> At the very least, though, a way of testing that the file encryption was
> successful without having to sit at my desk at 3AM running 'gpg
> --decrypt filename' to test it would be very helpful.

If you're already sitting at your desk at 3AM doing encryptions, then
doing a decryption shouldn't be a terrible additional step.

If you've got a Perl script that's doing the encryptions, then have your
Perl script do the verification step, too.

More information about the Gnupg-users mailing list