I am not of the field of IS but I want to secure my humble VPS and I cam across a clashing of opinions between 3 IS guys: 2 say that ed25519 ssh keys are a bit more secure than ssh-rsa of 4096 bytes and one says that in our era, there isn't a significant different at all and either will be just fine for me.

While I don't know who's "right", I went to do some limited reading (limited as I don't have the knowledge to fully understand every passage I read on the subject), and I found out by all that has to do with bytes, public ed25519 keys have much fewer bytes than public ssh-rsa 4096 keys, and hence their private keys are also much shorter.

My question can hence be comprised of the following two questions:

  1. If so, and I'm sorry I think you I need to go and learn 6 months of cryptography --- How are these more secure? I am feeling there is another criterion for their alleged superiority here, and it's not just the amount ob bytes. It's something with formatting.

  2. If it's is only formatting, couldn't we implement this formatting to ssh-rsa 4096 keys? I mean if ed25519 keys contain about 90% less bytes, and we implement their special formatting to ssh-rsa 4096 keys, couldn't we create the most powerful ssh public key ever until now?


Right, welcome to a crypto-nerd battle. Let's try and break this down.

Key length: ed25519 is from a branch of cryptography called "elliptic curve cryptography (ECC)". RSA is based on fairly simple mathematics (multiplication of integers), while ECC is from a much more complicated branch of maths called "group theory". In short: ECC keys can be much shorter and give you the same security level because the mathematical problem they are based on is much more complex. This is far deeper than formatting differences. That's a bit like saying that index cards at the library vs google is a formatting difference.

Security: people tend to like ECC over RSA because the keys are smaller and the computations are faster for the same security level. Below is a table showing the security level comparison of RSA (labeled as Integer Factorization, or IF) vs ECC [source]. You can see that ECC keys really do get the same job done with a smaller key.

enter image description here

So you want to compare RSA-4096 (not in the above table) against ed25519 which has ~ 140 bits of security and is comparable to ~ 3000 bit RSA according to its inventor. Remember that bits is a log scale: 129 bits is twice as secure as 128 bits; 140 bits is 212 = ~4000x as secure as 128, so RSA-4096 might win, but really, anything above 128 bits of security is overkill unless you happen to be a military organisation or a bank.

For putting thumbtacks into your wall, should you use a sledgehammer or a wrecking ball? The correct answer is: whatever.

| improve this answer | |
  • Note the actual attack cost (and thus strength) for RSA=IF (and DSA/DH=FF) depends on the attack (factoring) algorithm(s) which have somewhat variable tradeoffs, so the single number used in comparison tables like that is only a rounded-off estimate. But as you say anything over about 128 makes no difference unless quantum which is now perceived as a great but unquantifiable risk. – dave_thompson_085 Nov 20 '16 at 10:39
  • Thanks Mike. Can you please elaborate more on "That's a bit like saying that index cards at the library vs google is a formatting difference." ? – user123574 Nov 20 '16 at 12:49
  • @dave_thompson_085 I actually know quite a bit about quantum crypto: once quantum computers become real, ECC reduces to like 2 bits of security, and RSA reduces to like 5 bits of security, almost regardless of key size. The bigger question is "When"? – Mike Ounsworth Nov 20 '16 at 15:37
  • @Benia That comment was a bit of a tongue-in-cheek way of saying that "formatting difference" is an understatement when you have two things that do the same job, but one is a newer, more advanced technology. – Mike Ounsworth Nov 20 '16 at 15:40
  • 1
    @MikeOunsworth I don't believe that's true wrt quantum computers. Both ECC and RSA can be factored in polynomial time if the quantum computer has enough (logical) qubits. If it has 6p qubits (for ECC) or 2p+3 qubits (for RSA), where p is the bit size of the algorithm, it can break it quickly. So 4096-bit RSA requires at least 8195 qubits, whereas 256-bit ECC requires 1536 qubits. – forest Sep 16 '18 at 0:51

You can't directly compare key sizes for RSA and ECC. A 2048 bit RSA key does not give the same security as a 2048 bit ECC key. Here is a table that gives an indication of the security:


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy