RSA Key Generator
Generate an RSA public and private key pair in PEM format with selectable key size, PKCS format, and optional passphrase protection. Read more
Generate an RSA key pair online
RSA uses a mathematically related public key and private key. The public key can be distributed for encryption or signature verification; the private key must remain secret and is used for decryption or signing.
Choose a modulus size from 512 to 4096 bits and export the keys in a supported PEM representation. Private-key PEM output can optionally be encrypted with a passphrase and the selected cipher.
How to generate RSA keys
- Choose the RSA key size required by the receiving system.
- Select PKCS#1, PKCS#5, or PKCS#8 according to its key-import requirements.
- Enable passphrase protection for a private key that will be stored or transported.
- Generate and download both keys, then keep the private key in protected storage.
This page defaults to 1024 bits for historical compatibility. For modern security use, select at least 2048 bits; NIST SP 800-131A requires an RSA modulus of 2048 bits or more for approved digital-signature generation and key establishment.
RSA key format and safety
PEM is a textual container around encoded key data. PKCS#1 represents RSA-specific key structures, while PKCS#8 is a general private-key container. A PEM passphrase protects the stored private key but does not replace secure storage, access control, and backups.
Browser generation reduces the need to send key material to an application server, but highly sensitive production keys should be created and retained in a reviewed cryptographic environment or hardware-backed keystore.
RSA key generator FAQ
Can I derive the private key from the public key?
Properly generated RSA is designed to make that infeasible at an adequate key size. Never publish or share the private key.
What happens if I forget the PEM passphrase?
The tool cannot recover it. Keep a protected backup or generate a replacement key pair and rotate dependent systems.
Can one RSA key be used for every purpose?
Separate keys by application and purpose when practical. Protocol requirements determine whether a key may be used for encryption, signing, or both.