Reset laptop and lost secret key - is there a way to recover through windows?


I recently reset my laptop due to performance issues. Before doing so, I accidently saved my public PGP keys instead of my secret one. I now cannot decrypt messages that are encrypted with my prior secret key. I am wondering if there is anyway that I can recover my key through windows? or through another method.

Thank you

Hi Dorian,

if you really lost your secret key material, there is nothing that can be done from the OpenPGP side of things. It all comes down to find a still existing copy of the secret key material.

Apart from potential exports of the secret keys. You could look into backups, if there are any. The GnuPG configuration directory usually holds the secret keys in a directory called private-keys-v1.d. If you haven’t done a backup. Maybe Windows backups some files when doing your “reset”. Check into the documentation of that “reset” you’ve done, maybe there are some saveguards in place.

Best Regards,

I am in a similar situation, but I have my private-keys-v1.d folder. It contains two files ending in .key. What do I do with them? How do I get my secret keys back?
When I try running “gpg --import A09388D03CAB8870AD.key” I get:
gpg: no valid OpenPGP data found.

What am I doing wrong?


Hi Bryan,
the files from the private-keys-v1.d folder are in an internal data-format.
To recover you need to place them in the same directory for your new installation.

You also need the corresponding public key, which can be imported.
Maybe a communication partner can send it to your, or it is still available on WKD or a public keyserver.


Your secret key would have had to have been exported first for that method to work
with command gpg --export-secret-keys -a “Paul Benson”>mypriv.key, or whatever
the user id is for your keys. Your email address you set up for the keys can be used instead
of a username.

What is the path to the private-keys-v1.d folder?