tags:

views:

38

answers:

2

If yes then they are really not a pair.

I was trying to figure out how ssh [email protected] resolves my name using my private key. SSH debug suggests public key is passed to server.

+1  A: 

Yes, it is possible.

Sidebar: I'm not sure what you mean by, "they are really not a pair". A pair is when you have two things. A public key and a private key are two things, ergo, you have a pair. The fact that you can derive one from the other is immaterial.

I don't know how github does this, but my guess is simply that they use the public key to identify your account (your public key is unique, pretty much by definition).

I hope this answers your question. I have a feeling I'm not quite getting it.

Marcelo Cantos
Please explain, AFAIK it's not possible to recreate one key by knowing the other.
DarkDust
Generating a private key from a public key is intractable, which is what gives public-private key systems their security. There is no corresponding requirement to prevent the opposite transform. Try the command I suggested in my comment to @Xaqron's answer. On Putty for Windows, you'll notice a menu option to generate a public key whenever you load a private key.
Marcelo Cantos
Thanks. I did notice that option in putty but was not comfortable with the idea. Your point of distinction between real world public key systems is very much valid. I went through http://en.wikipedia.org/wiki/RSA and it seems if you would use pure definition of private and pulic keys (#5 in worked example on wikipedia page), then it would be practically impossible to generate either of the keys from other. A practical private key has the seed prime numbers embedded which enables it to compute the public key.
Ravindra
In fact, you are right that the private key has public key embedded. >> openssl.exe dsa -in id_dsa -noout -text
Ravindra
A: 

No, it's not possible.

Neither private key, nor public key cannot be produced form the other one. Remember, private key is the same as public key by design and we call them public or private optionally (keeping one of them private and reveal the other).

Xaqron
Public and private keys are not symmetric in practical systems. Try this under Unix: `ssh-keygen -y -f ~/.ssh/id_rsa`. Perhaps at the level of the math, they are symmetric — I don't really know — but in real-world public-key systems, the public key is derivable from the private key (perhaps they just embed it).
Marcelo Cantos
I don't know the tool (ssh-keygen) but according to your reputation I think you just mixed-up symmetric and asymmetric concepts. Public/Private keys are asymmetric, in math or in real world and they can be produced just as pairs.
Xaqron