RSA Key Generator

Generate RSA key pairs in the browser (PEM export).

Generating...
Public key will appear here
Private key will appear here

The definitive guide to RSA Key Pairs and Asymmetric Encryption

RSA (Rivest–Shamir–Adleman) is the grandfather of modern public-key cryptography. It is the mathematical foundation securing your SSH connections, HTTPS web browsing traffic, and digital software signatures. Our browser-based key generator securely creates robust 1024-bit to 4096-bit keypairs locally without ever transmitting your private credentials over the internet.

How Asymmetric Encryption Works

Unlike "symmetric" encryption (where the exact same password is used to both lock and unlock a file), RSA uses an elegantly linked pair of mathematically related keys.

The Public Key

Think of this as an open padlock lying on a table. You can give this key to anyone in the world (upload it to GitHub, put it on your website). Anyone can use it to encrypt a message meant for you, but they cannot use it to decrypt anything.

The Private Key

Think of this as the master key that opens the padlock. You must guard this with your life. It is the only thing in the universe capable of decrypting the messages that were scrambled using your Public Key.

Common Use Cases for RSA

  • SSHConnecting to Remote Linux Servers: Instead of typing a password, you put your Public Key inside the server's ~/.ssh/authorized_keys file. When you connect, the server challenges your SSH client to prove it holds the matching Private Key.
  • SSL/TLSHTTPS Websites: When you visit a bank website, your browser uses the bank's RSA Public Key (found in their SSL Certificate) to securely negotiate a session, ensuring local coffee shop hackers can't intercept your credit card data.
  • GPGPGP/GPG Email Encryption: Journalists and whistleblowers use RSA key pairs to guarantee that intercepted emails are completely unreadable to anyone except the intended recipient.

Which Key Size Should You Choose?

The "bit size" directly determines how mathematically complex the prime numbers used to generate the key are. Larger keys are exponentially harder to crack, but take longer to generate and slow down server handshakes.

1024-bit
Discontinued. Can be cracked by state-sponsored actors and massive botnets. Do not use for anything sensitive.
2048-bit
The Industry Standard. Currently considered completely unbreakable by modern supercomputers. The default for almost all standard web traffic and AWS SSH keys.
4096-bit
Maximum Paranoia. Heavy and slow, but offers "future-proof" security against hypothetical advancements in computing power over the next decade. Ideal for Root Certificate Authorities or GPG master keys.

Is this safe? How do I know you don't steal my Private Key?

Our generator uses the Web Crypto API framework (window.crypto.subtle.generateKey) to execute complex prime number mathematics locally within your RAM. The keys never leave your browser. We do not have a backend database, and there are absolutely no network requests made. If you are highly paranoid, you can disconnect your Wi-Fi, generate the keys, and close the tab before reconnecting.

What is an RSA Key Pair?

An RSA key pair is a set of two keys used in public-key cryptography. It consists of a public key and a private key. The public key can be shared with anyone, while the private key must be kept secret.

  • The public key is used to encrypt data or verify a digital signature.
  • The private key is used to decrypt data or create a digital signature.

How to use the RSA Key Generator?

Simply click the "Generate" button. The tool will generate a new 2048-bit RSA key pair. The keys are generated directly in your browser using the Web Crypto API. Your private key is never sent to any server.

Security and Usage

The generated keys are secure. This tool uses the `RSA-OAEP` scheme with `SHA-256` for hashing, which is a modern and secure standard for encryption. The 2048-bit key size is considered strong for most applications.

Important: Always keep your private key secret. Anyone with access to your private key can decrypt messages intended for you or sign messages as if they were you.

Common Use Cases

  • SSH Authentication: Use the public key to authenticate to a server without a password.
  • Data Encryption: Encrypt data with the public key, and only someone with the private key can decrypt it.
  • Digital Signatures: Sign data with your private key to prove its authenticity and integrity. Others can verify the signature using your public key.
  • JSON Web Tokens (JWT): Use RSA keys to sign and verify JWTs for secure API authentication.