How to encrypt and decrypt directory with gpgdir script

gpgdir is a perl script that uses the CPAN GnuPG::Interface module to encrypt and decrypt directories using a gpg key specified in ~/.gpgdirrc.  This script will help you to encrypt and decrypt directories using  a GPG key. It supports recursively descending through a directory in order to make sure it encryptsor decrypts every file in a target directory and all of its subdirectories.

Installation and configuration of gpgdir on Ubuntu:

  • Download the binary file, PGP key and verify signature
mkdir gpgdir
wget http://www.cipherdyne.org/gpgdir/download/gpgdir-1.9.5.tar.bz2
wget http://www.cipherdyne.org/gpgdir/download/gpgdir-1.9.5.tar.bz2.asc
wget http://www.cipherdyne.org/public_key
gpg --import public_key
gpg --verify gpgdir-1.9.5.tar.bz2.asc
  • Lets install the gpgdir script on Ubuntu box
tar xfj gpgdir-1.9.5.tar.bz2
cd gpgdir-1.9.5
./install.pl
  • We have to configure gpgdir for use with your default GPG key
vi /usr/local/src/gpgdir
  • Make a change in the conf file .. uncomment line “default_key and save
.
# Uncomment to use the GnuPG default key defined in ~/.gnupg/options:
default_key
# If you want to specify manually the right key enter it on next line
use_key 000BBD1XX
.

This complete the installation and configuration of gpgdir. You can now use it to encrypt or decrypt directories and you can do it manually or you can write simple bash script.

Man Page and usage of the gpgdir

Simply usage of Encrypt or Decrypt directory

gpgdir --encrypt {directory}
gpgdir --decrypt {directory}
## Encrypt directory and wipe out the original once encrypted
gpg -W -e {directory}

This could be integrated nicely into simple script.

Cryptography For Dummies
List Price: $37.99
Price: $25.13
You Save: $12.86

Be the first to comment on "How to encrypt and decrypt directory with gpgdir script"

Leave a comment

Your email address will not be published.


*


Get Adobe Flash player Plugin by wpburn.com wordpress themes