An RSA key generator creates a matched public–private key pair for RSA-OAEP encryption: the public key encrypts, and the mathematically related private key decrypts.
The RSA Key Generator uses native browser Web Crypto to create fresh 2048- or 3072-bit keys with RSA-OAEP, SHA-256, and exponent 65537. It exports the public key as SPKI PEM and the private key as unencrypted PKCS#8 PEM. No key bytes are sent to the application server.
This is deliberately an encryption-key workflow, not a universal tool for signing, certificates, SSH access, or every RSA format.

What the generator creates
RSA is an asymmetric cryptosystem: the two keys have different roles but are mathematically connected. The generator asks the platform’s Web Cryptography implementation to generate two large primes and build a key pair using exponent 65537. Secure generation includes random output, so running the tool twice with identical settings produces different keys.
- Public key: This can be distributed to systems that need to encrypt information for the key holder.
- Private key: This decrypts compatible ciphertext and must remain under the key holder’s control.
- Key pair: The public and private components are generated together and should be treated as one coordinated security setup.
The generated public and private outputs remain in component memory until navigation or replacement. That does not make the browser environment invulnerable: extensions, malware, clipboard managers, and screenshots remain outside the tool’s local-processing boundary. Use a trusted, patched device.
The parameters it fixes
RSA-OAEP is the encryption scheme defined by the RSA-OAEP specification. This generator fixes the OAEP hash at SHA-256 and the public exponent at 65537. Those choices define a specific key profile; another application can expect different parameters even when it accepts the same PEM files.
A key that declares SHA-256 does not guarantee that every recipient will use the complete OAEP configuration you expect. Another system may default to SHA-1 or use a different label or mask-generation setting. Both sides must use matching OAEP parameters, so confirm the recipient’s configuration before treating the key as production-ready.
The tool intentionally does not offer 1024-bit keys, custom public exponents, raw RSA, PKCS#1 v1.5 encryption, or SHA-1. These fixed, safer choices reduce the risk of selecting an unsuitable cryptographic configuration by mistake.
Choosing between 2048 and 3072 bits
Both offered sizes create RSA-OAEP encryption keys, but they balance compatibility, security margin, and browser processing cost differently.
| Modulus size | Main advantage | Tradeoff | Best fit |
|---|---|---|---|
| 2048 bits | Broad interoperability | Lower generation and operation cost | A compatibility-focused choice when the recipient explicitly supports it |
| 3072 bits | Larger security margin | Slower generation and operations | A stronger-margin choice when both sides support the larger modulus |
Choose 2048 bits when broad compatibility is the priority. Choose 3072 bits when the larger security margin matters and the receiving system supports that modulus. Allow extra time for 3072-bit generation because the larger modulus costs more to create. Neither size makes the output predictable: random key generation means every new pair differs.
Reading the two PEM outputs
PEM provides a portable text envelope for binary key data, as described by RFC 7468. The generator Base64-wraps the binary DER representation at 64 columns. The envelope and the structure inside it have separate purposes.
| Output | Structure | First line | Correct handling |
|---|---|---|---|
| Public key | SubjectPublicKeyInfo, or SPKI | BEGIN PUBLIC KEY | Distribute to systems that encrypt for the key holder |
| Private key | PKCS#8, without a password envelope | BEGIN PRIVATE KEY | Move directly into protected secret storage |
The public PEM contains an ASN.1 SPKI structure, while the private PEM contains PKCS#8 private-key material. The private output is not password-encrypted. Anyone who obtains it can decrypt compatible ciphertext, so copying it transfers full responsibility for protecting it.
Generate, distribute, and test the key pair
Use this workflow only after confirming that the recipient expects the generator’s specific RSA-OAEP and PEM profile.
- Confirm the application requirements. Check that it requires RSA-OAEP with SHA-256, exponent 65537, SPKI PEM for the public key, and PKCS#8 PEM for the private key. If it expects a different profile, use a workflow that supports that configuration.
- Choose the modulus and generate. Select 2048 or 3072 bits and start generation. Allow additional time when producing the larger 3072-bit modulus.
- Distribute only the public key. Copy the SPKI PEM to the system or recipient that must encrypt data for the private-key holder. Do not distribute the private key with it.
- Import the private key directly into protected storage. Move the unencrypted PKCS#8 PEM into an appropriate secret manager or encrypted keystore with strict access controls and protected backups. Avoid leaving it in ordinary notes or transient locations.
- Perform an end-to-end encryption test. Use the exact application protocol to encrypt a small sample with the public key, decrypt it with the private key, and confirm exact recovery. Repeat the test through the real integration rather than relying only on a standalone import.
Why a successful import is not enough
The generator performs its own checks, but those checks cannot guarantee that every receiving application is configured identically. Because secure generation is random, correctness cannot be measured against one fixed private-key value. Instead, the tool locks eight externally visible parameter invariants, exports both envelopes, imports the generated SPKI and PKCS#8 keys back into Web Crypto, encrypts a known UTF-8 message with the public key, and asserts exact recovery with the private key. The imported algorithm must also report the selected modulus length.
- Confirm that the recipient imports the SPKI public key correctly.
- Confirm that both sides use SHA-256 for the OAEP hash.
- Confirm that the OAEP label and mask-generation settings match.
- Follow the application’s exact ciphertext encoding, framing, and transport rules.
- Confirm that the decrypted result exactly matches the original message.
A PEM can import successfully while the application still fails to decrypt because its OAEP configuration differs. The generator’s internal round trip validates the generated key mechanics; an application-level round trip validates the complete integration.
Protecting the private key
Secure generation and secure storage are separate tasks. Copying an unencrypted private PEM transfers full responsibility for protecting it, including any backups created from it.
- Store it only in a suitable secret manager or encrypted keystore with strict access control.
- Do not place it in source control, tickets, chat, analytics, browser sync, or ordinary notes.
- Close the tab and clear clipboard history after importing it into protected storage.
- Use a trusted, patched device and account for extensions, malware, clipboard managers, and screen captures.
- Rotate the key immediately if the private PEM is exposed.
The private key is not protected by a password envelope because Web Crypto exports the PKCS#8 bytes without one here. Protection begins only after the unencrypted output reaches the storage system you control.
Use RSA-OAEP for the right job
RSA-OAEP encrypts only a limited amount of data. Applications normally generate a random symmetric key, protect that key with RSA-OAEP, and use authenticated symmetric encryption for the actual data. Do not split a large file into raw RSA blocks. This generator creates keys and intentionally does not invent a hybrid file format.
- It does not create RSA-PSS signing keys.
- It does not create X.509 certificates, certificate signing requests, or certificate-authority workflows.
- It does not create SSH keys or JSON Web Keys.
- It is not a production TLS-provisioning workflow; prefer the key-management process supplied by the owning platform or hardware security module.
If another system later converts the PEM into a different format, it must preserve the algorithm parameters and keep the private key secret. The safest deployment remains the complete, tested workflow: generate once, distribute only the public key, transfer the private key directly into protected storage, and verify the exact application protocol.
If you're weighing options, Vigenere Cipher Decoder on Mac: Steps and Key Rules covers this in detail.
If you're weighing options, RSA Key Generator for Beginners: Your First Key Pair covers this in detail.