Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Decrypting a message with Crypt::OpenPGP

by willjones (Sexton)
on Apr 24, 2008 at 04:57 UTC ( #682556=note: print w/replies, xml ) Need Help??


in reply to Re: Decrypting a message with Crypt::OpenPGP
in thread Decrypting a message with Crypt::OpenPGP

Great Thanks. I put in the changes you indicated and now I am getting a different error.
It says... "Error: Can't find a secret key to decrypt message"
The private.pgp and public.pgp files are binary and have something like G4... in them
I think it is finding these files okay because if I change the $secring assignment line to look for private1.pgp which doesn't exist it fails saying it can't find that file on that line.
Am I missing something?
Any ideas about what is wrong now?

Thanks
  • Comment on Re^2: Decrypting a message with Crypt::OpenPGP

Replies are listed 'Best First'.
Re^3: Decrypting a message with Crypt::OpenPGP
by mscharrer (Hermit) on Apr 24, 2008 at 08:43 UTC
    I don't have experience with this particular module only with PGP/GPG in general, so I saw this error. I know however that there are different binary formats for RSA/DSA keys, and PGP/GPG keys are such. E.g. I had to convert an binary RSA key generated under Windows once to a different format to use it under Linux.

    Just try to import the binary key with GPG or the PGP freeware and then to export it again in ASCII format.

      Thanks for your help... I finally got this worked out. One thing I had forgotten was the Passphrase.
      my $message = $pgp->decrypt(Data => $PGPEncryptedMessage, Passphrase => "secret_passphrase") or die "Error: ".$pgp->errstr;

      The other thing was that I had accidentally encrypted the original message with the wrong keyID.

      I found the software here useful in generating some keys to encode/decode with. http://www.pgpi.org/products/pgp/versions/freeware/dos/2.6.3i/

      It allows you to specify your passphrase when you generate.
        Can you please share, your full solution? I have read all the post and did the changes recommended above but I still get Can't find secret key to decrypt message. Any help will be appreciated. Thank you!
      hi everyone, has this been solved? i am facing the same problem and it is driving me nuts as well.. any help would be greatly appreciated.

        hi everyone, has this been solved? i am facing the same problem and it is driving me nuts as well.. any help would be greatly appreciated.

        Sure, just convert the key to a recognized format and you're done

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2020-04-06 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (42 votes). Check out past polls.

    Notices?