Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file along with an key.asc file. How can I extract the files from ?

I have tried the following:-

$ gpg --import key.asc


$ gpg --decrypt-files
gpg: encrypted with 2048-bit ELG-E key, ID 20242EB8, created 2009-12-17
gpg: encrypted with RSA key, ID 744D6CB7
gpg: decryption failed: secret key not available

$ gpk -k

pub   1024D/F8802D87 2009-12-17

uid                  Nsit-Poison <>
sub   2048g/20242EB8 2009-12-17

Does anybody have any idea if this is because that I don't have the good key file ?

share|improve this question

migrated from Apr 20 '12 at 11:13

This question came from our site for professional and enthusiast programmers.

A pure guess is that the 'key.asc' file contains a public key, which can encrypt a file, which then can be decrypted with the correct private key (which you possibly don't have). This is the purpose of (p)gp(g). It would help to know the context in which you obtained these files. – Eroen Apr 20 '12 at 11:42

Yes, you have the wrong key.

gpg -k lists the public keys (ie, the keys you need to encrypt something). You need the private key that matches the public key this file was encrypted with. When you have it, gpg -K (note capital) will list it with sec ("secret") instead of pub in the output you excerpted above.

share|improve this answer

You must log in to answer this question.