Gpg

From Wiki
Revision as of 18:29, 4 February 2011 by Scott (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To use gpg, your home directory should contain a .gnupg directory owned by you with permissions 700. To create this for the first time:

gpg --gen-key

To encrypt a file:

gpg -r <usr> -e <orig-file>

To decrypt a file:

gpg -r <usr> -o <orig-file> -d <gpg-file>

To create an encrypted tar file:

tar cf test.tar <dir>
gpg -r root -e test.tar
rm -f test.tar

To extract an encrypted tar file:

gpg -r root -d test.tar.gpg | tar xf -

If the .gnupg directory isn't in the right place, you may need to throw in the following option:

gpg --homedir /tmp/.gnupg ...