willjones has asked for the wisdom of the Perl Monks concerning the following question:
When I run this it errors out on the $pgp->decrypt call and I get the following error message back...use Crypt::OpenPGP; use Crypt::OpenPGP::KeyRing; my $PGPEncryptedMessage = "-----BEGIN PGP MESSAGE-----Version: haneWIN + JavascriptPG v2.0hIwDAAAAAAAAAAABA/4oJfsBR88yts6eY22RJDwEFyhxi2KWIJx +6BR8fufIDN4j3H79sCTN3UHDYoCV5zluSyhdSmM8beF1+hQ7PvSsonDOXrGfovIb9/cIt +QQg1CrgI63Xje85qWW3IUpebnt4UlPnXx1sxK46GtJIEckYppWbXubCunAdFhhCyiq4ZB +qQnZ9EAojfFrI8zkVIC/gq7cMZsu1wgn7/lcUvFewUNWWrU8ykAiC5t=R2eG-----END +PGP MESSAGE-----"; my $arg; my $secring = Crypt::OpenPGP::KeyRing->new(Filename => "$BASEDIR/priva +te.pgp") or die "Error: ".Crypt::OpenPGP::KeyRing->errstr; my $pubring = Crypt::OpenPGP::KeyRing->new(Filename => "$BASEDIR/publi +c.pgp") or die "Error: ".Crypt::OpenPGP::KeyRing->errstr; $arg{SecRing} = $secring; $arg{PubRing} = $pubring; my $pgp = Crypt::OpenPGP->new(%arg); my $message = $pgp->decrypt(Data => $PGPEncryptedMessage) or die "Erro +r: ".$pgp->errstr; print $cgi->header(); print "The secret message is: ".$message;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Decrypting a message with Crypt::OpenPGP
by mscharrer (Hermit) on Apr 23, 2008 at 21:25 UTC | |
by willjones (Sexton) on Apr 24, 2008 at 04:57 UTC | |
by mscharrer (Hermit) on Apr 24, 2008 at 08:43 UTC | |
by willjones (Sexton) on Apr 24, 2008 at 23:16 UTC | |
by Anonymous Monk on Dec 07, 2015 at 02:52 UTC | |
by Anonymous Monk on Mar 30, 2012 at 06:36 UTC | |
by Anonymous Monk on Mar 30, 2012 at 07:02 UTC |