id ed25519
id_ed25519: The Complete Guide to Ed25519 SSH Keys
Key Takeaways
- Ed25519 uses the Curve25519 elliptic curve for digital signatures, producing compact 512-bit keys that are significantly faster and more secure than RSA.
- The
id_ed25519file is the default private key generated by modern OpenSSH clients; the corresponding public key is stored inid_ed25519.pub. - Compared to RSA-2048, Ed25519 delivers equivalent security with a fraction of key size, faster authentication, and immunity to certain timing-side-channel attacks.
- OpenSSH 6.5+ (released 2014) supports Ed25519 natively; virtually all current Linux, macOS, and Windows OpenSSH builds include it.
- To generate a key pair:
ssh-keygen -t ed25519 -C "your_email@example.com".
What Is id_ed25519?
The id_ed25519 private key is the flagship key type introduced by OpenSSH in 2014. It implements the Edwards-curve Digital Signature Algorithm (EdDSA) over the Curve25519 family, designed by professor Dan Bernstein. Unlike older RSA-based keys that rely on integer factorization, Ed25519 is built on elliptic-curve cryptography (ECC), offering stronger security per bit of key length.
When you run ssh-keygen without specifying a type on a modern system, the tool defaults to -t ed25519, reflecting its status as the recommended standard for SSH authentication.
How Ed25519 Works Under the Hood
Cryptographic Foundation
Ed25519 operates on a twisted Edwards curve defined over a prime field p = 2255 − 19. The private key is a 32-byte seed that is hashed using SHA-512; the lower bits are clamped to ensure a fixed scalar multiplication. The public key is derived by multiplying the base point of the curve by this scalar, yielding another 32-byte value.
Signing Process
Signing a message involves:
- Hashing the private seed together with the message via SHA-512.
- Deriving a scalar r and computing the curve point R = r·B.
- Computing e = H(R ‖ A ‖ M), where A is the public key and M is the message.
- Producing the signature pair (R, s), where s = r + e·a.
The complete signature is 64 bytes, making it one of the most compact signatures in practical use.
Ed25519 vs. RSA vs. ECDSA: Head-to-Head Comparison
Understanding why Ed25519 has become the default requires a side-by-side look at the three major SSH key types currently in use.
| Property | Ed25519 | RSA-2048 | ECDSA-256 |
|---|---|---|---|
| Key Size (bytes) | 32 private / 32 public | 1024 private / 256 public | 32 private / 64 public |
| Signature Size | 64 bytes | 256–512 bytes | 70–72 bytes |
| Key Generation | Fast (~ms) | Slow (seconds) | Fast (~ms) |
| Authentication Speed | Fastest | Slowest | Fast |
| Security Level | 128-bit equivalent | ~112-bit equivalent | 128-bit equivalent |
| Deterministic Signing | Yes (no nonce needed) | N/A | No (requires random nonce) |
| Side-Channel Resistance | High (constant-time impl.) | Low to moderate | Moderate |
| Patent Concerns | None | None | Historical concerns (resolved) |
| OpenSSH Support | 6.5+ (2014) | All versions | 5.7+ (2011) |
| Recommended For | Default choice |
Why the Table Matters in Practice
The data clearly shows Ed25519's dominance: it combines the fastest performance with the smallest footprint and the strongest guarantees against implementation bugs. The deterministic nature of EdDSA signing is particularly critical—unlike ECDSA, a poor random number generator cannot leak a private key through signature reuse, a vulnerability that has plagued production ECDSA deployments.
How to Generate an id_ed25519 Key Pair
Step 1: Check Your OpenSSH Version
ssh -V
Ensure your OpenSSH version is 6.5 or later. Modern distributions ship with OpenSSH 8.x or 9.x, which fully support Ed25519.
Step 2: Generate the Key Pair
ssh-keygen -t ed25519 -C "your_email@example.com"
The -C flag adds a human-readable comment (typically your email) to the public key file for easy identification.
Step 3: Set a Strong Passphrase
Always set a passphrase when prompted. This encrypts the private key at rest, adding a critical layer of protection if the key file is ever compromised.
Step 4: Copy the Public Key to the Server
ssh-copy-id user@remote-host
This appends your public key to the remote server's ~/.ssh/authorized_keys file.
Step 5: Verify Authentication
ssh user@remote-host
A successful login without a password prompt confirms the key is correctly configured.