I gave my public key to third party and then they gave me a encrypted file. I tried to decrypt the file but I am getting an error message “gpg: decryption failed: No secret key”.
I am using windowds 8 and used cleopetra to encrypt and decrypt the file, I also tried to use the following command
here is my command to decrypt:
gpg -d c:\secretfile.tst.pgp
I am willing to pay for the professional service as well. I emailed them but there was no answer. I need to get this resolved quickly.
Thanks for the support.
Type in gpg -K to see if your secret key is listed (upper case K, lower case k will only show the public key). It should be there if you created the key pair on that PC. If it is not there you will need to import the key pair onto your keyring (export the key pair to a file from the other machine, copy the file to the new machine and import it). You also did not specify an output file. You may also need to specify your passphrase or passphrase file in the decryption command. Try something like this:
gpg --passphrase “your passphrase here (include quotes)” --batch -r KeyNameForDecryption --output “C:\Destination\Path\And\FileName” -d c:\secretfile.tst.pgp
You can use -o instead of --output, and --batch is useful for automation so you don’t get a prompted with a question but not necessary if you are typing in the command live time. Your key name should show up from the gpg -K or gpg -k uid line (secret or public will have the same name).
Take a look at this for help (its old but still useful):
Thank you very very much.