RSA Key Pair Generator
Generate a fresh RSA public + private key pair (PEM).
Overview
The RSA key pair generator produces a fresh public and private key in PEM format. Pick a key size — 2048, 3072, or 4096 bits — and the tool returns both halves of the pair, ready to drop into an SSH config, an OpenSSL command, a JWT signer, or a TLS test environment.
It is built for developers needing a throwaway RSA key for local development, integration testing, or scratch CI environments. Production keys deserve more care — hardware security modules, smart cards, careful storage — but for a sandbox where the key will live an hour, a quick RSA key pair generator is the path of least resistance.
How it works
RSA, published by Rivest, Shamir, and Adleman in 1977, is the most widely deployed public-key algorithm. Key generation picks two distinct large random primes p and q, sets n = p * q (the modulus, whose bit length is the key size), computes Euler's totient φ(n) = (p-1)(q-1), and chooses a public exponent e (typically 65537 — Fermat prime F4) coprime to φ(n). The private exponent is d = e^-1 mod φ(n). The public key is (n, e); the private key carries n, e, d, p, q, and the CRT coefficients used to speed up private-key operations.
The tool serialises both keys as PEM-wrapped DER: PKCS#1 (-----BEGIN RSA PRIVATE KEY-----) or PKCS#8 (-----BEGIN PRIVATE KEY-----) for private; SubjectPublicKeyInfo for public.
Examples
Key size: 2048
Public: -----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
-----END PUBLIC KEY-----
Private: -----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEA...
-----END PRIVATE KEY-----
Key size: 4096
Public + private PEM, same format as above, ~2x the length
Key size: 1024 (allowed but flagged)
Output: keys generated + warning that 1024-bit RSA is below modern recommendations
FAQ
What key size should I pick?
2048 bits is the modern minimum, expected to remain safe through ~2030. 3072 matches the security level of AES-128. 4096 is comfortable for long-lived keys but is meaningfully slower for signing operations. NIST and BSI both recommend 3072 or 4096 for new long-term keys.
Should I use RSA or ECDSA / Ed25519?
For new designs, elliptic-curve algorithms (Ed25519 for signing, ECDH for key agreement) are smaller, faster, and equally secure. RSA remains dominant for compatibility — TLS certificates, JWT signing, and many legacy systems still expect it.
Is the private key encrypted?
By default, no. The PKCS#8 format supports password encryption (-----BEGIN ENCRYPTED PRIVATE KEY-----); when you need that, use OpenSSL's pkcs8 command or a desktop tool to wrap the generated key.
Is generation random enough?
The tool uses the browser's CSPRNG for prime candidate selection. Generation runs entirely in your browser session, and no key material is transmitted.