user3179626
user3179626

Reputation: 1

gnupg decryption using public key provided by the vendor

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.....

Upvotes: 0

Views: 4458

Answers (2)

EndlessSpace
EndlessSpace

Reputation: 1370

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.

Upvotes: 0

maxschlepzig
maxschlepzig

Reputation: 39065

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.

Upvotes: 2

Related Questions