RSA Key Generator
Generate a fresh RSA key pair with a 2048 or 3072 bit modulus and the public exponent 65537. You get the private key as unencrypted PKCS #8 PEM, the public key as SPKI PEM, the matching OpenSSH ssh-rsa line with its SHA-256 fingerprint, the RS and PS algorithms it signs and the RFC 7638 JWK thumbprint to use as a key ID. Each pair is created with Node's crypto module for this request and never stored.
Frequently asked questions
Should I choose 2048 or 3072 bits?
2048 bit RSA is still the common minimum and is accepted everywhere, including JWT libraries that refuse smaller keys. 3072 bits matches the 128 bit security level that NIST SP 800-57 recommends beyond 2030, at the cost of larger signatures and slower signing. Larger sizes such as 4096 bits are not offered, because their generation time is unpredictable on a shared server.
Which formats does the result use?
The private key is PEM encoded PKCS #8 (BEGIN PRIVATE KEY) and the public key is PEM encoded SubjectPublicKeyInfo (BEGIN PUBLIC KEY). Both are read by OpenSSL, Java, .NET, Go, Node, jose and most other libraries. The OpenSSH public key line is added for authorized_keys files.
Is the private key encrypted?
No, the private key is returned without a passphrase so it can be pasted straight into other tools. To protect it at rest, run openssl pkey -in key.pem -aes256 -out key-encrypted.pem and store only the encrypted file. Keep the unencrypted copy out of version control.
How do I get the PKCS #1 format (BEGIN RSA PRIVATE KEY)?
Some older software expects the traditional PKCS #1 form. With OpenSSL 3 run openssl pkey -in key.pem -traditional -out key-rsa.pem to convert the PKCS #8 file. The key material is the same, only the wrapping changes.
Can I use the key for SSH?
Yes. Put the ssh-rsa line into ~/.ssh/authorized_keys on the server and save the private PEM as your identity file with permissions 600, since OpenSSH reads PEM encoded RSA keys. Many servers now prefer Ed25519 keys, which the Ed25519 Key Generator creates.
What is the JWK thumbprint?
It is the RFC 7638 SHA-256 hash of the public key's required JWK members, encoded in base64url. It identifies the key independent of its format, which makes it a good kid value for JWTs and JWKS documents. The JWK Converter shows the same value for this key.
Which JWT algorithms can this key sign?
An RSA key can sign RS256, RS384 and RS512 (PKCS #1 v1.5) and PS256, PS384 and PS512 (RSA-PSS). Use the private PEM with the JWT Generator and give verifiers the public PEM or its JWK. The algorithm is a property of the signature, so one key can serve several of them.
Is the generated key stored anywhere?
No. The key pair is created in memory for your request, returned once in the result and never logged or saved. If you lose it, generate a new pair, because nobody can recover it for you.
What does the comment option do?
The comment is appended to the OpenSSH public key line, typically user@host or a label such as deploy-2026, so you can recognize the key in authorized_keys. It does not change the key or its fingerprints. Comments are limited to 200 characters and whitespace is collapsed to single spaces.
How random are the keys?
The primes come from the operating system's cryptographically secure random generator through OpenSSL, the same source that servers use for their own keys. Every request produces a new, independent key pair. The public exponent is always 65537, the standard value.