$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 to 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;