#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); #show us the errors in the browser use GPG; #the GPG perl module my $gpg = new GPG( #create a new GPG object homedir => '/home/xxxxxx/.gnupg', #specify the directory gnupg_path => '/usr/bin', #non-standard path to gpg binary armor => '1', #make sure the output is ascii armored debug => '1' #debug mode to trouble shoot ); my $encrypted = $gpg->encrypt("Testing GPG", 'xxxx@xxxxx.com'); # This is where things break down. # GPG's debug looks fine but # I am unable to use the resulting scalar. print <<"_END_"; Content-type: text/plain Encrypted: -> $encrypted <- _END_ #### ******************************************************************** COMMAND : /usr/bin/gpg -a --homedir /home/xxxxx/.gnupg --batch --no-comment --no-version $self->{'homedir'} : /home/xxxxx/.gnupg $self->{'config'} : $self->{'armor'} : 1 $self->{'debug'} : 1 ******************************************************************** ******************************************************************** COMMAND : /usr/bin/gpg -a --homedir /home/xxxxx/.gnupg --batch --no-comment --no-version -r xxxxx@xxxxxxx.com --encrypt [PID 20804] STDIN : Testing GPG STDOUT : -----BEGIN PGP MESSAGE----- hQEOA48qWedehilLEAP+OY9G7xnv8QR5iXdg8zt6eccudlO+Qz8liAm7Zxd2JHZW oo6VKCa913HQuVJvV38c9F4HTIKorL7DaNyqQXI6poFUx4NqAk5slScug8hzbIn3 PucLXP9YBtGiRea5IpWCe1F3f7Rondaq3dnxkx210mtwT4W/i0h2b9BRNv+kwDwD /RHwL+kVtSAo98C/4TKAihPleiYdtwJ/xcJuV38j2t/V+SgCWE5R7QvwWF/oT395 w5ICu83ox1r6frOH/dnao9mkLrdpLONJfh/gRDRtx1ehLBPgyAxhJTwQDeFoxhTL OlDftD8p6fTn1ftJjKE9wcoOt02Del+YXRBpOXVHCZUJ0kYBb31wayNPdxGTx6No l4pjHB67pO2DTqQGg5vkauLqEwWUpFN+ILwLK7zjlmTY/onjkIBB5An4RG0eAnF/ 85/ImeXRtCWJ =dMrS -----END PGP MESSAGE----- WARNING : STDERR : gpg: WARNING: "--no-comment" is a deprecated option gpg: please use "--no-sk-comments" instead ******************************************************************** Content-type: text/plain Encrypted: -> <-