LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   GPG : Failed to decrypt the file (https://www.linuxquestions.org/questions/linux-general-1/gpg-failed-to-decrypt-the-file-943739/)

Ashish Sood 05-07-2012 02:31 PM

GPG : Failed to decrypt the file
 
Hi All,

I dont know what i am doing wrong, but i am facing a problem while decrypt gpg encrypted file , Below is the step of what is was doing.

[Server]

# gpg --gen-key => Generate GPG key

# gpg --export --armor keyname > output.key => take gpg key to output.key

#gpg --encrypt --armor --recipient recptname filename =>encrypt file for recipient

# scp output.key 192.168.10.2:/root/key => 10.2 is my client system where i copy my output gpg key

scp filename.asc 192.168.10.2:/root/key => copy the excrypted file to my client system

[client]

# cd /root/key

# gpg --import output.key => import server gpg key to my client system

# gpg filename.key => Try to decrypt but fail and getting the below error message

gpg: encrypted with 1024-bit ELG-E key, ID 05ABA7C9, created 2012-05-07
"Ashish <ashish_sood@live.in>"
gpg: decryption failed: secret key not available


It telling me that secret key is not available but its is available on my system, below is the output from my client system

# gpg --list-key

pub 1024D/34E9A260 2012-05-07
uid Ashish <ashish_sood@live.in>
sub 1024g/05ABA7C9 2012-05-07


Guys please tell me what is wrong in this . hope to get your reply ASAP

Thanks
Ashish Sood

sundialsvcs 05-07-2012 03:02 PM

Does the target system know about the key with signature 05ABA7C9? Has this key been imported from a suitable keyserver on that system? (Never mind yours!)

Print this (courtesy of a geek at NASA): http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/gpg-cs.html ("Your Tax Dollars at Work." Really!)

Check the output of gpg --list-keys on the target system. If for whatever reason the desired key is not there, that system cannot decrypt the file.


All times are GMT -5. The time now is 06:25 PM.