First off I dont use command line of any sort, Interact mostly using the GPA part of the gpg4win download,
I did a system reset and did no save my files because I believed I had my prive keys backed up in .asc files (which I did).
Somehow or another one of the files must have gotten corupt because even though the two files (I haad two keys) were identicle accept for the name, only one would import and of course its not the one I need.
Now I somehow have the needed private key in a different format its title is 40alphnumeric digits with a .key file extension. OF course it wont import directly but when I open this file in word pad it starts out like (21:protected-private-key(3:rsa(1:n257: and then goes onto the encoding. SO obviously I am trying to see if I can import that file somehow in order to regain access to my private key?
This is of immediate urgent importance so anyone who can help I would greatly appreciate
if you have files starting with
(21:protected-private-key( those are probably the ones that contain your private key material in the “new” format as used by gpg-agent (the component that reads the private key stuff).
Here are technical instructions how to recover from there:
(only the first part)
- Create a new set of directories (like with running gpg -l on the command line)
- Place the files in the right directory
- Reimport your public keys from somewhere, if you haven’t.
Hope this helps you!
WEll than you so kindly, now that you have explained what those files are very clearly (thanks) I have determined that these are not actually the private key i am trying to locate. So now im down I believe to my one last hope, I copied both of my private keys to asc files and saved them to a usb disk. Anyway both files look IDentical save for their name but when I import the one. it easily reads it and imports both keys parts but when I try and import the other it says no keys are found. IS there any chance of importing it another way that might work, im desperate here,
there is only one
gpg --import functionality for OpenPGP key files that I know of, and the other way is placing the internal files in the right directory, as explained in my previous post.
If one .asc file works, then the other should, too. Given that it has a different contents.
You can use the command line as shown here https://wiki.gnupg.org/TroubleShooting#Command_line_operations
and try an
gpg -v --import to see more what is happening.
If the second file really is the same, then it would be the expected behaviour that no new key material is imported as everything is already there.
Ok so now I have a new problem, After using just about every recovery program you can imagine I was finally able to locate it - several copies of it as it turns out. When I open the files in notepad it doesnt show the pub and private keys in plain text as it did when I origionally backed it up . IT shows a bunch of seemingly rando ANSII code i think. But any way a couple of the copies when I try and importy them to kleopatra I get
Deprecated PGP-2 keys skipped:
Any idea how I fix that?
this sound like you’ve found old key material (that usually should not be used anymore).
Also see https://www.gnupg.org/faq/whats-new-in-2.1.html#nopgp2.
(If you see encoding in seemingly random ascii code, it could be a base64 encoded file.)
Well heres where I stand now, both Kleopatra and GPA believe they have both the private key and the public key that I am after, Great right? Well not so much because if I try to decrypt a message encrypted with that key I get:
GPA 0.10.0, GPGME 1.14.0-beta36, GnuPG 2.2.19]
gpg: encrypted with 2048-bit RSA key, ID 2B09EF1945844B81, created 2018-04-21
“Nobodyz Holmz firstname.lastname@example.org”
gpg: public key decryption failed: Invalid value
gpg: encrypted with 2048-bit RSA key, ID 1304684CB7063328, created 2018-04-21
“Nobodyz Holmz email@example.com”
gpg: public key decryption failed: Invalid value
gpg: decryption failed: No secret key
On GPA and on Kleo. When I back up that key that says it has both keys, first off its doesnt ask me for my passphrase like it always has in the past when I backed it up and if I open the .asc file in word pad it used to contain just the public key although the heading saidthe it contained the private key too but i just opened it again and now the document is 100% blank even though windows explorer claims its 6k. I basically have several different versions of the key because I have used several different recovery tools to try and find one that will work. SOme of them have ASCII coding in it (i think) some have gone some sort of asian coding , some are blank even though they are the exact same size as my back up of my other key that does contain both keys…
.Along with the now blank .asc file I found 2 more of the files i described below that are apparently the key type that is split into 4 parts and the dates on them seem to match they key im looking for and when I put them into the privare-keu-v1.d directory thats when both programs sttarted thinking it had the complete pair but I am gussing since there is only two I ts just the public key or? I am just sharing as much info as I can to see if any one has any helpful suggestions. I would apprecciate anyone who thinks they can help refrain from just sending me to another thread that just confuses me more,keep in mind that I know basically nothing and dont even know how to open the command line let a lone have a clue how to use it, avoid using language or jargon that will ultimatly just leave me more confused (treat me like im 2) and finally please refrain from telling me what you think my problem is If that messagfe doesnt also include very clear and concise instructions that read as if they are intended for someone who just downloaded these tools for the first time and doesnt really even know anything acout it, I dont mean to sound demanding or whatever but in reading other posts and even the responses to this post and while I appreciate the promt effort but mostly I havent got clue what Im being told to do if anything at all, Thanks again for anyone who still is willing to help me,
sorry to hear that you are still struggling to recover your key pairs.
(Note: to operate OpenPGP someone needs the public key and the corresponding private
keys, they are often called a “key pair” together.)
We are trying to help as good as we can, but if some important parts of data was lost, there may be no way of recovering. And trying to find files and restore them can be a very technical challenge and investigation work.
If you have a backup and can just restore the GnuPG files, you should be fine. Otherwise
there is no easy advise (expect for doing more backups next time).
So maybe you should consider the documents lost, create a new key pair, make a backup,
tell your correspondents to resend important documents if necessary.
If any one i still around I think I figured out what the deal was, I do have my private key but it wont import becasue its armored (At least I think I know what Im talking about). I came to this conclusion when on a whim I decided to to copy the the ACII code in what was supposed to be my back up into several different code concerters and the very last one spit out my private key only its completley unformatted. I know its my complete private key because I always make a point to memorize the first 10 and last ten characters of my private keys so that if for some reason I am not sure which key Im looking at I can check the characters iI memorized and at least be reasonable sure which key it is and if its complete. So now my question is, is there anywau to reformat it or is the formatting just as mucj of they cypher as the characters themselves. I know if you mess with the formatting at all it wont be recognize but anyway please let me know if you know of a way.
the files in the internal GNUPGHOME directory, are the format the GnuPG itself uses to write and read the files. So any decoding on these files should not be necessary.
(You can look up the meaning and the default location of GNUPGHOME in the documentation.)
If you manages to get those files back, there are two ways to restore them:
a) try to import them into GnuPG (experts prefer the command line for the highest possible verbosity to diagnostics)
b) Try to place them in the internal structure of a GNUPGHOME directory (this is advanced, compare a working test installation with the files you have or read documentation for developers)
Anyway the easiest solution if there was no backup, like in your case, is to create a new key pair and ask your communication partners to resend documents if necessary.