
When configuring passwordless SSH authentication for GitHub, GitLab, AWS, or Linux production servers, engineers consistently ask: Should I generate an Ed25519 key (ssh-keygen -t ed25519), an RSA-4096 key, or an ECDSA key? Building on our foundational What Is Secure Shell (SSH)? Architecture Guide, this hands-on reference compares the cryptographic math, wire performance, and side-channel resistance of Ed25519 (IETF RFC 8709) against RSA (RFC 8332) and ECDSA (RFC 5656)—and provides an interactive multi-OS command generator for Windows PowerShell, macOS, and Linux.
Interactive Multi-OS SSH Keygen (`Ed25519` / `FIDO2-SK`) & Config Builder
Select your operating system, key algorithm, and target host to generate the exact key-generation, SSH-agent registration, and ~/.ssh/config commands.
Ed25519 vs. RSA-4096 vs. ECDSA: Cryptographic & Performance Comparison
| Property | Ed25519 (Edwards-curve DSA) | RSA-4096 (SHA-256 / SHA-512) | ECDSA (nistp256 / secp256r1) |
|---|---|---|---|
| IETF Specification | RFC 8709 / RFC 8032 | RFC 8332 (Note: legacy ssh-rsa SHA-1 is deprecated) | RFC 5656 / FIPS 186-5 |
| Public Key Wire Size | 32 bytes (256 bits) — 68-char Base64 string | 512 bytes (4,096 bits) — 720+ char Base64 string | 64 bytes (uncompressed point) |
| Deterministic Nonce Safety | Yes (Deterministic SHA-512 hash) — immune to weak RNG | Yes (Deterministic PKCS#1 v1.5 padding) | No (Unless RFC 6979 is enforced; a single reused k nonce leaks the private key) |
| Side-Channel Timing Immunity | Complete constant-time ladder (no secret branch conditions) | Requires blinding to prevent timing leaks | Implementation-dependent |
Why the -a 100 Flag Matters: Hardening Your Private Key with 100 bcrypt-pbkdf Rounds
When you generate an Ed25519 key with a passphrase, OpenSSH stores the private key in the OPENSSH PRIVATE KEY container format encrypted with bcrypt-pbkdf. Passing -a 100 increases the key-derivation iteration count to 100 rounds, adding roughly 0.4 seconds to interactive key unlocking while making offline GPU dictionary attacks against a stolen laptop’s ~/.ssh/id_ed25519 file orders of magnitude more expensive. For hardware-bound zero-trust authentication, see our Passkeys vs. Password Managers & Hardware FIDO2 Guide.
Written and prepared by Kshitij Gupta.



