RSA & SSH Key Generator
Generate RSA key pairs in PEM format or SSH keys (Ed25519 or RSA) for GitHub and servers, privately in your browser.
Runs in your browser. Nothing is uploaded.
Choose a format and press Generate key pair. Your public and private keys appear here.
Fingerprint
Keys are generated by your browser's built-in cryptography and never leave this page. They aren't stored, so download them before you leave. The private key isn't password-protected; add a passphrase with ssh-keygen -p -f <file>.store it somewhere safe.
How to use the RSA & SSH Key Generator
- Choose RSA (PEM) for application keys or SSH key for logging in to servers and Git hosts. For RSA, pick a key size: 3072 bits is a good default.
- Choose what the key is for, signing or encryption.
- Press Generate key pair. Larger keys can take a few seconds.
- Copy or download the public key (PEM) and the private key (PKCS#8 PEM).
- Keep the private key secret and share only the public key.
Generate an RSA key pair in your browser
RSA key pairs are used to sign tokens and documents, encrypt small secrets, and configure test environments.
The usual way to make one is a terminal command such as openssl genpkey, which is fine if you have
OpenSSL installed and remember the flags. This tool generates the same standard keys with a click, using
the cryptography built into your browser.
What you get
- A public key in PEM format, to give to anyone who needs to verify your signatures or encrypt data for you
- A private key in PKCS#8 PEM format, which signs or decrypts and must be kept secret
- A choice of 2048, 3072 or 4096 bits
- A choice of signing (RSASSA-PKCS1-v1_5, as used by RS256 JWTs) or encryption (RSA-OAEP)
Both keys can be copied or downloaded as public.pem and private.pem.
Secure by design
Keys are created by the Web Crypto API, the same audited implementation browsers use for HTTPS, with a cryptographically secure random number generator. Nothing is sent over the network, and nothing is saved when you close the page.
SSH keys
Switch to SSH key to create a key pair for GitHub, GitLab or a server’s authorized_keys.
Ed25519 is the modern default: short, fast and secure. Choose RSA 4096 for older systems that
don’t accept Ed25519. The public key comes as a single ssh-ed25519 or ssh-rsa line with your
comment, ready to paste, and the private key in OpenSSH format, with the fingerprint shown so you can
check it later. Save the private key as ~/.ssh/id_ed25519 (or id_rsa) and add a passphrase with
ssh-keygen -p -f if you want one.
Handle the private key carefully
The private key is not password-protected. Store it in a secrets manager or an encrypted location, never in
a public repository, chat message or ticket. To add a passphrase, convert it with OpenSSL, for example
openssl pkcs8 -topk8 -in private.pem -out private-encrypted.pem. For SSH access to servers, use the
SSH key switch, which produces OpenSSH-format keys.
Frequently asked questions
Which key size should I choose?
2048 bits is the minimum accepted by current guidance and fine for keys with a short life. 3072 bits gives a comfortable margin for keys that will be used for years. 4096 bits is stronger still, but slower to generate and use.
What's the difference between the signing and encryption options?
The key maths is the same, but Web Crypto ties each key to an algorithm. Signing keys use RSASSA-PKCS1-v1_5 with SHA-256, as JWT RS256 does. Encryption keys use RSA-OAEP with SHA-256. Choose the one your application expects.
What format are the keys in?
The public key is SubjectPublicKeyInfo PEM (-----BEGIN PUBLIC KEY-----) and the private key is unencrypted PKCS#8 PEM (-----BEGIN PRIVATE KEY-----). OpenSSL, Node.js, Python, Java and most libraries read both directly.
Is the private key sent anywhere?
No. Keys are generated by your browser's Web Crypto API and exist only on this page. They're never uploaded or stored, so download them before you leave.
Should I use RSA or a newer algorithm?
RSA is still the most widely supported. For new systems that support them, elliptic-curve keys (ECDSA P-256 or Ed25519) are smaller and faster at the same security level.
Tutorials
How to create an SSH key and add it to GitHub
Generate an Ed25519 SSH key, install the private key on your computer, add the public key to GitHub and test the connection.
How to generate an RSA key pair for signing JWTs
Create an RSA key pair for RS256 tokens, configure the issuer with the private key and the API with the public key, and test it.