RSA Key Generator
Crypto & SecurityGenerate RSA and EC key pairs (2048/3072/4096-bit) for SSH, TLS, JWT — PEM format. Free, private — all processing in your browser.
This tool is coming soon. Check back later!
The RSA Key Generator creates asymmetric cryptographic key pairs for signing, encryption, TLS certificates, SSH authentication, JWT signing, and API authentication. Supports RSA (2048, 3072, 4096-bit) — the traditional standard, and Elliptic Curve (P-256, P-384, P-521, Ed25519) — the modern alternative with smaller keys and faster operations at equivalent security. Output includes both private key (PEM-encoded PKCS#8 by default) and public key (PEM-encoded SPKI or OpenSSH format). Keys are generated using the browser Web Crypto API — the same battle-tested cryptography used by TLS connections. Private keys never leave your browser.
Asymmetric keys power modern authentication: SSH logins (no password), TLS certificates (HTTPS), JWT token signing (RS256/ES256), code signing (npm, Apple, Google), cryptocurrency wallets (Bitcoin, Ethereum), and email encryption (PGP). Correctly generating keys matters — an RSA 1024-bit key is breakable; RSA 2048 is secure until ~2030; 4096 is future-proof for longer. Elliptic Curve keys (P-256) offer equivalent security to RSA 3072 with much smaller keys and faster operations. This tool makes correct key generation simple, without installing OpenSSL or learning its arcane CLI syntax.
RSA Key Generator — key features
RSA key sizes: 2048/3072/4096
2048 for general use, 3072 for higher security, 4096 for long-term.
Elliptic Curve keys: P-256/P-384/Ed25519
Modern alternatives with smaller keys. Ed25519 is the current best practice for SSH and signing.
PEM format output
Standard encoding compatible with OpenSSL, Apache, nginx, Java keytool, Node crypto, Python cryptography, and every other tool.
OpenSSH public key format
Directly paste into ~/.ssh/authorized_keys on remote servers. Compatible with ssh-copy-id.
PKCS#8 and PKCS#1
Both private key formats supported. PKCS#8 is modern default; PKCS#1 for legacy RSA-specific needs.
Web Crypto API
Uses native browser cryptography (crypto.subtle.generateKey). Same library used for TLS handshakes in your browser.
Download or copy
Save keys as .pem files or copy to clipboard. Files never uploaded anywhere.
100% client-side generation
Private keys are generated entirely in your browser. They never transit to our servers or anywhere else.
How to use the RSA Key Generator
- 1
Choose algorithm
RSA (traditional, widely supported) or EC (modern, smaller/faster). Ed25519 is recommended default for SSH.
- 2
Choose key size (RSA) or curve (EC)
RSA: 2048 for general, 4096 for long-term. EC: P-256 for compatibility, Ed25519 for modern SSH.
- 3
Click Generate
Web Crypto API produces the key pair in a few seconds for RSA, instantly for EC.
- 4
Download private key
Save as .pem file. **Treat as extremely sensitive** — anyone with this file can impersonate you.
- 5
Download public key
PEM format for TLS/code signing. OpenSSH format for SSH server access.
- 6
Set file permissions
After saving private key: chmod 600 key.pem. Prevents accidental exposure to other users on the system.
Common use cases for the RSA Key Generator
SSH access
- →Generate SSH key for server login: Create Ed25519 or RSA key. Add public key to ~/.ssh/authorized_keys on server. Login without password.
- →Deploy keys for CI/CD: Generate deploy keys for GitHub Actions, GitLab CI. Read-only or read-write access to specific repos.
- →Multiple identities: Different keys for personal vs work GitHub, different client projects. Manage in ~/.ssh/config.
TLS and certificates
- →TLS certificate CSR: Private key needed to request a certificate from Let's Encrypt or paid CA.
- →Self-signed certificates: For development or internal use, pair with a self-signed certificate creation.
- →Client certificates: Mutual TLS — client authenticates with a cert. Generate client keys.
JWT and API auth
- →JWT signing with RS256: Generate RSA key pair. Sign JWTs with private key on auth server. Verify with public key in services.
- →JWT with ES256: Smaller, faster signatures with EC. Modern standard for microservices.
- →API request signing: AWS-style signed requests use asymmetric keys.
- →Webhook signature verification: Recipients verify webhooks with sender's public key.
Git signing
- →GPG-like commit signing with Ed25519: Git supports SSH signing of commits (Git 2.34+). Generate Ed25519 key, commit signatures verified via public key.
- →Verified author badge on GitHub: Signed commits appear as verified on GitHub.
- →Tag signing for releases: Signed git tags prove release authenticity.
RSA Key Generator — examples
Ed25519 key pair (recommended for SSH)
Modern, small, secure.
Algorithm: Ed25519
-----BEGIN PRIVATE KEY----- MC4CAQAwBQYDK2VwBCIEIEYmxD9ZHqFl... (250 chars) -----END PRIVATE KEY----- -----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAxCthKZJ3s8JxeIvG... (68 chars) -----END PUBLIC KEY----- OpenSSH format: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN... user@host
RSA 2048 for TLS
Standard for web server certificates.
Algorithm: RSA, size: 2048
-----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAAS... (1700+ chars) -----END PRIVATE KEY----- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ... (400 chars) -----END PUBLIC KEY-----
ES256 (P-256) for JWT
Modern JWT signing.
Algorithm: EC, curve: P-256
-----BEGIN PRIVATE KEY----- MIGHAgEAMBMGByqGSM49AgEGCCqGSM49A... (220 chars) -----END PRIVATE KEY----- -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQc... (180 chars) -----END PUBLIC KEY-----
RSA 4096 for long-term
High-security code signing key.
Algorithm: RSA, size: 4096
-----BEGIN PRIVATE KEY----- (3200+ char key) -----END PRIVATE KEY----- Note: slower operations but post-quantum resistant.
Adding SSH key to server
Actual usage workflow.
Generated Ed25519 key
# On your machine: save private key $ ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 (Or paste our generated key into ~/.ssh/id_ed25519) # On your machine: copy public key $ cat ~/.ssh/id_ed25519.pub ssh-ed25519 AAAAC3NzaC1... user@host # On server: add to authorized_keys $ echo "ssh-ed25519 AAAAC3NzaC1..." >> ~/.ssh/authorized_keys $ chmod 600 ~/.ssh/authorized_keys
Technical details
Asymmetric (public-key) cryptography uses key pairs: private key (kept secret) and public key (shared freely). The keys are mathematically related but one cannot derive the private from the public.
RSA (Rivest-Shamir-Adleman, 1977):
Based on the difficulty of factoring products of large prime numbers. Most widely-deployed asymmetric algorithm.
Key sizes:
| Size | Bits | Security level | Performance |
|---|---|---|---|
| 2048 | 2048 | Secure until ~2030 | Fast |
| 3072 | 3072 | Secure until ~2050 | Moderate |
| 4096 | 4096 | Long-term secure | Slow |
Elliptic Curve Cryptography:
Based on algebraic structure of elliptic curves. Smaller keys, faster operations, equivalent security.
EC key sizes vs RSA equivalents:
| EC Curve | Bits | Equivalent RSA | Status |
|---|---|---|---|
| P-256 | 256 | RSA 3072 | Standard, widely supported |
| P-384 | 384 | RSA 7680 | Higher security |
| P-521 | 521 | RSA 15360 | Maximum security |
| Ed25519 | 256 | RSA 3072 | Modern best, fastest, smallest signatures |
Output formats:
PEM (Base64-encoded DER with headers):
````
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQ...
-----END PRIVATE KEY-----
PKCS#8 (modern private key format): BEGIN PRIVATE KEY
PKCS#1 (RSA-specific legacy): BEGIN RSA PRIVATE KEY
SPKI (modern public key format): BEGIN PUBLIC KEY
PKCS#1 Public (RSA-specific legacy): BEGIN RSA PUBLIC KEY
OpenSSH format (for ssh-copy-id, authorized_keys):
````
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC... user@host
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... user@host
Typical use cases and recommended algorithms:
| Use case | Algorithm | Why |
|---|---|---|
| SSH server auth | Ed25519 or RSA 4096 | Ed25519 is modern; RSA 4096 for compatibility |
| TLS certificates | RSA 2048 or ECDSA P-256 | Both widely supported |
| JWT signing | ES256 (P-256) | Modern, small signatures |
| Code signing | RSA 4096 | Long-term stability |
| Git commit signing | Ed25519 | Modern, fast |
| Bitcoin/Ethereum | ECDSA secp256k1 | Blockchain standard |
Key pair relationship:
- Private key signs and decrypts (only you).
- Public key verifies signatures and encrypts messages to you (anyone).
- Loss of private key = lose access (passphrase-protect for physical theft).
- Public key leak is fine (that is what public means).
Passphrase protection:
Private keys can be encrypted with a passphrase. Required to use the key:
````
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQI...
-----END ENCRYPTED PRIVATE KEY-----
This tool generates unencrypted keys by default. Encrypt with OpenSSL if needed:openssl pkcs8 -in key.pem -topk8 -v2 aes-256-cbc -out encrypted.pem
Security best practices:
- Never commit private keys to git (add *.pem, *.key to .gitignore).
- Set proper permissions: chmod 600 key.pem (owner read/write only).
- Rotate periodically — especially after any suspected compromise.
- Use hardware keys for high-value keys (YubiKey, AWS KMS, HSMs).
- Backup securely — loss of key = loss of access.
Common problems and solutions
⚠Leaking private keys in git
Absolute worst-case scenario. Private key in git history = immediate compromise. Add *.pem, *.key, id_rsa*, id_ed25519* to .gitignore BEFORE commits. If leaked: rotate immediately + use BFG to remove from history + assume compromise.
⚠Using RSA 1024-bit keys
RSA 1024 was secure in 2010, broken by 2020+. Minimum 2048 now; 3072+ for new deployments. If you still use 1024, generate new keys and migrate immediately.
⚠Weak passphrases
Passphrase-protected private keys are only as secure as the passphrase. Short passphrases = brute-forceable. Use long passphrases (20+ chars) or better, hardware keys (YubiKey, TPM).
⚠Wrong file permissions
SSH refuses keys with world-readable permissions. Set: chmod 600 ~/.ssh/id_rsa (owner read/write only). 644 is acceptable for public keys, never for private.
⚠Copy-paste errors
PEM format is whitespace-sensitive for line lengths. Copy-paste from chat or Word can corrupt keys. Always save/transfer via scp, file attachments, or dedicated secret sharing tools.
⚠Using same key everywhere
Single key across all services = single point of compromise. Use different keys for: personal dev, work dev, production, CI/CD, each service. Catalog keys. Rotate independently.
⚠Forgetting key rotation
Keys should be rotated periodically — 1-2 years typical. Emergency rotation on any suspected compromise. Plan rotation procedures; do not leave keys forever.
⚠Not backing up keys
Lost private key = lost access forever. Backup encrypted copies to secure storage (password manager, encrypted USB, hardware security token). Without backup, you cannot recover access if your machine dies.
RSA Key Generator — comparisons and alternatives
RSA vs EC vs Ed25519: RSA — traditional, widely supported, larger keys. EC (P-256/P-384) — modern, smaller, faster, same security. Ed25519 — newest, fastest, smallest signatures, best for SSH. Modern recommendation: Ed25519 for SSH, ECDSA for most else, RSA for legacy compatibility.
RSA-2048 vs RSA-4096: 2048 is secure until ~2030 with current technology. 4096 is future-proof. Performance: 4096 is ~5x slower for signing. Choose 4096 for long-lived keys (root CAs, code signing). Use 2048 for tokens (short-lived).
PKCS#8 vs PKCS#1: PKCS#8 is modern, algorithm-agnostic (BEGIN PRIVATE KEY). PKCS#1 is RSA-specific legacy (BEGIN RSA PRIVATE KEY). Modern libraries prefer PKCS#8. Conversion: openssl pkcs8 -in old.pem -topk8 -nocrypt -out new.pem.
PEM vs DER vs OpenSSH: PEM is Base64-encoded DER with headers (text). DER is binary. OpenSSH is a single-line text format for SSH keys. Different tools expect different formats; all are equivalent.
Web Crypto vs OpenSSL: Web Crypto (this tool) is in-browser JavaScript, no install. OpenSSL is CLI, more features (passphrase encryption, conversions). Both produce compatible keys.
Encrypted vs unencrypted private keys: Encrypted private keys need a passphrase to use. Higher security (theft needs passphrase too). This tool generates unencrypted; encrypt with OpenSSL after if needed.
Frequently asked questions about the RSA Key Generator
▶What is the difference between RSA and EC keys?
RSA (traditional) is based on prime factorization — large keys (2048+ bits), slower operations. EC (Elliptic Curve) is based on elliptic curve math — much smaller keys (256 bits) at equivalent security. EC is modern preference: faster, smaller, same security. Ed25519 is a specific EC algorithm widely used for SSH.
▶Are my keys secure?
Yes. Keys are generated using the browser Web Crypto API (crypto.subtle.generateKey), which uses the same OS cryptographic randomness used for TLS. Keys never leave your browser — we cannot recover them if you lose them. Save private keys immediately after generation.
▶What key size should I use for RSA?
RSA 2048 is secure until ~2030 and fast. RSA 4096 is future-proof but 5x slower. For most uses (SSH, TLS, JWT), 2048 is sufficient. For long-lived keys (root CAs, code signing certs), use 4096. Never use 1024 — broken.
▶What is Ed25519 and should I use it?
Ed25519 is a modern elliptic curve signing algorithm. Smaller keys (256 bits), faster than RSA or older EC. Widely supported in OpenSSH 6.5+, Git 2.34+, and modern libraries. Use Ed25519 for SSH keys — current best practice.
▶What is PEM format?
PEM (Privacy-Enhanced Mail) is a common text format for keys and certificates. Base64-encoded DER data between header lines (-----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----). Supported by virtually all cryptographic tools (OpenSSL, Java keytool, Python cryptography, Node crypto).
▶How do I use the key for SSH?
Save the private key to ~/.ssh/id_ed25519 (or id_rsa for RSA). Set permissions: chmod 600 ~/.ssh/id_ed25519. Copy the public key to the server: cat ~/.ssh/id_ed25519.pub and add to ~/.ssh/authorized_keys on the server. Test: ssh user@server.
▶How do I use the key for JWT signing?
Use the RSA (for RS256) or EC (for ES256) private key to sign JWTs in your backend. Distribute the public key (via JWKS endpoint typically) for services to verify. Our JWT Generator accepts these keys.
▶Should I password-protect my private key?
Yes, for keys stored on disk. Passphrase protection means an attacker with file access still needs the passphrase. This tool generates unencrypted keys; encrypt with OpenSSL: openssl pkcs8 -in key.pem -topk8 -v2 aes-256-cbc -out encrypted.pem. Use a strong passphrase.
▶What happens if I lose my private key?
You lose access to everything the key authorizes. No way to recover a private key from a public key. Prevention: (1) Back up keys securely (encrypted USB, password manager). (2) Have a recovery path (second SSH key, admin access). (3) For certificates, generate a new key and re-certify.
▶Can the same key be used for multiple purposes?
Technically yes, but do not. Same key for SSH + TLS + JWT = compromise of one = compromise of all. Generate separate keys for separate purposes. Label them: github-deploy-key.pem, prod-tls.key, jwt-signing-2026.key.
Additional resources
- RFC 8017 — PKCS #1 RSA — RSA cryptography specification.
- RFC 8032 — Ed25519 — Ed25519 signature algorithm.
- NIST FIPS 186-5 — Digital Signature Standard (DSA, ECDSA, Ed25519).
- Web Crypto API — SubtleCrypto.generateKey — Browser API used by this tool.
- SSH Keys — Tooleras blog — Our crypto tutorials.
Related tools
All Crypto & SecurityBase64 Encoder/Decoder
Encode and decode Base64 strings, files, and images instantly
Bcrypt Hash Generator
Hash passwords with bcrypt and verify existing hashes — configurable rounds
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-512 hashes for text and files
HMAC Generator
Generate HMAC signatures (SHA-256, SHA-512) for API auth and webhook verification
JWT Decoder
Decode and inspect JSON Web Token (JWT) headers, payloads, and signatures
JWT Generator
Create signed JSON Web Tokens (JWT) with custom claims — HS256, RS256, ES256
Learn more
Explore more tools
200+ free tools that run in your browser.
Browse all tools →