boat73 has asked for the wisdom of the Perl Monks concerning the following question:
That seems to create the files no problem but when I try to encrypt using the following code...use Crypt::OpenPGP; $pgp = Crypt::OpenPGP->new (); %attrib = ( 'Type' => 'DSA', 'Size' => '1024', 'Identity' => 'Garett L Holmes <email address here>', 'Passphrase' => 'password', 'Cipher' => 'DES3', 'Verbosity' => '1' ); ($id, $email) = split("<", $attrib{Identity}); $id =~ s/\s+/_/g; chop $id; ($pubkey, $privkey) = $pgp->keygen( %attrib ) or die $pgp->errstr; $public = $pubkey->save; open(PUBLIC,">${id}.public") or die "COULD NOT OPEN ${id}_pub.pgp\n"; print PUBLIC $public; close(PUBLIC); $private = $privkey->save; open(PRIVATE,">${id}.private") or die "COULD NOT OPEN ${id}_priv.pgp\n +"; print PRIVATE $private; close(PRIVATE);
I get this erroruse Crypt::OpenPGP; my $pgp = Crypt::OpenPGP->new ( "PubRing" => 'pubring.pkr' )or die Crypt::OpenPGP->errstr; my $ciphertext = $pgp->encrypt ( "Compat" => 'PGP5', "Data" => 'this is a test', "Recipients" => 'Garett L Holmes', "Armour" => 1, );<br> die "Encryption failed: ", $pgp->errstr unless $ciphertext; print $ciphertext;
Edited by BazB: fixed/added code tags. Removed email address.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: crypt::openpgp encrypt error
by hv (Prior) on Mar 12, 2004 at 00:44 UTC | |
by boat73 (Scribe) on Mar 16, 2004 at 23:59 UTC | |
|
Re: crypt::openpgp encrypt error
by Thelonius (Priest) on Mar 11, 2004 at 20:14 UTC | |
by Anonymous Monk on Mar 11, 2004 at 23:03 UTC | |
|
Re: crypt::openpgp encrypt error
by waswas-fng (Curate) on Mar 11, 2004 at 20:37 UTC | |
by Anonymous Monk on Mar 11, 2004 at 23:04 UTC | |
by boat73 (Scribe) on Mar 11, 2004 at 23:28 UTC | |
by boat73 (Scribe) on Mar 11, 2004 at 23:36 UTC |