What is RSA Key Pair Generator?
RSA Key Pair Generator — An RSA Key Generator is a free tool that creates RSA public/private key pairs in PEM format for use in encryption, digital signatures, and SSH authentication.
Loading your tools...
Generate RSA public and private key pairs in standard PEM format (PKCS#8). Choose 2048-bit or 4096-bit key size for JWT RS256 signing, SSH authentication, TLS/SSL certificates, and file encryption. Keys are generated in your browser using the Web Crypto API — private keys never leave your machine.
RSA Key Pair Generator: Select a key size (2048 or 4096 bits) and click generate. Download the public and private keys in PEM format. Use them for SSH, TLS certificates, JWT signing, or file encryption.
Keys are generated using the native Web Crypto API in your browser. They never leave your device.
Generated keys use standard PEM format (PKCS#1 / PKCS#8) compatible with OpenSSL, SSH, and most servers.
Use 2048-bit for standard security or 4096-bit for long-term data protection.
RSA Key Pair Generator — An RSA Key Generator is a free tool that creates RSA public/private key pairs in PEM format for use in encryption, digital signatures, and SSH authentication.
Select key size: 2048-bit (standard) or 4096-bit (higher security, slower operations).
Click Generate to create the RSA key pair in PEM format.
Copy the public key for sharing and the private key for secure storage.
Use the keys in your JWT signing, SSH config, TLS setup, or encryption workflow.
Generating RSA keys for JWT RS256 token signing in authentication systems
Creating SSH key pairs for server access and Git authentication
Generating test certificates for TLS/SSL development and staging environments
Testing RSA encryption and decryption across Node.js, Python, and Java implementations
RSA (Rivest–Shamir–Adleman, published 1977) is the original practical public-key cryptosystem. Its security comes from the mathematical difficulty of factoring large semi-prime numbers — given n = p × q where p and q are large primes, recovering p and q from n is currently believed to require sub-exponential time. RSA still dominates TLS certificate signing, JWT RS256 tokens, S/MIME email encryption, and SSH keys despite slower competitors emerging. Why it persists: universal library support, decades of cryptanalysis without practical breaks, hardware acceleration in modern CPUs, and a mature ecosystem of PKI tooling.
| Key size | Security bits | NIST status | Typical use | Relative speed |
|---|---|---|---|---|
| 1024-bit | ~80 bits | Deprecated (since 2014) | Legacy only — do not use | Fast |
| 2048-bit | ~112 bits | Acceptable through 2030 | JWT, TLS, most APIs | Baseline |
| 3072-bit | ~128 bits | Recommended for new systems | Long-lived signing keys | ~2× slower |
| 4096-bit | ~140 bits | High-security future-proofing | Root CAs, long-term archive | ~4× slower |
Recommendation: 2048-bit is the right default for almost everyone — fast enough for per-request signing, secure through at least 2030. Choose 3072 or 4096 for keys that will be deployed for 10+ years (root CAs, long-lived TLS certs) or where compliance policy demands it.
The tool outputs PKCS#8 (private) and SPKI (public), the modern standards used by every current cryptographic library. The keys begin with:
-----BEGIN PRIVATE KEY----- = PKCS#8 (this tool's output, also openssl genpkey's default)-----BEGIN RSA PRIVATE KEY----- = PKCS#1 (older openssl genrsa output)-----BEGIN OPENSSH PRIVATE KEY----- = OpenSSH proprietary, used by ssh-keygen-----BEGIN PUBLIC KEY----- = SPKI (this tool's public output)-----BEGIN RSA PUBLIC KEY----- = PKCS#1 publicConvert between formats with OpenSSL: openssl rsa -in pkcs8.pem -traditional -out pkcs1.pem (PKCS#8 → PKCS#1) or ssh-keygen -p -m PEM -f id_rsa (OpenSSH → PEM).
Ed25519 (Edwards curve, RFC 8032) is the modern default for SSH keys and is increasingly preferred for new signing applications. A 256-bit Ed25519 key provides ~128 bits of security (equivalent to RSA-3072) with much smaller signatures (64 bytes vs 384 for RSA-3072) and faster operations. ECDSA P-256 is the NIST-approved elliptic-curve alternative, used in TLS 1.3 cipher suites and JWT ES256. When to choose RSA: when interoperating with legacy systems, when you need encryption (RSA-OAEP) in addition to signing, when your platform mandates RSA (some government / banking systems), or when JWT compatibility requires RS256. When to choose Ed25519 / ECDSA: new SSH keys, modern TLS, performance-sensitive signing, embedded devices, anywhere "new green-field" applies.
Keys generated in any browser tool — including this one — are fine for development, JWT signing in non-critical apps, and learning. For production keys protecting payments, user data, infrastructure access, or compliance-sensitive workloads, use:
git-secrets pre-commit hooks or scan with TruffleHogchmod 600 private.pemA sufficiently large quantum computer running Shor's algorithm could factor RSA keys in polynomial time, breaking RSA entirely. As of today, no such computer exists, and credible estimates place practical attacks at least 10–15 years away. For high-stakes long-term secrets (intelligence, multi-decade legal documents), the "harvest-now-decrypt-later" risk is real — adversaries could store encrypted RSA traffic today and decrypt it once quantum hardware arrives. NIST has standardized post-quantum algorithms (ML-KEM / Kyber, ML-DSA / Dilithium) that you may want to hybrid-deploy alongside RSA for forward secrecy. For typical web app JWT signing or session keys, RSA-2048 is fine for the foreseeable future.