RSA Key Pair Generator
Generate 2048/3072/4096-bit RSA keypairs in PEM and JWK formats — entirely in your browser via SubtleCrypto.
RSA Key Pair Generator
ssh-keygen, openssl, or a hardware security module.
How to use the RSA key pair generator
Pick a key size
2048 bits is the minimum we'd recommend in 2026 (still acceptable, fast to generate). 3072 bits is the modern default — equivalent to AES-128 security strength. 4096 bits is overkill for most cases but used in long-lived signing keys.
Click Generate
For 2048 bits the operation takes about a second. 3072 bits takes roughly 3 seconds. 4096 bits in browser can take 15-30 seconds — your tab will be unresponsive for that period. The browser's SubtleCrypto runs this in optimised native code, not JavaScript.
Copy or download the keys
Four output formats: PEM (the standard openssl/ssh format), JWK (for JWT, JOSE, web apps). PEMs are ready to paste into config files or save as .pem files. Always store the private key with restricted file permissions (chmod 600).
Use, then rotate
Use the keypair for testing, learning, or non-critical applications. For production use, generate keys with ssh-keygen or openssl on a secure machine — and rotate them on a schedule (yearly for SSH, sooner for high-value signing keys).
RSA — the algorithm behind half the world's TLS
RSA, named after Rivest, Shamir, and Adleman who published it in 1977, is one of the most-deployed asymmetric cryptographic algorithms in history. Almost every TLS handshake from 1995 to 2018 used RSA for key exchange; even today, with elliptic-curve alternatives like ECDSA and Ed25519 ascendant, RSA still backs a huge share of CA certificates, code-signing keys, SSH host keys, JWT signatures, and S/MIME email. Its security rests on the difficulty of factoring the product of two large primes — a problem that has stayed hard despite four decades of research, even with advances in number-field-sieve algorithms.
Key sizes — what's safe today, what's safe in 2030
The minimum RSA key size considered cryptographically sound in 2026 is 2048 bits. Below that (1024 and lower) the work factor for an academic factoring attack has dropped to the point where well-funded adversaries can reasonably attempt it. 2048-bit keys remain safe against any publicly-known attack and will likely stay so through the late 2020s; 3072-bit keys are equivalent to 128-bit symmetric security strength per NIST guidance and are the recommended default for new deployments today. 4096-bit keys offer a comfortable margin for long-lived signing keys (CA roots, S/MIME identities held for years) but are overkill for ephemeral TLS keys rotated every 90 days via Let's Encrypt.
PEM, DER, OpenSSH, and JWK — same key, different wrappers
An RSA keypair is mathematically just a pair of large integers (modulus and private exponent). The format wrappers serve different ecosystems. DER is the canonical binary encoding (ASN.1 SEQUENCE of integers). PEM is DER base64-encoded with -----BEGIN/END labels — the format you'll see in /etc/ssl/private/ on every Linux server. OpenSSH format is a different wire format used in ~/.ssh/id_rsa with its own header structure. JWK (JSON Web Key, RFC 7517) is a JSON object with the key components as base64url-encoded fields — used by every JWT library, the JOSE spec family, and OAuth/OIDC /jwks.json endpoints. All four contain the same mathematical material; conversion between them is mechanical.
Why ECDSA and Ed25519 are taking over
RSA's main weakness is verbosity. A 256-bit Ed25519 key has the same security level as a 3072-bit RSA key — twelve times shorter to transmit and several times faster to sign with. TLS 1.3 explicitly prefers elliptic-curve cipher suites; modern SSH installs default to Ed25519 when you run ssh-keygen without arguments; the JOSE spec includes EdDSA alongside RS256. RSA persists because it's universally supported (every embedded device, every legacy system, every CA), well-understood, and "good enough" — but for new keys with no legacy constraints, Ed25519 or ECDSA-P-256 are the better default. We will ship an Ed25519 generator as a separate tool in a future update.
Don't paste production private keys into web tools
A consistent piece of advice from every security review: do not paste production private keys into any browser-based tool, including this one. The reasoning is identical to the TOTP-secret warning — once a private key sits in your tab's JavaScript heap, it is accessible to any malicious browser extension, any XSS bug, and any data-stealing malware on your machine. For test keys, learning, integration verification, or developer experimentation: this tool is fine. For real keys protecting real assets, use a workstation-local tool (ssh-keygen, openssl genrsa), a password manager with key-storage features (1Password, Bitwarden), or a hardware security module (YubiKey, AWS CloudHSM, GCP Cloud HSM, AlibabaCloud KMS).
10 RSA and asymmetric crypto facts
RSA was published in 1977 by Rivest, Shamir, and Adleman at MIT. The algorithm had actually been discovered earlier (1973) by Clifford Cocks at GCHQ but was classified British government secret until 1997.
The public exponent 65537 (also written F4 or 0x10001) is the de-facto standard. It's a Fermat prime giving fast modular exponentiation while being large enough to defeat low-exponent attacks.
The largest RSA modulus ever publicly factored is RSA-260 (829 bits / 250 decimal digits), factored in 2020 over 2,700 core-years on Intel Xeon Gold CPUs. RSA-2048 remains comfortably beyond reach.
NIST SP 800-57 maps 2048-bit RSA to 112-bit symmetric security strength, 3072-bit to 128-bit, and 4096-bit to roughly 152-bit. For 256-bit symmetric strength you\'d need RSA-15360 — impractical.
RSA private keys contain a lot more than just the modulus and private exponent — the PKCS#1 format also stores p, q, d mod (p-1), d mod (q-1), and q^(-1) mod p for Chinese-remainder-theorem speedup.
RSA signing is slower than RSA verification by a factor of around 100 (typical 3072-bit). This asymmetry is why CAs sign certificates once but clients verify millions of times daily.
The W3C SubtleCrypto API was finalised in 2017 and now ships in every major browser. Before then, browser-based RSA generation required JavaScript implementations like Forge or JSEncrypt.
SSH was originally designed for RSA-1024 keys in 1995. Modern OpenSSH defaults to Ed25519 since 2014 — 32-byte keys with the security of RSA-3072 and faster everything.
The quantum-computing threat: Shor\'s algorithm can theoretically factor RSA in polynomial time on a sufficiently large quantum computer. Estimates suggest practical danger no earlier than 2035-2040.
Apple iCloud Keychain, 1Password, and Bitwarden all support RSA private-key storage with PIN-protected access — making them practical alternatives to local .pem files on Mac/iOS.
Frequently asked questions
openssl genrsa or ssh-keygen on a hardened workstation, or a hardware security module.~/.ssh/id_rsa. The same RSA key can be converted between them with ssh-keygen -p or openssl. This tool outputs PEM only — for OpenSSH, run ssh-keygen -m RFC4716./.well-known/jwks.json endpoint. The format is exactly the same RSA key material as PEM, but encoded as a JSON object with named base64url fields.openssl genrsa -aes256 prompts for one. SSH keys are best protected by your password manager rather than a passphrase typed each connection. This tool generates passphrase-less keys; if you need a passphrase, run openssl rsa -aes256 -in private.pem -out encrypted.pem after download.Related News
You may be interested in these recent stories from our newsroom.
-
Snowflake jumps 36 per cent in a day on an earnings beat and a US$6 billion AWS chip deal
Snowflake had its best day as a public company on 28 May, closing up 36 per cent after a clean first-quarter beat and a five-year, US$6 bill...
-
MAS Scraps Mandatory Financial Advice for Most Complex Product Buyers in Retail Shake-Up
Singapore retail investors buying structured notes, derivatives and investment-linked policies will no longer need mandatory financial advic...
-
SEC Rewrites Float Rules, PSE Moves to Implement Them — Clearing the Path for GCash's USD 1B Philippine IPO
The SEC lowered the public float floor for large Philippine issuers in February 2026. The PSE followed with a consultation paper in April. T...
75 more free tools
Calculators, converters, security tools — no signup.