Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've lost my key. Now I can't sign anything, and servers don't accept unsigned content. The key is uploaded to a keyserver. Now I have fingerprint, public key and I remember my passphrase.

How can I re-generate same key on my Linux box?

share|improve this question
1  
If the private key could be generated from the public key (not counting brute force), what use would public key cryptography be? –  Mat Sep 22 '12 at 16:18
1  
@Mat I remember passphrase! I have everything needed to make a key, though newly generated keys have different fingerpring and ID. And server don't accept signed content with new keys (same passphrase, algorithm,...) –  sorush-r Sep 22 '12 at 16:38
    
The passphrase is used to protect your private key on disk. It's not related to the private key itself. –  Mat Sep 22 '12 at 16:39
    
Oh... Do I need to know generated prime numbers to make same key? –  sorush-r Sep 22 '12 at 16:41
2  
Well, sort of. If you know the primes (or whatever the secret is for the crypto algorithm you're using is), you have your key already (just not in the right format). If you don't know the secret, you cannot generate it from the public part, unless you brute-force it, or the algorithm is bad, or you happen to be unlucky enough to have used one of the algo's weak keys (if that exists). –  Mat Sep 22 '12 at 16:43

1 Answer 1

up vote 4 down vote accepted

You cannot generate the private key¹ from the public key and the passphrase. The private key does not depend on the passphrase in any way. The passphrase is only used to encrypt the private key when you store it in a file. You could have multiple copies of the same private key encrypted with different passphrases. And you cannot recover the private key from the public key, public key cryptography relies on this being impossible.

The only way to recover your private key is from a backup of the private key.

¹ It's called a private key when there's a corresponding public key, and a secret key for symmetric encryption.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.