Back to Journal

RSA vs Ed25519: Which SSH Key Should You Use in 2026?

Ayan Hussain
Jul 26, 2026 · 4 min read

If you search for how to generate an SSH key, a lot of old tutorials will tell you to run ssh-keygen -t rsa. You should ignore them.

The industry has moved on. If you are setting up a new server today, you should use Ed25519 keys. Here is why.

The problem with RSA

RSA is an old cryptographic algorithm. It still works, but it relies on factoring massive prime numbers. As computers have gotten faster, the size of those prime numbers has had to increase to keep the encryption secure.

Ten years ago, a 2048-bit RSA key was considered safe. Today, 4096-bit keys are the minimum standard. These keys are huge, slow to generate, and slow to verify.

Worse, older versions of the SSH protocol relied on SHA-1 hashing for RSA keys. SHA-1 is completely broken. Modern SSH servers (OpenSSH 8.8 and newer) disable old RSA signatures by default. If you try to connect to a new Ubuntu server with an old RSA key, the connection will just drop.

Enter Ed25519

Ed25519 uses elliptic curve cryptography. Instead of relying on prime factorization, it relies on the mathematical properties of algebraic curves.

What this means in practice:

  1. The keys are tiny. An Ed25519 public key is 68 characters long. A 4096-bit RSA public key is over 700 characters long.
  2. They are faster. The math behind elliptic curves is incredibly fast for computers to process, meaning your SSH connections establish quicker.
  3. They are more secure. Despite being a fraction of the size, a standard Ed25519 key provides roughly the same security as a massive 3000-bit RSA key.

How to generate an Ed25519 key

Generating a new key takes one line in your terminal:

ssh-keygen -t ed25519 -C "your_email@example.com"

When prompted, save the key in the default location (~/.ssh/id_ed25519) and set a strong passphrase.

To use this key, copy the public half (id_ed25519.pub) to your server's authorized_keys file.

What if a system doesn't support Ed25519?

OpenSSH has supported Ed25519 since 2014. Unless you are forced to work on a legacy system running an ancient version of CentOS, your server supports it.

If you use SSHDock to manage your infrastructure from a browser, both Ed25519 and modern RSA keys are fully supported natively. Just paste your private PEM key into the connection UI, and it handles the math automatically.

Keep Reading

How to SSH into servers from an iPad or Chromebook

July 26, 2026

5 ways to lock down your SSH server

July 26, 2026

What is a Bastion Host and why do you need one?

July 26, 2026