An RSA key generator cheat sheet should fix the key profile before generation: use RSA-OAEP with SHA-256, exponent 65537, a 2048- or 3072-bit modulus, SPKI PEM for the public key, and unencrypted PKCS#8 PEM for the private key.
This profile applies to software that encrypts data or a symmetric key for the holder of an RSA private key. It is not a general-purpose RSA workflow for certificates, SSH authentication, or digital signatures. The RSA Key Generator supports this exact encryption profile and performs the key generation and export locally in the browser.

Check the compatibility profile first
Interoperability problems usually appear when one system expects a different RSA primitive, hash, key length, or PEM envelope. Treat the following values as a gate before creating a key pair for an application.
| Setting | Supported value | Compatibility check |
|---|---|---|
| Encryption primitive | RSA-OAEP | The receiving system must use OAEP rather than raw RSA or PKCS#1 v1.5 encryption. |
| Hash | SHA-256 | Both sides must agree on the OAEP hash configuration. |
| Public exponent | 65537 | Confirm that the application accepts this exponent. |
| Modulus length | 2048 or 3072 bits | Select a size supported by every participating system. |
| Public-key envelope | SPKI PEM | The file begins with BEGIN PUBLIC KEY. |
| Private-key envelope | PKCS#8 PEM | The file begins with BEGIN PRIVATE KEY. |
If the destination requires a different primitive, hash, exponent, modulus length, or envelope, this output is not the requested artifact. The generator intentionally does not offer 1024-bit keys, custom public exponents, raw RSA, PKCS#1 v1.5 encryption, or SHA-1 because its fixed choices reduce common configuration mistakes.
Choose between 2048 and 3072 bits
Both sizes use the same OAEP-SHA-256 profile and public exponent. Their practical difference is the balance between interoperability, security margin, and browser processing cost.
| Key size | Operational profile | Best fit |
|---|---|---|
| 2048 bits | Broad interoperability with faster generation and RSA operations. | Systems designed around the widely supported 2048-bit profile. |
| 3072 bits | A larger security margin with slower generation and RSA operations. | Applications that accept 3072-bit keys and can accommodate the added cost. |
Generation is asynchronous, and the larger modulus can take extra time. Every generation produces fresh random material, so running the generator twice with identical settings is expected to produce two different key pairs. Do not combine the public key from one result with the private key from another.
Generate, distribute, and test the pair
- Confirm the recipient requirements. Verify that the application expects RSA-OAEP with SHA-256, exponent 65537, an accepted modulus length, and SPKI/PKCS#8 PEM envelopes.
- Select the modulus size. Choose 2048 bits for broad interoperability or 3072 bits when the application supports it and the slower generation and operations are acceptable.
- Generate one pair. Open the RSA Key Generator, select the size, and generate the key pair. The browser's Web Cryptography implementation produces the large RSA primes and exponent 65537, then exports the public and private material.
- Distribute only the public key. Copy the SPKI PEM beginning with BEGIN PUBLIC KEY and send it to the system that needs to encrypt data for the private-key holder.
- Import the private key directly. Move the PKCS#8 PEM beginning with BEGIN PRIVATE KEY into an appropriate secret manager or encrypted keystore with strict access controls and backups. Do not stage it in source control, tickets, chat, analytics, browser sync, or ordinary notes.
- Run an application-level round trip. Have the recipient encrypt a short known test message with the public key, decrypt it with the private key, and confirm the original content is recovered exactly. Use the exact protocol and OAEP settings required by the application.
- Clean up the handoff. Once the private key is safely imported, close the tab and clear clipboard history. If the private key is exposed, rotate it immediately rather than trying to repair the exposed copy.
The generator's verification imports the exported SPKI and PKCS#8 material back into Web Crypto, encrypts a known UTF-8 message with the public key, verifies exact recovery with the private key, and checks that the imported key reports the selected modulus length. A fixed private-key golden value cannot serve as the correctness check because secure key generation is random. These checks establish internal consistency, but they cannot guarantee that a separate application uses matching OAEP settings.
Identify the exported PEM correctly
The public output is a SubjectPublicKeyInfo, or SPKI, structure encoded as PEM. Its BEGIN PUBLIC KEY header distinguishes it from a private-key file. It contains the public component needed to encrypt compatible ciphertext for the key holder and can be distributed to the systems that need it.
The private output is an unencrypted PKCS#8 PEM beginning with BEGIN PRIVATE KEY. PEM is a textual encoding convention described by RFC 7468; it is not, by itself, proof that another system will use the desired OAEP hash and other parameters. Anyone who obtains this readable private PEM can decrypt compatible ciphertext, so copying it transfers full responsibility for protecting it.
Protect the private key during the handoff
No key bytes are sent to the application server. The public and private outputs remain in component memory until navigation or replacement, and the browser's native Web Crypto implementation performs the key generation. That does not create an absolute security boundary: browser extensions, malware, clipboard managers, and screenshots remain outside the generator's control. Use a trusted, patched device.
The private PEM has no password-encryption envelope. Import it directly into protected storage rather than leaving a copy in the page, clipboard, downloads folder, or chat history. Close the tab and clear clipboard history after a successful import. If an unencrypted private key reaches an uncontrolled location, treat it as compromised and rotate it immediately.
Match OAEP settings and payload handling
RSA-OAEP parameters must match on both sides. A receiving system may default to SHA-1 or use a different OAEP label or mask-generation setting even when it accepts the PEM file. RSA-OAEP itself is standardized in RFC 8017. That is why a successful import is only a format check; the required final test is an encryption-and-decryption round trip through the exact application protocol.
RSA also encrypts only a limited amount of data. Applications normally generate a random symmetric key, protect that key with RSA-OAEP, and encrypt the actual payload with authenticated symmetric encryption. Do not split a large file into raw RSA blocks. This generator creates the RSA key pair intentionally and does not define a hybrid file format, so the application must specify how the symmetric key and payload are combined.
Use the generator for the correct RSA job
This tool creates RSA-OAEP encryption keys, not every kind of RSA key material. It is not a certificate authority and does not create X.509 certificates, certificate signing requests, digital signatures, SSH keys, or JSON Web Keys. It also does not provide RSA-PSS signing keys, raw RSA, PKCS#1 v1.5 encryption, or SHA-1 configurations.
For production identity management or TLS, prefer the key-generation workflow supplied by the owning application platform or a hardware security module. If another system requires a different format, converting the generated material later must preserve the algorithm parameters and the secrecy of the private key.
Complete the deployment sign-off
A key pair is ready for use only after all relevant checks pass:
- The application expects RSA-OAEP with SHA-256 and accepts the selected modulus and exponent.
- The public SPKI PEM is installed in the encrypting system.
- The private PKCS#8 PEM is stored only in an appropriate protected keystore or secret manager.
- A known message survives the complete encrypt-and-decrypt workflow.
- The application uses an approved hybrid payload design for data larger than the RSA payload limit.
- Clipboard, temporary files, source control, tickets, chat, and analytics contain no private-key copy.
Related reading: Convert to UTF-8 Cheat Sheet: Encoding Map and Checks.
Related reading: RSA Key Generator: Command Line vs Online.