Introduction
Every SSH connection starts with a key pair. Whether you are pushing code to GitHub, logging into a production server, or configuring CI/CD pipelines, you need a private key and a public key. Running ssh keygen online saves you from opening a terminal, remembering the right flags, and hoping you picked secure parameters. This tool generates Ed25519 and RSA key pairs directly in your browser using the Web Crypto API and node-forge. No key material ever leaves your device. Pick an algorithm, add a comment, optionally set a passphrase, and click generate. You get a public key for your authorized_keys file, a private key for your .ssh directory, and a SHA256 fingerprint for verification. Ed25519 is the modern default because it produces smaller keys and signs faster. RSA remains the fallback for older servers that lack Ed25519 support.
What this tool does
- Generates Ed25519 key pairs using the browser Web Crypto API (crypto.subtle.generateKey).
- Generates RSA key pairs at 2048, 3072, or 4096 bits using node-forge.
- Outputs public keys in OpenSSH format (ssh-ed25519 or ssh-rsa prefix with base64-encoded key blob).
- Outputs Ed25519 private keys in PKCS8 PEM format and RSA private keys in OpenSSH PEM format.
- Computes SHA256 fingerprints for quick key verification on remote servers.
- Supports optional comments (default: user@host) that appear at the end of the public key line.
- Optionally encrypts RSA private keys with a passphrase using OpenSSH-compatible AES-128 encryption.
How this tool works
This tool runs entirely in your browser. For Ed25519 keys, it calls the Web Crypto API's subtle.generateKey method with the Ed25519 algorithm name, requesting extractable keys for signing and verification. The raw 32-byte public key is then packed into the SSH wire format (a length-prefixed string containing the algorithm name followed by the key bytes) and base64-encoded to produce the standard ssh-ed25519 public key line. The private key is exported in PKCS8 format and wrapped in PEM headers.
For RSA keys, the tool uses node-forge's rsa.generateKeyPair function with the selected bit size, then converts the result to OpenSSH format using forge.ssh.publicKeyToOpenSSH and forge.ssh.privateKeyToOpenSSH. The SHA256 fingerprint is computed by hashing the public key blob (the same wire-format bytes that get base64-encoded) with SHA-256 and base64-encoding the digest. RSA 4096-bit generation can take several seconds because it requires finding two large primes. All computation happens client-side. Your private key, passphrase, and key material never touch a server.
How SSH key authentication works
SSH uses public-key cryptography for authentication. The protocol is defined in RFC 4251, with the authentication mechanism specified in RFC 4252. When you connect to a server, the client proves identity by signing a challenge with your private key. The server verifies the signature using your public key stored in ~/.ssh/authorized_keys.
Ed25519 keys are based on the EdDSA signature scheme using Curve25519. OpenSSH added Ed25519 support in version 6.5 (2014), and RFC 8709 standardizes the use of Ed25519 keys in SSH. Ed25519 public keys are only 32 bytes (68 characters in base64), and signatures are 64 bytes. The algorithm is deterministic, meaning the same message always produces the same signature. This avoids the side-channel vulnerabilities that affected earlier ECDSA implementations where poor random number generation could leak the private key.
RSA keys rely on the difficulty of factoring the product of two large primes. The minimum recommended size is 2048 bits. RSA 3072 provides a 128-bit security level, matching AES-128. RSA 4096 offers a 150-bit security level but produces larger keys and slower signatures. The SSH public key format for RSA encodes the modulus and public exponent in a length-prefixed binary structure, base64-encoded with the ssh-rsa prefix.
The SHA256 fingerprint is derived by hashing the raw public key blob with SHA-256 and encoding the result in base64 without padding. OpenSSH displays this fingerprint when you first connect to a new host, letting you verify the server identity before trusting the connection.
How to use this tool
- Select an algorithm: Ed25519 (recommended for new keys) or RSA with 2048, 3072, or 4096 bits.
- Enter a comment such as your email or username@hostname. This helps you identify the key later.
- Optionally enter a passphrase to encrypt the private key. For RSA keys, this uses OpenSSH-compatible AES-128 encryption.
- Click Generate Key Pair. RSA 4096 may take a few seconds due to prime number generation.
- Copy the public key and add it to your server's ~/.ssh/authorized_keys file or to GitHub/GitLab SSH key settings.
- Save the private key to ~/.ssh/id_ed25519 or ~/.ssh/id_rsa on your local machine and set file permissions to 600.
Real-world examples
Setting up GitHub SSH access
A developer wants to push to GitHub without typing a password each time. She generates an Ed25519 key pair with the comment "jane@laptop", copies the public key (starting with ssh-ed25519 AAAA...), and pastes it into GitHub Settings > SSH and GPG keys. She saves the private key to ~/.ssh/id_ed25519, runs chmod 600, and tests with ssh -T git@github.com. GitHub responds with a successful authentication message. The SHA256 fingerprint shown by GitHub matches the one from this tool, confirming the key was added correctly.
Provisioning a production server
A DevOps engineer configures a new Ubuntu 22.04 server on AWS EC2. He generates an RSA 3072-bit key pair (the server runs an older OpenSSH version without Ed25519 support), copies the public key into ~/.ssh/authorized_keys on the server via the EC2 console, and saves the private key locally. He connects with ssh -i ~/.ssh/id_rsa ubuntu@10.0.0.5. The first connection shows the SHA256 fingerprint, which he verifies against the fingerprint from this tool before accepting the host key. This prevents man-in-the-middle attacks during initial server setup.
Migrating from RSA to Ed25519
A system administrator wants to replace aging RSA 2048-bit keys with Ed25519 keys across a fleet of 50 servers. He generates a new Ed25519 key pair, then uses ssh-copy-id with the new key to add it to each server's authorized_keys file alongside the old RSA key. After verifying that the new key works on all servers, he removes the old RSA public key entries. The Ed25519 private key is 412 bytes in PKCS8 PEM format, compared to 1766 bytes for the RSA 2048 key. He runs ssh-keygen -y -f ~/.ssh/id_ed25519 to confirm the PEM private key produces the correct OpenSSH public key.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Ed25519 | Low (32-byte key, deterministic signing) | New SSH keys for modern servers (OpenSSH 6.5+) |
| RSA 2048 | Medium (256-byte key, 112-bit security) | Compatibility with older SSH servers |
| RSA 4096 | High (512-byte key, 150-bit security, slow generation) | Maximum RSA security for legacy infrastructure |
Limitations or considerations
This tool generates keys in your browser and does not write them to disk. You must manually save the private key and set file permissions (chmod 600 on Linux and macOS). Ed25519 private keys are output in PKCS8 PEM format rather than the OpenSSH private key container format. OpenSSH 7.5 and later can read PKCS8 directly, but very old SSH clients may require conversion with ssh-keygen -p. RSA key generation blocks the browser thread, so the UI freezes briefly during generation. This tool does not support ECDSA keys (nistp256, nistp384, nistp521) or certificate-signed SSH keys.
Frequently asked questions
Is it safe to generate SSH keys in a browser?
Yes. This tool uses the Web Crypto API for Ed25519 and node-forge for RSA. Both run entirely in your browser's JavaScript runtime. Your private key and passphrase are never transmitted to a server. The randomness comes from your browser's cryptographically secure random number generator, which uses the operating system's entropy source.
Should I choose Ed25519 or RSA?
Ed25519 for new keys and modern servers. It produces smaller keys (68 characters vs 372 for RSA 2048), signs faster, and is deterministic. Use RSA only when connecting to servers running OpenSSH versions older than 6.5, which lack Ed25519 support. RSA 3072 is the minimum recommended size for new RSA keys.
What is the SHA256 fingerprint for?
It lets you verify a key's identity quickly. When you first connect to an SSH server, OpenSSH displays the server's fingerprint. Compare it against a known-good value to detect man-in-the-middle attacks. GitHub and GitLab also show key fingerprints in their settings pages.
Can I use the Ed25519 private key with ssh directly?
Yes, with OpenSSH 7.5 and later. Save the PEM output to ~/.ssh/id_ed25519, set permissions to 600, and it works. If you have an older OpenSSH version, convert it with ssh-keygen -p -m PEM -f ~/.ssh/id_ed25519 to rewrite it in the OpenSSH private key format.
What RSA key size should I pick?
RSA 3072 for new RSA keys (128-bit security level, matching AES-128). RSA 2048 is acceptable for short-term use but provides only 112-bit security. RSA 4096 offers a 150-bit security level at the cost of larger keys and slower operations. Generation of 4096-bit keys can take several seconds.
Conclusion
Use this ssh keygen online tool when you need a key pair quickly without opening a terminal. Ed25519 is the right choice for new keys and modern servers. RSA 4096 works when you need maximum compatibility with older infrastructure. Always store your private key in a secure location with restrictive file permissions, and never commit it to a repository. If you lose your private key, you will need to generate a new pair and update every server and service that had your old public key.