News for hackers. Stuff that matters.
Re:More Git and GitHub Secrets by oelmekki on Thursday July 25, 2013 @03:17AM (#6101277)
A load of nice tricks, thanks.

I'm a bit concerned about the public keys public url. Ok, it's just public keys, so it must be safe, but I wonder : is it safe like it's "safe" publishing a login without a password ? In other word, doesn't knowing public key make easier to break private one ?

Re:More Git and GitHub Secrets by seniorsassycat on Thursday July 25, 2013 @03:25AM (#6101302)
Publishing a public key does not make cracking they private key easier. I guess if I got access to someone elses private key but I didn't know whose it was I could use the published keys to identify who the private key belongs to.
Re:More Git and GitHub Secrets by oelmekki on Thursday July 25, 2013 @05:22AM (#6101587)
Ok, thank you both for clarification.
Re:More Git and GitHub Secrets by graphene on Thursday July 25, 2013 @03:22AM (#6101289)
No, that's the whole point of public key cryptography; that the private key cannot feasibly be used to derive the public key, but the other way around is trivial.
Re:More Git and GitHub Secrets by Anderkent on Thursday July 25, 2013 @05:22AM (#6101586)
>the private key cannot feasibly be used to derive the public key, but the other way around is trivial

I assume you meant to say that the private key cannot feasibly be derived from the public key, but the other way around is trivial.

Re:More Git and GitHub Secrets by graphene on Thursday July 25, 2013 @08:51AM (#6102136)
Yes, you're absolutely right; it seems it's too late to edit my original post though...
Re:More Git and GitHub Secrets by sergiosgc on Thursday July 25, 2013 @07:18AM (#6101836)
Usually, the keys are entirely symmetrical. You just name one public and the other private. It's difficult to generate one from the other. The easy task is generating both at the same time.
Re:More Git and GitHub Secrets by dlitz on Friday July 26, 2013 @04:57AM (#6107233)
> Usually, the keys are entirely symmetrical. You just name one public and the other private.

Nice try, General Alexander. :P

In DSA, the public key is (p,q,g,y) and the private key is (p,q,g,x). The public "y" is computed directly from the private key using the formula: y = g^x mod p. Thus, anyone who has the private key can compute the public key.

In RSA, the public key is (n,e) and the private key is (n,d). They're not interchangeable because of two speedups that we use:

1. Small public exponents. Most of the time, e is either 65537, 5, or 3. This speeds up encryption and signature verification, but also means you can trivially guess the public key.

2. CRT exponentiation. The private key is actually (n,d,p), where p is one of the prime factors of n. This speeds up decryption and signature verification, but recall that the security of RSA is based upon the difficulty of factoring n.

Re:More Git and GitHub Secrets by darkarmani on Thursday July 25, 2013 @12:58PM (#6103438)
The private key is normally stored in a file containing both the private and public key.
Re:More Git and GitHub Secrets by skeletonjelly on Thursday July 25, 2013 @08:03AM (#6101952)
Can't you generate a public key from a private one easily?
Re:More Git and GitHub Secrets by gbaygon on Thursday July 25, 2013 @08:32AM (#6102074)
Yes:

  ssh-keygen -y -f private_key.pem > public_key.pub
Re:More Git and GitHub Secrets by emmelaich on Thursday July 25, 2013 @09:19AM (#6102271)
Yes and no. It extracts the public key from the private key file. The "private" key file includes both keys.

The public key file doesn't.

Re:More Git and GitHub Secrets by dlitz on Friday July 26, 2013 @05:17AM (#6107269)
> The "private" key file includes both keys.

It wouldn't need to, though. Given the private key (n,d), the public key is probably (n,65537).

Re:More Git and GitHub Secrets by txutxu on Thursday July 25, 2013 @05:58AM (#6101671)
No. But it eases "man in the middle" attacks (someone impersonating the host you think you're connecting to, with that key).

Still, if someone puts your pub key in an authorized_keys of a malicious host, and then manipulates your DNS or ARP to conduct you to such host, you should get some SSH warnings about the host fingerprint, etc.

And still, if you're using a dedicated key, the only possible attack could be to make you commit your repo changes, to the malicious machine instead of to github.

Re:More Git and GitHub Secrets by inopinatus on Thursday July 25, 2013 @06:32AM (#6101742)
This is also the reason not to forward your ssh-agent (in my view, one of the most poorly considered features of ssh).
Re:More Git and GitHub Secrets by dlitz on Friday July 26, 2013 @05:22AM (#6107281)
If agent-forwarding wasn't implemented, more people would just copy their private keys to several machines.

At least when you use agent forwarding, your key is only exposed while you're actually connected to the machine.