Free RSA Key Pair Generator
Generate a cryptographic RSA public/private key pair. Choose 2048 or 4096 bits and export both keys in PEM format for use with OpenSSL, Node.js, SSH and web servers.
RSA gives you a key pair for asymmetric work, while AES handles bulk symmetric encryption. Once generated, tidy the output with the Key Formatter.
How to use the RSA Keys
- 1 Choose the key size — 2048 bits is the current minimum for anything real.
- 2 Generate the pair and wait while the browser does the maths.
- 3 Copy the public key to share, and keep the private key secret.
- 4 Store the private key somewhere safe; it cannot be recovered if lost.
Asymmetric RSA key pair generation and PEM encoding standards
The RSA Key Generator produces asymmetric public and private key pairs based on the mathematical difficulty of factoring the product of two large prime numbers. Users can select industry-standard key bit lengths: 2048 bits for general application compatibility or 4096 bits for high-security, long-term cryptographic authorization.
The tool outputs keys formatted in standard Privacy Enhanced Mail (PEM) syntax. The private key is formatted using PKCS#8 (`BEGIN PRIVATE KEY`), and the public key uses SubjectPublicKeyInfo SPKI (`BEGIN PUBLIC KEY`). These standard formats can be imported directly into SSH servers, OpenSSL configurations, TLS certificates, and API authentication gateways.
- Generates asymmetric public and private RSA key pairs at 2048-bit and 4096-bit lengths.
- Outputs industry-standard PEM-encoded blocks ready for OpenSSL and SSH servers.
- Private keys adhere to PKCS#8 standards; public keys adhere to SPKI specifications.
- Essential for configuring TLS mutual authentication, SSH keys, and digital signatures.
Keeping your private key safe
A private key is like a password — anyone who has it can impersonate you or decrypt your messages. Store it with restrictive file permissions, never commit it to source control, and rotate it if it may have been exposed.
Frequently asked questions
Is 2048 bits still enough?
Yes for now — 2048-bit RSA is still accepted by every major certificate authority and is estimated to hold until well past 2030. Many organisations have moved to 4096 for longer-lived keys, but the larger key makes every operation slower.
What key formats and encodings are output by this RSA generator?
The generator outputs standard PEM-encoded keys with standard headers (BEGIN RSA PRIVATE KEY / BEGIN PUBLIC KEY) using PKCS#8 for private keys and SubjectPublicKeyInfo (SPKI) for public keys. These standard formats can be imported directly into OpenSSL, SSH configurations, Nginx/Apache TLS certificates, and API authentication systems without additional conversion.
What is the difference between the public and private key?
The public key can be shared freely and is used to encrypt messages or verify signatures. The private key must never leave your control, because it decrypts those messages and creates the signatures. Anyone holding it can impersonate you completely.
Related Security & Cryptography Tools
You might also need
Tools from other categories that people pair with the RSA Keys: