News for hackers. Stuff that matters.
Re:Ask HN: What are the best practises for using SSH keys? by carlesfe on Sunday September 25, 2016 @09:33AM (#12575236)
Nobody seemed to answer this question, and neither did the original blog post (besides "trust me and do it"), so maybe you can shed more light on the main point:

Why are ED25519 keys better than RSA, how compatible are they with different systems, and are they worth the hassle and risk of generating and using a new one?

Re:Ask HN: What are the best practises for using SSH keys? by lisper on Sunday September 25, 2016 @10:05AM (#12575358)
> Why are ED25519 keys better than RSA

Two reasons: 1) they are a lot shorter for the same level of security and 2) any random number can be an Ed25519 key. To generate an RSA you have to generate two large random primes, and the code that does this is complicated an so can more easily be (and in the past has been) compromised to generate weak keys.

Re:Ask HN: What are the best practises for using SSH keys? by carlesfe on Sunday September 25, 2016 @04:19PM (#12577203)
If I understood it correctly, you're saying that RSA requires the two numbers to be big AND random, otherwise the algorithm isn't strong? Therefore Ed25519 is better because it's strong regardless of the key?

What I don't get then is how can a short key be secure, that goes against what I was taught in college. Aren't shorter keys more prone to collisions and bruteforce attacks?

Re:Ask HN: What are the best practises for using SSH keys? by rosser on Sunday September 25, 2016 @04:25PM (#12577240)
Aren't shorter keys more prone to collisions and bruteforce attacks?

Given the same cipher, more or less, yes. Between ciphers, though, key-lengths are less relevant, and the differences in those ciphers become more so.

EDIT: Think of it in terms of Shannon Entropy: because RSA requires a pair of primes, the keyspace is so much sparser — that is to say, more "predictable" (if, granted, at a mostly theoretical level) — so keys need to be that much larger to be secure.

Contrarily, with ED25519, keys can be smaller, because the keyspace is denser.

(Or am I just talking out my ass here?)

EDIT 2: s/smaller/sparser/, s/bigger/denser/, regarding keyspaces. Thanks, 'lisper!

Re:Ask HN: What are the best practises for using SSH keys? by lisper on Sunday September 25, 2016 @04:54PM (#12577383)
Not bigger -- denser.
Re:Ask HN: What are the best practises for using SSH keys? by carlesfe on Sunday September 25, 2016 @05:56PM (#12577671)
Great replies, I got it now, it makes sense. Thanks to both of you!
Re:Ask HN: What are the best practises for using SSH keys? by lisper on Sunday September 25, 2016 @04:53PM (#12577382)
RSA requires two numbers which are big and random and prime. It is the primality that makes things tricky. Generating random primes is a lot harder than generating random numbers.

The other factor (no pun intended) that makes RSA keys large is that there are more efficient algorithms for factoring than there are for solving the elliptic curve discrete log problem, e.g. https://en.wikipedia.org/wiki/General_number_field_sieve If you crunch the numbers on this you will find that a 2000-bit RSA key has a security level of about 100 bits, i.e. it takes about 2^100 operations to factor a 2000-bit RSA key using GNFS.

Re:Ask HN: What are the best practises for using SSH keys? by YomiK on Monday September 26, 2016 @09:11PM (#12586909)
Not disagreeing, but I think both randomness and primality testing both have the problem that it's so easy to do them poorly. Generating random primes of these sizes isn't all that difficult, and even proofs can be done in reasonable time frames (e.g. under 10 seconds for 1024-bit inputs). There are also a couple random proven prime algorithms which run pretty fast. Getting software to correctly implement everything .... that seems to be hard.
Re:Ask HN: What are the best practises for using SSH keys? by lisper on Monday September 26, 2016 @09:30PM (#12586949)
> Getting software to correctly implement everything .... that seems to be hard.

Exactly. Generating random primes is not terribly difficult in theory, but in practice it is very tricky, which makes it hard to answer the question: how do you know you can trust your keys? Sure, you can verify that your primes are prime, but how do you know how much entropy they have? The only way to figure that out is the audit the code. (And then you have the problem of making sure that the code you're running is the code you audited.)

Generating random numbers is also tricky, but a lot less so than generating random primes: take an entropy source and run it through a whitener, i.e. feed it to sha512. As long as you have a reliable estimate of the lower bound of the quality of your entropy source, you're good. A lot fewer moving parts.

Re:Ask HN: What are the best practises for using SSH keys? by arca_vorago on Sunday September 25, 2016 @09:58AM (#12575328)
ED25519 keys are cryptographically more secure, and are more politically secure if you want to call it that due to the undermining of NIST the NSA was/is doing. (plus it comes from djb, all hail djb!)

OpenSSH already has support built in, as does Mosh, and therefore, I do think it's worth it.

I do sometimes disagree with using keys though, despite everyone pushing it so hard, there are cases where I think passwords are the way to go, but thats a long post for another time.

Also, I really like usin pam auth mods, such as yubikeys or google auth for two factor. That combined with regular hardening, and yes Ill admit it, non standard ports (reduces log alert fatique) does a pretty good job.

Re:Ask HN: What are the best practises for using SSH keys? by effie on Sunday September 25, 2016 @04:49PM (#12577364)
> I do sometimes disagree with using keys though

That sounds interesting, could you elaborate on that?

Re:Ask HN: What are the best practises for using SSH keys? by duaneb on Sunday September 25, 2016 @04:35PM (#12577287)
Note that ED25519 is more vulnerable to quantum computation than is RSA.
Re:Ask HN: What are the best practises for using SSH keys? by rosser on Sunday September 25, 2016 @06:20PM (#12577760)
If, like most such claims I've seen lately, you're referring to No Such Agency's recommendation against adopting Suite B, the reasons behind that move seemed to me not to be about ECC being "more" QC vulnerable than RSA. They simply said, "If you haven't made this switch already, just keep using RSA while we figure this whole 'quantum' thing out."

ECC and RSA are both ultimately going to fall to practical quantum computing, and probably over a time frame short enough that it won't matter which cipher you picked.