Using GPG for encrypting directories

Anthony E. Greene agreene@pobox.com
Thu Sep 18 05:11:01 2003


On 17-Sep-2003/22:51 +0300, Paul Jahshan <odin@dm.net.lb> wrote:
>
>I want to use GPG for local encryption only, and after reading the man 
>file, I'm doing the following in order to encrypt a whole directory:
>
>I zip the directory with a password "zip -r -e foo foo", then I encrypt 
>it with "gpg -c foo.zip" using a passphrase.
>
>Is this an elegant and secure way of encrypting directories? Am I using 
>GPG's full cryptographic power? Are there better alternatives?

I think a more elegant way is:

  tar -cf - /path/to/source/dir | gpg -c -o encrpyted_archive.gpg

GnuPG compresses during the encryption process, so zip is not necessary.
I use the tar utility rather than zip on *nix systems because the file
permissions are preserved.

Tony
-- 
Anthony E. Greene <mailto:Anthony%20E.%20Greene%20%3Cagreene@pobox.com%3E>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
AOL/Yahoo Messenger: TonyG05    HomePage: <http://www.pobox.com/~agreene/>
Linux. The choice of a GNU generation <http://www.linux.org/>