Skip to content
Categories
RSA Key Pair Generator
Generate an RSA public/private key pair in PEM format.
Overview
- Generates an RSA public/private key pair on the spot using the browser's standard Web Crypto API, and outputs them in PEM format (Base64 with headers).
- You can choose "Encryption (RSA-OAEP)" or "Signing (RSASSA-PKCS1-v1_5)" depending on your intended use.
- The key length can be set to 2048 or 4096 bits.
Usage
- Select the usage (encryption or signing).
- Select the key length (2048 or 4096 bits).
- Click the "Generate key pair" button to see the public and private keys in PEM format.
Example
Input
Usage: Encryption, Key length: 2048 bits
Output
-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----
Use Cases
- Quickly preparing an RSA key pair for a development or test environment
- Checking whether an application's RSA encryption or signing feature works correctly with a standard key
- Learning what a PEM-format key looks like
FAQ
Can the generated key be used in production?
Technically yes, but without proper key generation, management, and revocation practices in place, we do not recommend using it in production. This tool is intended for development and testing.
Is the generated private key stored anywhere?
No. Key generation happens entirely in your browser using the Web Crypto API, and the key is lost when you leave or reload the page.
Why do encryption and signing need different keys?
RSA-OAEP (encryption) and RSASSA-PKCS1-v1_5 (signing) generate keys with different algorithm parameters, so you need to use a key generated for the corresponding use case.
Notes
- Generation may take a few seconds for larger key lengths, especially 4096 bits.
- Never share the private key with anyone else. If it is accidentally exposed, discard that key pair and generate a new one.
Related Tools
Encrypt and decrypt text with AES-GCM using a passphrase.
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hash values from text.
Generate a JWT from a header, payload, and secret.