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

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.

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

Replies are listed 'Best First'.
Re^4: Decrypting a message with Crypt::OpenPGP
by willjones (Sexton) on Apr 24, 2008 at 23:16 UTC
    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!
Re^4: Decrypting a message with Crypt::OpenPGP
by Anonymous Monk on Mar 30, 2012 at 06:36 UTC
    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