RSA Key Generator

Generate an RSA public and private key pair, 2048, 3072 or 4096 bits, as PEM files that OpenSSL, Java, Node.js, Python, PHP and Go read directly. Choose whether the key is for signing (RS256 or PS256) or encryption (OAEP), then copy or download the keys, or switch to JWK or OpenSSH. Keys are made by your browser's Web Crypto API and never leave your device.

Helps you tell keys apart in GitHub or authorized_keys.

Key generation runs in your browser. What you type never leaves this device.

Features

  • 2048, 3072 or 4096-bit RSA keys with public exponent 65537

  • For signing with PKCS#1 v1.5 (RS256) or PSS (PS256), or for OAEP encryption

  • Public key as PEM SPKI (BEGIN PUBLIC KEY)

  • Private key as PEM PKCS#8 (BEGIN PRIVATE KEY)

  • JWK and OpenSSH formats from the same key

  • Runs in your browser: no upload, nothing stored

What RSA keys are used for

RS256 JWT signing

Sign tokens with the private key and publish the public key (or its JWK) so other services can verify them.

Payment and banking APIs

Several Indian payment, banking and government APIs ask you to upload an RSA public key to verify your signed requests or to encrypt data for you. Check the size and format they ask for.

Encrypting small secrets

With OAEP, encrypt a short value, such as an AES key, with someone's public key.

Testing

Make throwaway keys for a test environment or a unit test.

Sizes, formats and conversions

Which size?

  • 2048 bits: the minimum still considered safe, and what many APIs ask for.
  • 3072 bits: recommended for keys meant to last beyond 2030.
  • 4096 bits: larger margin, but slower signing and a few seconds to generate in the browser.

PEM forms

BEGIN PUBLIC KEY (SPKI) and BEGIN PRIVATE KEY (PKCS#8) are the standard forms today. If a system asks for the older PKCS#1 form (BEGIN RSA PRIVATE KEY), convert with openssl pkey -in private.pem -traditional -out rsa-private.pem; for the public key, openssl rsa -pubin -in public.pem -RSAPublicKey_out.

Signing or encryption

Web Crypto ties each key to one use. Pick Signing for JWTs and request signatures, and Encryption (OAEP) only when a partner asks you to encrypt with RSA. The key material is the same RSA key either way, so other software can use it for both, but keeping separate keys for signing and encryption is good practice.

Keep the private key safe

The private key is not password-protected. Add a passphrase with openssl pkey -in private.pem -aes256 -out private-enc.pem, or store it in your secrets manager. Never email it or commit it to Git.

RSA Key Generator - FAQ