Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I have tried the following:-

$ gpg --import key.asc

then

$ gpg --decrypt-files a.zip.pgp
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 <nsit_poison@yahoo.co.in>
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 stackoverflow.com Apr 20 '12 at 11:13

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

1  
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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.