RSA Key Generator
The RSA Key Generator makes RSA, ECDSA and Ed25519 key pairs in your browser with Web Crypto — PEM, JWK and OpenSSH export, a SHA-256 fingerprint in ssh-keygen format, and a private key that never leaves the tab.
How to Use
- 1
Pick a key type: RSA (2048, 3072 or 4096-bit), ECDSA (P-256, P-384 or P-521), or Ed25519. For new projects, Ed25519 is the modern default; for maximum compatibility, RSA 2048.
- 2
For RSA, choose the use: RSASSA-PKCS1-v1_5 or RSA-PSS for signing (for example JWT RS256), RSA-OAEP for encryption. 1024-bit is deliberately not offered — it is below the safe minimum.
- 3
Click Generate key pair. The key is made in this tab with crypto.subtle.generateKey() from the operating system's random number generator — the page shows how many milliseconds it took, and the Network tab shows zero requests.
- 4
Copy the SSH public-key line into ~/.ssh/authorized_keys on the server, or copy the PEM public key for OpenSSL and JWT work. The public key is safe to share.
- 5
Click Show on the private key only when you are ready to save it, then download the PEM file and the OpenSSH private file (id_generated). Store the private key like a password — never paste it into chat, a ticket, a repo, or an AI tool.
- 6
Verify the key out of band: the SHA-256 fingerprint shown here is in ssh-keygen -l format — compare it with the fingerprint ssh-keygen -l shows for the downloaded key. They must match.
Frequently Asked Questions
What is an RSA key pair?
What key size should I choose — 2048, 3072 or 4096?
RSA vs ECDSA vs Ed25519 — when to use each?
What is PEM / JWK / OpenSSH format?
Is it safe to generate keys in a browser?
Is my private key uploaded?
How do I use the key for SSH?
What is the SHA-256 fingerprint for?
What do I do if my private key was exposed?
Why is there no 1024-bit option?
Generative Answer & AI Documentation
What is the RSA Key Generator?
The RSA Key Generator creates a public/private key pair entirely in your browser using crypto.subtle.generateKey(), which draws from the operating system's cryptographically secure random number generator. Three key types are offered: RSA at 2048, 3072 or 4096 bits (RSASSA-PKCS1-v1_5, RSA-PSS, or RSA-OAEP), ECDSA on the P-256, P-384 or P-521 curves, and Ed25519 where the browser supports it — support is detected on page load and the option is disabled with an explanation where it is not. The public key exports as PEM (SPKI), JWK, and an OpenSSH one-line public key for ~/.ssh/authorized_keys; the private key exports as PEM (PKCS#8) and as an OpenSSH private-key file (openssh-key-v1, unencrypted), and is hidden behind a Show button until you ask for it. Every key shows its SHA-256 fingerprint in ssh-keygen -l format and the milliseconds generation took — proof it ran locally, and a value you can verify out of band. There is no 1024-bit option: it is below the safe minimum. There is no passphrase-encrypted private-key export: if you need one, encrypt the downloaded PEM with openssl pkcs8 -topk8 on your own machine.
Why use RSA Key Generator offline?
Keys are the one thing you should never generate on a stranger's server. A key pair generated server-side is a key pair somebody else has seen — and a private key that has ever been seen by anyone else is not a private key. Browser generation with Web Crypto removes the server from the equation entirely: the key is created in the tab, exported in the tab, and nothing about it is ever transmitted, which you can confirm in the DevTools Network tab (zero requests). The second reason is verification: this page does not ask you to trust it. The fingerprint it shows is in ssh-keygen -l format, so you can run ssh-keygen -l on the downloaded public key and compare — if the fingerprints match, the key you hold is the key the page made. The exports are the third reason: a key that only exists as PEM is useless for SSH, and a key that only exists as an OpenSSH file is useless for a JWT library, so the page exports PEM, JWK, and both OpenSSH forms, all built from the same generated key.
When should you use this tool?
Use it to make an SSH key pair for a server (copy the public line into ~/.ssh/authorized_keys, keep the OpenSSH private file with chmod 600); to make a signing key for JWT RS256 work (link to the JWT Decoder on this site to inspect tokens signed with it); to make a key for TLS or OpenSSL testing; or to replace a key that was exposed. Use Ed25519 for new projects and SSH where the system supports it, ECDSA P-256 for TLS, and RSA when you need maximum compatibility. Do not use it as a substitute for enterprise PKI: HSM or CSR workflows and audited procedures exist for a reason, and this page does not replace them. And do not generate a key here and then paste the private key into a ticket, a chat, or an AI tool — the moment it leaves the tab through you, it is compromised.
Key Benefits
- Three key types in one place: RSA 2048/3072/4096, ECDSA P-256/P-384/P-521, and Ed25519 — most key pages offer RSA only.
- Every export you need: PEM public (SPKI) and private (PKCS#8), JWK, OpenSSH public-key line, and an OpenSSH private-key file.
- SHA-256 fingerprint in ssh-keygen -l format — verify the key out of band instead of trusting the page.
- Generation time shown in milliseconds — proof the key was made locally, in this tab.
- 2048-bit minimum: 1024-bit is deliberately not offered, because it is below the safe minimum.
- Private key hidden behind a Show button, with the compromised-key warning in plain language.
- Ed25519 support is detected honestly per browser, not silently omitted or faked.
- 100% private: Web Crypto with the OS random number generator — no Math.random(), nothing uploaded, stored, or logged.
Common Use Cases
- Making an SSH key: generate Ed25519 (or RSA 3072 if the server is old), append the public line to ~/.ssh/authorized_keys, save the OpenSSH private file as ~/.ssh/id_generated, chmod 600 it, and connect with ssh -i ~/.ssh/id_generated user@server — then confirm the fingerprint with ssh-keygen -l.
- Signing JWTs: generate an RSA key with RSASSA-PKCS1-v1_5, use the PEM private key to sign RS256 tokens, and hand the PEM public key (or the public JWK) to the verifier — inspect the resulting tokens in the JWT Decoder on this site.
- Replacing an exposed key: if a private key was ever pasted into chat, a ticket, a repo, or an AI tool, generate a fresh pair here, install the new public key everywhere the old one was, and delete the old private key.
- Testing TLS locally: generate an RSA 2048 pair, use the PEM files with openssl to build a test certificate, and throw the key away when the test is done — a throwaway key costs nothing here.
- Checking a new project default: generate Ed25519 and RSA 3072 side by side and compare — the Ed25519 public key is one short line and the fingerprint is the same format, which is why it is the modern default.
Developer Notes & Best Practices
Generation is crypto.subtle.generateKey() with extractable keys: RSA uses publicExponent [1, 0, 1] and SHA-256 (SHA-512 for 4096-bit), ECDSA uses the named curve, Ed25519 uses the Ed25519 name. Exports are crypto.subtle.exportKey(): 'spki' for the public PEM, 'pkcs8' for the private PEM, 'jwk' for the SSH encoding. PEM wrapping is Base64 at 64 characters per line with BEGIN/END markers — and with a trailing newline, which is required: ssh-keygen's own PEM reader rejects an OPENSSH PRIVATE KEY file whose final line has no newline, a bug found while building this page (the file was byte-identical to ssh-keygen's own output except for the missing newline). The SSH public-key blob is the standard wire encoding: a length-prefixed string for the key type, then mpints (RSA: exponent, modulus) or length-prefixed strings (ECDSA: curve name, uncompressed point 04||X||Y; Ed25519: the 32-byte public key). The fingerprint is SHA-256 over that blob, Base64 without padding, prefixed SHA256:. The OpenSSH private file is the openssh-key-v1 format with cipher 'none': magic 'openssh-key-v1' plus NUL, the cipher/kdf/kdfoptions strings, one public-key blob, then a private section of two equal checkints, the key fields (RSA: n, e, d, iqmp, p, q; ECDSA: curve, point, d; Ed25519: public key, 64-byte seed||public private key), a comment, and 1..n padding to a multiple of 8 bytes. All of this was verified against real ssh-keygen in Node 24 (which has Web Crypto): the generated SSH public lines match ssh-keygen -y output for the same key, the fingerprints match ssh-keygen -l, and the OpenSSH private files load in ssh-keygen — for RSA 2048 and 3072, ECDSA P-256 and P-384, and Ed25519. Two real-world quirks were found and are stated on the page: ssh-keygen cannot read a PKCS#8 Ed25519 private key ('invalid format'), so for Ed25519 the OpenSSH file is the portable form; and RSA-2048 generated in 68 ms in the Node test run while RSA-4096 took 410 ms in one run and 1,335 ms in another on the same machine, so the page shows its own live time instead of quoting a fixed number.
Key size and security strength (NIST SP 800-57)
| Key | Security strength | Use |
|---|---|---|
| RSA 2048 | About 112-bit | Minimum — fine for most use |
| RSA 3072 | About 128-bit | Recommended for long-term keys |
| RSA 4096 | Above 128-bit (estimate) | Marginal gain over 3072, slower |
| ECDSA P-256 | About 128-bit | TLS default |
| ECDSA P-384 | About 192-bit | Long-term ECDSA |
| ECDSA P-521 | About 256-bit | Highest-strength ECDSA |
| Ed25519 | About 128-bit | Modern default for SSH and new projects |
Export formats — which file for which job
| Format | Contents | Use it for |
|---|---|---|
| PEM public (SPKI) | Public key | OpenSSL, TLS, JWT verification |
| PEM private (PKCS#8) | Private key | OpenSSL, JWT signing, test certificates |
| JWK public | Public key as JSON | JWKS endpoints, JWT libraries |
| OpenSSH public line | Public key, one line | Appending to ~/.ssh/authorized_keys |
| OpenSSH private file | Private key (openssh-key-v1) | ssh -i — the file ssh reads directly |
RSA vs ECDSA vs Ed25519
| RSA | ECDSA | Ed25519 | |
|---|---|---|---|
| Best for | Maximum compatibility | TLS, small keys | SSH, new projects |
| Key size (128-bit strength) | 3072-bit | 256-bit (P-256) | 256-bit (32-byte key) |
| Speed | Slowest to generate | Fast | Fastest |
| Weakness | Large keys, slow | Needs a good curve choice | Not supported by very old systems |
- Use 3072-bit RSA for keys that must last years, and Ed25519 for new SSH keys — 2048-bit RSA is the minimum, not the aspiration.
- Verify the fingerprint out of band: run ssh-keygen -l on the downloaded public key and compare it with the fingerprint shown here before installing the key anywhere.
- Save the private key with chmod 600 and never let it leave your machine except through the channel the key is for — never email it, never paste it into chat, a ticket, or an AI tool.
- Keep the private key hidden until you need it: this page hides it behind a Show button for a reason — a key on screen is a key anyone looking at the screen can copy.
- If a private key was ever pasted anywhere, replace it: generate a new pair, install the new public key everywhere, delete the old private key. Exposure cannot be undone.
- For Ed25519, use the OpenSSH private file, not the PEM: ssh-keygen cannot read a PKCS#8 Ed25519 private key, and the OpenSSH file is the form ssh reads directly.
Common Mistakes
- Generating a key on a server-side tool: a key generated on someone else's server is a key someone else has seen. Generate in the browser, where the key never leaves the tab.
- Choosing 1024-bit RSA because it is faster: 1024-bit offers about 80-bit security strength and has been deprecated since 2013 — this page does not offer it at all.
- Pasting the private key into a support ticket or an AI tool to 'get help with it': the key is compromised the moment it leaves your control — generate a new pair instead.
- Installing the private key on the server: the server gets the public line in authorized_keys, never the private key. The private key stays on your machine.
- Using the PEM private key with ssh for Ed25519: ssh-keygen cannot read a PKCS#8 Ed25519 key — use the OpenSSH private file download for Ed25519.
- Forgetting to verify the fingerprint: the fingerprint is the check that the key you installed is the key you generated — run ssh-keygen -l and compare before trusting the key.
Limitations
Browser-generated keys are fine for development, testing, and many application keys, but enterprise PKI often requires HSM or CSR workflows and audited procedures — this page does not replace proper key management, and it makes no absolute security claim: key security depends on the browser's CSPRNG implementation. This page does not offer passphrase-encrypted private keys; if you need one, encrypt the downloaded PEM with openssl pkcs8 -topk8 on your own machine. Ed25519 availability varies by browser: the page detects support on load and disables the option with an explanation where it is missing, rather than silently omitting it. One verified quirk: ssh-keygen cannot read a PKCS#8 Ed25519 private key ('invalid format') — for Ed25519, use the OpenSSH private file download. The private JWK is intentionally not shown on the page; the PEM and OpenSSH downloads are the portable private-key forms. Generation time varies by machine and key size — RSA-4096 took 410 ms in one test run and 1,335 ms in another on the same machine — so the page shows the live time for your key instead of quoting a fixed number.
Structured Input/Output Example
Key type: RSA, 2048-bit, RSASSA-PKCS1-v1_5 (signing)
Generated in 68 ms (Node test run — your browser shows its own time) Fingerprint: SHA256:43 Base64 characters, ssh-keygen -l format Public key (OpenSSH): ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ... generated@trytoolsnow Public key (PEM): -----BEGIN PUBLIC KEY----- (SPKI, 64-char lines) Private key (PEM): -----BEGIN PRIVATE KEY----- (PKCS#8, hidden until shown) Private key (OpenSSH): -----BEGIN OPENSSH PRIVATE KEY----- (openssh-key-v1)
Related Tools
JWT Decoder Offline
JWT decoder offline: inspect a token’s header, payload claims, and expiry as readable JSON. 100% client-side — production tokens never leave your browser.
Password Generator
Password generator: create strong, unpredictable passwords with real cryptographic randomness — not Math.random(). Pick length and character sets.
Hash Generator
Hash generator: type any text and get its MD5, SHA-1, and SHA-256 digests side by side in real time. Compare algorithms at a glance. Free, offline.
Base64 Encoder
Base64 encoder: encode text into Base64 for data URIs, HTTP auth headers, and binary-safe transport. Free, fully offline — tokens never touch a server.
Subnet Calculator
Subnet calculator: IPv4 and IPv6 CIDR math — network, broadcast, first/last host, usable hosts, split into subnets, VLSM, and an AI-answer check.