Crypt::SimpleGPG - easy encryption and decryption using GPG
my $gpg = Crypt::SimpleGPG->new(home_dir = '/home/user/.gnupg'); $gpg->import_key('/path/to/public/key'); my $ciphertext = $gpg->encrypt($plaintext, $recipient);
my $gpg = Crypt::SimpleGPG->new(home_dir = '/home/user/.gnupg'); $gpg->import_key('/path/to/private/key'); my $plaintext = $gpg->decrypt($ciphertext, $passphrase);
home_dir will default to /var/tmp/gnupg if not specified in the constructor. You probably don't want this, but it might be okay if you're only using public keys.
home_dir
/var/tmp/gnupg
temp_dir will be used to store temporary files when decrypting using a passphrase.
temp_dir
Copyright (c) 2010 Corey Cossentino
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
To install Crypt::SimpleGPG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::SimpleGPG
CPAN shell
perl -MCPAN -e shell install Crypt::SimpleGPG
For more information on module installation, please visit the detailed CPAN module installation guide.