PGP Encryption/Decryption issue & Integrity methods

1

We had a process that ran for almost 3 years with no problems until last week.

We tried to generate an encrypted file and it successfully made it, but on decryption, it gave us this error:

It's not possible to decrypt this message because your keyring does not contain usable private key(s) corresponding to any of the above public key(s).

How can I fix this problem?

Also, After this error, we're trying now to add some Integrity Check for the encrypted files, so, is there any thing that I can do with pgp's .exe file(s) to do so? Or what else should I do with my code to make this thing work?

Anas Mousa

Posted 2013-05-19T11:12:56.153

Reputation: 11

Please be a little bit more careful with punctuation (no reason to use more than one ! or ? at once), it makes your question horrible to read. – Jens Erat – 2013-05-19T12:20:02.753

Answers

0

OpenPGP uses Public-Key-Encryption. This means you're handing out your public key (thus it's named public) for others to encrypt information targeted to you and only the holder of the private key (here: you) can decrypt it.

The error message is quite clear: You encrypted the file using a public key for which you haven't got the private key in your keyring. You will need to import it; if you haven't got it (any more), you cannot decrypt the file.

If you're using Symantec PGP, you can do it using

pgp --import <keyname.asc>

For GnuPG, just replace the pgp by gpg.

Your encrypted file will be probably allright, PGP could read it, otherwise it would have echoed another error message.

Jens Erat

Posted 2013-05-19T11:12:56.153

Reputation: 14 141

Thank you for the answer. So, If I have 10 .asc files for example, I will only have the 10 different public keys in these files, am I right? we are facing this issue in the encrypted files of one client, while things are ok the remaining clients. – None – 2013-05-19T15:03:37.303

One more thing, I'm using PGP Freeware for Windows. Is there any integrity tool that is associated with pgp.exe file? – None – 2013-05-19T15:06:39.897

These 10 files could be anything, private keys, public keys, signatures, encrypted data. Have a look inside them (the first and second line of the data block tell you what it is). If it's only with one client you're probably using different keys and you - or the client - either used a wrong public key or the correct one but you're missing the private key. – Jens Erat – 2013-05-19T15:07:17.630

I can't help you with that software, haven't even got a Windows installation around right now. – Jens Erat – 2013-05-19T15:09:14.593