PGP in perl?

S

Susan Foster

I've been scanning several of the previous posts to this group, and
have tried several methods, but I have been unsuccessful in all my
attempts to be able to PGP encrypt a file from a .pl.

First try was by using PGPSimple - before I go any further, I'll
mention that I am running this program on a Linux box (shouldn't make
a difference, but thought I would say it to be complete). Anyway, I
basically took the CPAN man page example, set them with my settings,
and tried to encrypt. After many adjustments, I have had the program
run - but received no output. Below is what I have set (with
strategic changes for privacy, of course):

use Crypt::pGPSimple;

my $pgp_config_files = "~/.pgp";
my $pgp_version = "6.5.8";
my $pgp_path = "/usr/bin/pgp";
my $pgp_temp_file_path="/tmp/";
$ENV{"PGPPATH"} = $pgp_config_files;
my ($objPGP) = new Crypt::pGPSimple;
$objPGP->Version($pgp_version);
$objPGP->PgpExePath($pgp_path);
$objPGP->PgpKeyPath("$pgp_config_files");
$objPGP->PgpTempDir($pgp_temp_file_path);
my $pgp_public_key_user_id="blah\@blah.com";
my $output_file = "$outfile" . ".pgp";
my $plain_text_message = `cat $outfile`;
$objPGP->PublicKey($pgp_public_key_user_id);
$objPGP->PlainText($plain_text_message);
$objPGP->Encrypt;
my $encrypted_message = $objPGP->EncryptedText;
print "Message:$encrypted_message\n";

The program runs, but nothing comes out of the encryption - I don't
get anything at all.

I also tried an example from this group, which uses open2 - it seems
to use options that are not valid for my version of PGP, and I can't
figure out what are the comparable options in my version.

I hate to be vague - if I need to give more detail, please let me know
- I'd love to get any sort of help - I've been bashing my head over
this for 2 days!

Susan
 
S

Susan Foster

The piece posted below is only a part of the program - I wanted to
focus on the PGP part only. The rest of the program is concerned with
opening a flat file and reformatting it to the client's needs.
$outfile is defined there - and the program uses use strict, so I am
definitely sure that $outfile is defined.

Susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Perl PGP 1
PGP decrypt perl script 1
Perl PGP question 0
Problem using Net::SSH::Perl 4
First Commercial Perl Program 30
dereferencing in perl 12
Tracing Perl 0
Process between paragraphs in perl 1

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top