linux poison RSS
linux poison Email

Recursively Encrypt / Decrypt Directories using gpgdir on Linux

gpgdir is a script that encrypts and decrypts directories using a GPG key. It supports recursively descending through a directory in order to make sure it encrypts or decrypts every file in a directory and all of its subdirectories.

All file mtime and atime values are preserved across encryption and decryption operations. In addition, gpgdir is careful not to encrypt hidden files and directories.

Other features include the ability to interface with the wipe program for secure file deletion, and the ability to obfuscation the original filenames within encrypted directories.

Installation:
OpenSuSe user can install gpgdir using "1-click" installer - here

Others: The distribution tarball of gpgdir contains an install.pl file which installs gpgdir along with all the required modules if they are not already available on your system. If you run install.pl as a non-root user then the modules and gpgdir will be installed into a subdirectory of your home directory.

Usage:
The first time you attempt to use gpgdir gpgdir will setup a configuration file $HOME/.gpgdirrc and inform you that you must edit that file and specify the default key to use for encryption with the use_key directive.
nikesh@poison:~> gpgdir
[+] Creating gpgdir rc file: /home/nikesh/.gpgdirrc
[*] Please edit /home/nikesh/.gpgdirrc to include your gpg key identifier,
    or use the default GnuPG key defined in ~/.gnupg/options.  Exiting.
Type command "gpg --list-keys" to get the list of keys installed on your system.

Once you've specified a default encryption key, the usage of gpgdir is simple. Pass -e to gpgdir encrypt a directory tree and -d to decrypt it again, example shown below ...



To encrypt a directory, and use the wipe command to securely delete the original unencrypted files:
$ gpgdir -W -e /some/dir
To encrypt a directory and no subdirectories:
$ gpgdir -e /some/dir --no-recurse


1 comments:

Jared said...

Thanks to people behind Linux Poison for pointing out many interesting Linux apps and tips!

Post a Comment

Related Posts with Thumbnails