Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Can't decode string in Crypt::OpenPGP

by zwon (Abbot)
on Mar 11, 2012 at 05:51 UTC ( [id://958911]=note: print w/replies, xml ) Need Help??


in reply to Need help decoding string in Crypt::OpenPGP

Do you run this cgi script using the same user as when you decrypting with gpg? What happens if you run it without cgi, something like this (not tested!):

use Crypt::OpenPGP; use File::Slurp; my $pgp = Crypt::OpenPGP->new(Compat => 'GnuPG'); my $phrase=read_file('file.txt'); my ($plaintext,$valid,$sig)=$pgp->decrypt( Data => $phrase, Passphrase => "abc123!", ); print "[message: $plaintext<br>valid: $valid<br>signature: $sig<br>err +or: ".$pgp->errstr."]<br><br>\n";

Replies are listed 'Best First'.
Re^2: Can't decode string in Crypt::OpenPGP
by jaf0faj (Novice) on Mar 11, 2012 at 14:30 UTC

    Unfortunately, no difference. Copied your code verbatim into the file 'decodetest', replaced instances of '<br>' with '\n' in the print statement, then ran "perl decodetest". Same results:
    message:
    valid:
    signature:
    error: Symkey decrypt failed: Invalid secret key ID

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://958911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found