boat73 has asked for the wisdom of the Perl Monks concerning the following question:
$pubringfile = "C:\\pgp\\public.gpg"; $destfile = "C:\\temp\\dest.gpg"; $srcfile = "c:\\temp\\source.zip"; use Crypt::OpenPGP; $pgp = Crypt::OpenPGP->new ( "PubRing" => $pubringfile #### Define path to public ring t +o be used for encryption ); unless($pgp){ my $err = join(" ", "\n\nCOULD NOT ENCRYPT DATA ", Crypt:: +OpenPGP->errstr, "\n\n"); &sndevent("1017", 1, $err); die; } my $ciphertext = $pgp->encrypt ( "Filename" => $srcfile, "Recipients" => 'myemail@hotmail.com', "Cipher" => 'DES3', "Armour" => 0 ); unless($ciphertext){ my $err = join(" ", "\n\nCOULD NOT ENCRYPT DATA ", Crypt:: +OpenPGP->errstr, "\n\n"); print "$err\n"; } open (FILEHANDLE,">$destfile"); print FILEHANDLE "$ciphertext"; close FILEHANDLE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can Crypt::OpenPGP Encrypt exe or zip files
by blazar (Canon) on Feb 22, 2005 at 17:01 UTC |