Projects / gpgdir

gpgdir

gpgdir is a script that encrypts and decrypts directories using a GPG key specified in ~/.gpgdirrc. 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.

Tags
Licenses
Implementation

RSS Recent releases

  •  07 Sep 2009 15:38

Release Notes: Support was added for the decryption of PGP encrypted files (to round out the support of GnuPG).

  •  18 Feb 2009 15:30

Release Notes: A bug was fixed regarding missing the proper handling of files with spaces in their names when using the --Wipe secure deletion mode. The --Force option now supports the ability to encrypt or decrypt hidden files.

  •  01 Sep 2008 12:44

Release Notes: The new "--sign" and "--verify" modes were added to allow all files in the specified directory to be signed or verified instead of encrypted or decrypted. All GnuPG signatures are created as detached .asc files, and the original files are not removed in --sign mode. In --verify mode, if any file does not match the expected .asc signature, then a warning is generated. The code was updated to use the status output from GnuPG::Interface to detect a bad passphrase and whether a file is encrypted with the expected GnuPG key. Perl module dependencies were moved into the deps/ directory.

  •  13 Jun 2008 13:59

Release Notes: This release always sets the LC_ALL environment variable to the "C" locale. This can be set to other locales with the new argument --locale, or the default locale can be used by using the --no-locale argument. This release updates Class::MethodMaker to 2.11 from CPAN. This helps with systems running perl-5.10.0 and greater (such as Fedora 9).

  •  02 Jun 2008 13:18

Release Notes: The --Obfuscate-filenames format was changed to not include the gpgdir PID. This allows directories to be encrypted and decrypted under -O multiple times without creating new filenames (which would pollute encrypted directories under rsync to other systems). The new -O encrypted filename format is just "gpgdir_<num>.gpg". PID locking against directories was added so that multiple gpgdir processes cannot operate against the same top-level directory simultaneously. This is useful for users that typically operate with multiple shells and might launch gpgdir from any of them.

RSS Recent comments

25 Jun 2008 00:51 michaelrash

Re: gpgdir no longer working with perl 5.10

> Since I have updated to Perl 5.10,

> gpgdir is no longer working; I get the

> following message:

>

> "/usr/bin/perl: symbol lookup

> error:

> /usr/lib/gpgdir/i486-linux-gnu-thread-multi/auto/Term/ReadKey/ReadKey.so:

> undefined symbol:

> Perl_Tstack_sp_ptr"

>

> Could you make a suggestion?

>

> Many thanks !

Hi, can you try re-installing gpgdir by either using the install.pl script in the gpgdir tarball, or by using the automated RPM builder?:

www.cipherdyne.com/scr...

Just do:

# ./cd_rpmbuilder -p gpgdir

Thanks,

--Mike

19 May 2008 21:44 truenerd Thumbs down

gpgdir no longer working with perl 5.10
Since I have updated to Perl 5.10, gpgdir is no longer working; I get the following message:

"/usr/bin/perl: symbol lookup error: /usr/lib/gpgdir/i486-linux-gnu-thread-multi/auto/Term/ReadKey/ReadKey.so: undefined symbol: Perl_Tstack_sp_ptr"

Could you make a suggestion?

Many thanks !

09 Sep 2006 09:27 michaelrash

Re: gpgdir dosn't work on my linux system

> Well the script ran, but produced a 0

> size file, so I put

> some content in it, and the following

> script works for me. It says "yep" and

> the file gets encrypted.

> #!/usr/bin/perl -w

> use GnuPG;

> use strict;

>

> my $homedir = '/home/zentara/.gnupg';

> my $file = '/tmp/gpgtest';

> my $key = "zentara\@zentara.net";

>

> unlink "${file}.gpg";

>

> open F, "> $file" or die;

> print F "howdy";

> close F;

>

> my $gpg = new GnuPG(homedir=>$homedir);

>

> $gpg->encrypt(plaintext=>$file,

> output=>"${file}.gpg",

> recipient=>$key);

>

> if (-e "${file}.gpg") {

> print "yep\n";

> } else {

> print "nope\n";

> }

> exit 0;

>

This should be fixed now with the usage of the GnuPG::Interface module.

04 Mar 2003 03:56 zentara

Re: gpgdir dosn't work on my linux system
Well the script ran, but produced a 0 size file, so I put
some content in it, and the following script works for me. It says "yep" and the file gets encrypted.

#!/usr/bin/perl -w

use GnuPG;

use strict;

my $homedir = '/home/zentara/.gnupg';

my $file = '/tmp/gpgtest';

my $key = "zentara\@zentara.net";

unlink "${file}.gpg";

open F, "> $file" or die;

print F "howdy";

close F;

my $gpg = new GnuPG(homedir=>$homedir);

$gpg->encrypt(plaintext=>$file, output=>"${file}.gpg",

recipient=>$key);

if (-e "${file}.gpg") {

print "yep\n";

} else {

print "nope\n";

}

exit 0;

03 Mar 2003 19:13 michaelrash

Re: gpgdir dosn't work on my linux system

> My GnuPG version is GnuPG-0.09
> I'm using perl5.8
>
> You asked that I perform the following:
> tar xvfz gpgdir-0.1.tar.gz
> cd gpgdir-0.1
> mkdir testing
> cp LICENSE testing
> echo blah > testing/blah
> ./gpgdir -e testing
>
> zentara@zentara:~/1down/1/gpgdir-0.1>
> gpgdir -e testing
> Sun Mar 2 12:47:58 2003 .. Directory:
> /home/zentara/1down/1/gpgdir-0.1/testing
> ==> Encrypting blah.gz
> Sun Mar 2 12:47:58 2003 .. Encrypting
> blah.gz -> blah.gz.gpg
> Sun Mar 2 12:47:58 2003 .. Compressing
> LICENSE -> LICENSE.gz
> Sun Mar 2 12:47:58 2003 .. Encrypting
> LICENSE.gz -> LICENSE.gz.gpg
> Sun Mar 2 12:47:59 2003 ..
> Errors/Warnings:
> Sun Mar 2 12:47:58 2003 ** Could not
> encrypt: blah.gz
> Sun Mar 2 12:47:59 2003 ** Could not
> encrypt: LICENSE.gz
> Sun Mar 2 12:47:59 2003 .. Total number
> of files encrypted: 0
> Sun Mar 2 12:47:59 2003 .. Finished.
%
>

Hello -

Can you try executing the following simple script? Note that you will need to change the three variables at the top of the script.

#!/usr/bin/perl -w
use GnuPG;
use strict;

my $homedir = '/home/mbr/.gnupg';
my $file = '/tmp/gpgtest';
my $key = 'A742839F';

unlink "${file}.gpg";

open F, "> $file" or die;
close F;

my $gpg = new GnuPG(homedir=>$homedir);

$gpg->encrypt(plaintext=>$file, output=>"${file}.gpg",
recipient=>$key);

if (-e "${file}.gpg") {
print "yep\n";
} else {
print "nope\n";
}
exit 0;

Screenshot

Project Spotlight

ocserv

An SSL VPN server.

Screenshot

Project Spotlight

LPAR2RRD

AIX/iSeries free performance monitoring and capacity planning.