Secret key without public key

Tyler Spivey tspivey at pcdesk.net
Tue Mar 30 04:01:59 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

I ran a brief test, and was able to recover from this. Before you do
anything, I recommend making a backup of ~/.gnupg so you can easily
restore it. Here are my results, where 0xae742aaf is my key:

#backup ~/.gnupg
cp -a ~/.gnupg ~/.gnupg.orig
#make and encrypt a test file
touch test
gpg -e -r 0xae742aaf test

That worked fine. Then I moved the public keyring to break things:
mv ~/.gnupg/pubring.gpg ~/.gnupg/pubring.gpg.orig
gpg test.gpg
and it said:
gpg: keyring `/home/tyler/.gnupg/pubring.gpg' created
gpg: key AE742AAF: secret key without public key - skipped
gpg: encrypted with RSA key, ID C6570DCB
gpg: decryption failed: secret key not available

#export the secret key, because exporting public won't work
gpg --export-secret-key -o secret.key 0xae742aaf
#delete it so we can re-import
gpg --delete-secret-key 0xae742aaf
(answer yes to the prompts)
gpg --import secret.key
The output included:
gpg: key AE742AAF: secret key imported
gpg: key AE742AAF: public key "Tyler Spivey <tspivey8 at gmail.com>"
imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg:       secret keys read: 1
gpg:   secret keys imported: 1

once done, the decryption of test.gpg worked fine.

Hope this helps.

CONNIE RODRIGUEZ wrote:
> Great!!  Thank you for your help.  I will post on how it went.
>  
>>>> Larry Brower <larry-lists at maxqe.com> 3/29/2010 7:15 PM >>>
> CONNIE RODRIGUEZ wrote:
>> This is a development box..no backup.  Can I copy from the another 
>> environment?
>>
> 
> yes if you have the key on another server such as a production box.
> 
> gpg --export-secret-key -a > a-filename-here
> 
> copy it to the dev box with something like scp
> 
> then on the dev box
> 
> gpg --import a-filename-here
> 
> make sure to remove the file you generated exporting the key. You 
> don't want someone to see copy it ;)
> 
> shred -f -n 1000 -z -v -u a-filename-here
> 
> 
> </pre>	<span style="color: rgb(0, 160, 0); font-weight: bold;">Please consider the environment before printing this e-mail</span><br />
> 	<br />
> 	
> 	<span style="font-size: 8pt;">This e-mail, facsimile, or letter and any files or attachments transmitted with it contains<br />
> 		information that is confidential and privileged. This information is intended only for the use of the <br />
> 		individual(s) and entity(ies) to whom it is addressed. If you are the intended recipient, further <br />
> 
> 		disclosures are prohibited without proper authorization. If you are not the intended recipient, any <br />
> 		disclosure, copying, printing, or use of this information is strictly prohibited and possibly a <br />
> 		violation of federal or state law and regulations. If you have received this information in error, <br />
> 		please notify Children's Medical Center Dallas immediately at 214-456-4444 or via e-mail at <br />
> 		privacy at childrens.com. Children's Medical Center Dallas and its affiliates hereby claim all <br />
> 		applicable privileges related to this information.</span><br />
> 
> 	<br />
> </html>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users


- --
Tyler Spivey - PGP Key ID: 0xae742aaf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCgAGBQJLsVuWAAoJEPb0SlyudCqv0gUQAIXn8/K4MhgYikjtDodY6GyI
8/Ge07rWrTYcGuxFRAMBhMpRfJ41rTn69WvCJB03QYtIGuunASNGWFvFwnBLvfQ5
ms9A3XJMd4qx0sLyvcOhfJKaQcR26MSHmmuw5n6WxxC9Oc5IhVnEgt+YOn68ye0r
rtM2q5VzZwU3cFdwgyfF0nsUPFVVA9e7/RKncURy2qPy8tlDMJCde+c3DCYcPwfi
5fDrHjfzXk6tEdiKeZYpwtNEksOvOdiuolFzwbg8d2i0vvsndzz2GwZgdgRGWg0R
pWcRNYss4YRScwwhg4Xpe9w/b0lDAOeqZFT/IzdUIkWDo+gsiil5+t3OBwxWfKtq
lSjNZ3Dp4PvAP0Qxfq0XmP6OV4M0oTH8WzLSl7QN47wVRVa9IBw8hyvo0oMsPp04
mC5cKKruaB9EG/sDU7AJ9mjJSF2DE46RzkH3nGGXySacJi+CvUym7mawS3Nqh1Sl
DJTIkheTbQ+Mfy+QPHPXY5+g98GXBT0sMVXUCAcYW3ECkIWY+WRRsOKOVcbFVwXp
AbwZp6U7x6qw/puP1mAMuYakvoq+d2biE729SY6+dLY8lWIat+ANgEu+KyBsGnS7
ddP8BnrTzHnDSQtSHnk7vCznuhHUhC3w/VKi6knjRJzXp7pwuIHzuSkDS2ue0hcC
eOoBBAbNg61BpsLazyma
=gVix
-----END PGP SIGNATURE-----



More information about the Gnupg-users mailing list