Decryption Failed: No Secret Key

So I have a message to decrypt for a 2fa. My keys were somehow wiped from my Kleopatra. I have reuploaded my secret and public key back, but it still won’t decrypt my 2fa message. I have checked my secret keys in cmd and my secret key is there and seems to be working, but the message refuses to decrypt. Any ideas??

Hi,
if everything was restored from your backup, first do a functional test.
For example encrypt and decrypt something with Kleopatra.

If this does not work, try the command line, e.g.
gpg --verbose --encrypt --recipient XYZ FILE.txt

gpg --verbose --decrypt FILE.gpg

Sometimes when restoring from backup you may need to set your public key back to “ultimate trust”.

Regards,
Bernhard

Hi ,

I am doing server migration. I am also getting same error gpg: decryption failed no secret key.

But I receive the encrypted files from my vendor.so I requested them to share the secret key. They also shared both private key and public key which they used to encrypt and I have imported them using gpg --import …file name.

But still I am getting the same error.

Could you please help.

Note in both server same version gpg4win is installed and nothing is working in new server

But when I do manually like by right clicking the encrypted .CSV.pgp files → more gpgex options → decrypt it’s working by entering the passphrase

But not with the batch file script.

Thanks and regards,
Safihabanu

Hi @Safi,
did you try to use the parameter --verbose as Bernhard mentioned? It can help you to get more information about the problem.

Also, can you please tell us which version of Gpg4win you installed?

What I think is weird is that you asked for their secret key. You should never share your private/secret key with anyone.

It’s always --pinentry-mode loopback

God how I hate that setting,…

@aheinecke

If it was working before, what was the change that broke it?

@Safi can you also do it manually like it is done in the batch file? Could you share (uncritical parts) of that batch file?

Yes, old server Gpg4win and new server’s version of Gpg4win maybe useful.