> rsa | key | generator <
Generate RSA public/private key pairs in PEM format with 2048, 3072 or 4096 bits. Keys are created in your browser and never uploaded.
—
Keys are generated by your browser and never leave this page. For production systems or long-lived secrets, generate keys on a trusted machine with openssl or your HSM.
PKCS#8 & PKCS#1
Switch between modern PKCS#8/SPKI PEM and legacy PKCS#1 "RSA PRIVATE KEY" output with one click.
Web Crypto Secure
Uses the browser's native Web Crypto API and secure random generator. No keys are sent over the network.
Fingerprint
Shows the SHA-256 fingerprint of the public key so you can compare and track key pairs.
// RSA TECHNICAL INFO
How It Works:
RSA picks two large random primes p and q, publishes n = p x q and a public exponent e (65537), and keeps the private exponent d. Anyone can encrypt or verify with (n, e), but only the holder of d can decrypt or sign. Security rests on the difficulty of factoring n.
Example:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... -----END PUBLIC KEY-----
Why Use This Tool:
- >Create test keys for JWT RS256 or signature code
- >Get PEM in either PKCS#8 or PKCS#1 form without openssl
- >Prepare keys for TLS, SSH or encryption experiments
- >See how key size affects PEM length
>> frequently asked questions
Q: How do I generate an RSA key pair online?
A: Choose a key size (2048, 3072 or 4096 bit) and an output format, then click generate. A new public/private key pair appears in PEM format, ready to copy or download.
Q: Is it safe to generate keys in the browser?
A: The keys are created by the Web Crypto API using your browser's cryptographically secure random number generator and are never sent anywhere. Still, for production secrets use a trusted machine, openssl or an HSM, because any web page - including this one - runs in an environment you cannot fully audit.
Q: Which RSA key size should I use?
A: 2048 bit is the common minimum and is considered secure through about 2030. 3072 bit is recommended by NIST for protection beyond that, and 4096 bit gives extra margin at the cost of slower generation and operations.
Q: What is the difference between PKCS#1 and PKCS#8?
A: PKCS#1 ("BEGIN RSA PRIVATE KEY") stores only RSA numbers. PKCS#8 ("BEGIN PRIVATE KEY") wraps any algorithm's key with an algorithm identifier and is the modern default. Public keys use "BEGIN RSA PUBLIC KEY" for PKCS#1 and SPKI ("BEGIN PUBLIC KEY") for the generic form.
Q: What is the public exponent?
A: The tool uses 65537 (0x010001), the standard value used by openssl, ssh-keygen and nearly all software.
Q: What is the fingerprint?
A: It is the SHA-256 hash of the DER-encoded public key (SPKI), shown as colon-separated hex. Comparing fingerprints is a quick way to check two parties hold the same public key.
Q: Can I use these keys for SSH or JWT?
A: Yes for JWT (RS256 uses RSA with SHA-256) and for PEM-based tools. For SSH you need the OpenSSH public key format, which you can derive from the PEM with ssh-keygen -i -m PKCS8 -f key.pub.
// OTHER LANGUAGES
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Import generated PKCS8/SPKI and PKCS1 keys into Node and sign/verify a message.
- Comparison reference
- Node.js crypto key parsing, signing and verification.
- Verification scope
- This checks format and interoperability, not randomness or deployment security.
Test source and cases (select a file to read it)
-
legacy-reliability.test.js
- RSA: generated PKCS8/SPKI and PKCS1 keys import and sign/verify with Node crypto
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.