tags:

views:

25

answers:

3

i have installed gnupg on my office desktop(windows server 2008 sp2) and generated the keys and i was able to encrypt and decrypt using the keys(generated by importing third party xxx.asc file)...but few days back i had to reimage by box. so i had to install the gnupg again....i again imported those keys from the same xxx.asc file..even this time i got the same key set...but thus time though im able to encrypt my test file to .gpg extension .. I am unable to decrypt the encrypted file....the error says..

decryption failed: Secret key not available

can any one who worked on this please help me in getting out of this.....

+1  A: 

Public keys are only for encrypting and secret keys are only for decrypting stuff. Thus, you can freely share your public key and other people can send you encrypted stuff.

The security of public cryptography depends on this design.

Thus, to decrypt your test file you have to import the needed secret key first.

maxschlepzig
A: 

thanks for your response..but..probably you didnt understand my question....here in my case iam actually supposed to send an encrypted file to our vendor and they need to decrypt it.....when iam using my public key(the key which i generated using their xxx.asc file) to encrypt a text file its working good....i got a .gpg extension after encryption...then i sent the file through ftp to them (third party)...but they werent able to decrypt the file.....this is the actual problem.....after hearing that i tried to decrypt the file ...its showing me this error decryption failed: secret key not available....

Please help

Karnati Naveen Kumar Reddy
A: 

What you are asking does not make sense. When you want to send an encrypted file to another person, you need to use their public key to encrypt the file. You can use your private key to sign the file to verify that it was sent by you. If a file is encrypted by your public key, only you can decrypt that file using your private key. Also, by default when you export keys from gpg, it only exports the public key. If you want to export the private key, you need to use the --export-secret-key option.