Hi,

I have a program that uses Crypt::OpenPGP to encrypt and decrypt files
on our company server. I need to pp the program to create a .exe as I
do not want Perl installed on the server. I have written the program
and it works fine on a test workstation in native Perl but fails when
'Parl'ed using pp.bat.

I've recreated the core of the program and can re-create the problem.

The following program works fine when run in native Perl but fails
with a 'No known recipients for encryption' error when the 'pp'ed .exe
file is run.

The program refers to 'pubring.gpg' which is a GPG-compliant keyring
file containing a valid public key for [EMAIL PROTECTED] This was
created using the GPG program.

Am I missing something (it has been known) or is there a bug here?

Perl is ActiveState version 5.8.8.817
used 'ppm' to install PAR-588 version 0.959

Incidently, after upgrading PAR-588 to the latest version I could get,
I had to individually install Getopt-ArgvFile [1.09] to get pp to run
without errors

TIA,

Program is:
#!/bin/perl -w

# test encryption script

use Crypt::OpenPGP;

my ($infile, $result, $outfile, $temp);

my $pgp = Crypt::OpenPGP->new(  Compat  =>      "GnuPG",
        SecRing =>      "secring.gpg",                          PubRing =>      
"pubring.gpg",
        );
if (defined($pgp)) {
        print "\$pgp created OK\n\n";
} else {
        print "\$pgp not created for some reason\n\n";
}

if (-e 'pubring.gpg') {
        print "pubring.gpg exists OK\n";
}

print "Input file to be encrypted: ";
$infile = <STDIN>;
chomp $infile;

$result = $pgp->encrypt(        Filename        =>      $infile,
                        Recipients      =>      "[EMAIL PROTECTED]"
                        );

if (defined($result)) {
        print "File encrypted OK\n";
} else {
        print "There was a problem encrypting the file\n";
        if (defined(${$pgp}{_errstr})) {
                print "Error: ${$pgp}{_errstr}\n";
        }
}

if (defined($result)) {
        $outfile = $infile . ".enc";
        open(OUTFILE, ">", $outfile) || die "cant open file: $!";
        binmode OUTFILE;
        print OUTFILE $result;
        close(OUTFILE);
        print "Encrypted data written to file.\n";
}

Reply via email to