Recipe 7.5 Decrypting Files

7.5.1 Problem

You want to decrypt a file that was encrypted with GnuPG.

7.5.2 Solution

Assuming the file is myfile.gpg, decrypt it in place with:

$ gpg myfile.gpg                             creates myfile

Decrypt to standard output:

$ gpg --decrypt myfile.gpg

Decrypt to a named plaintext file:

$ gpg --decrypt --output new_file_name  myfile.gpg

7.5.3 Discussion

These commands work for both symmetric and public-key encrypted files. You'll be prompted for a password (symmetric) or passphrase (public-key), which you must enter correctly to decrypt the file.

ASCII encrypted files (with the suffix .asc) are decrypted in the same way as binary encrypted files (with the suffix .gpg).

7.5.4 See Also

gpg(1).



Linux Security Cookbook
Linux Security Cookbook
ISBN: 0596003919
EAN: 2147483647
Year: 2006
Pages: 247

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net