No recently used tools
No favorite tools yet

RSA Encryption: Generate Keys & Encrypt Online | Free Tool

667 uses

Public Key

Private Key

RSA Encryption Tips

RSA-2048 Key Generation
Generate secure RSA-2048 key pairs (public + private) using the browser Web Crypto API.
Asymmetric Encryption
Encrypt with the public key, decrypt with the private key. Perfect for secure message exchange.
Browser-Based Crypto
Uses the Web Crypto API — all key generation and encryption happens locally in your browser.
Size Limitation
RSA-2048 can encrypt up to ~190 bytes of data. For larger data, use AES with an RSA-encrypted key.

Frequently Asked Questions

Q Can I use RSA keys generated in this tool for SSH logins?
A You can, but you'll need to convert the private key format first. This tool outputs PEM keys, while SSH expects OpenSSH's proprietary format. Drop your private key into a text file, then run 'ssh-keygen -p -m PEM -f keyfile' to convert it. The public key also needs converting — use 'ssh-keygen -i -f pubkey.pub'. Without these steps, SSH simply won't accept the keys. A quick test: generate a key pair here, convert it, and try connecting to a test server before using it anywhere critical.
Q Does generating RSA keys in a browser mean they're truly random?
A Yes, but only if your browser's crypto API works correctly. This tool relies on the Web Crypto API, which pulls entropy from your OS — things like mouse movements and keystroke timing. The real concern isn't randomness, it's the environment. If you're on a compromised machine with keyloggers or malware, the keys are compromised too. A safer approach: generate keys on an air-gapped device, then transfer the public key via USB.
Q Can I reuse the same RSA key pair for multiple encryption sessions?
A Technically yes, and many developers do exactly that. Each session generates fresh ciphertext due to OAEP's random padding, so reuse won't leak patterns. But there's a risk: if an attacker ever gets your private key, all past sessions are compromised. Rotate keys every 90 days for sensitive work. The tool doesn't enforce this — that's your job. A practical habit: generate a new pair monthly for API authentication, archive the old one.
Q Why does encrypting the same message twice give different results?
A That's OAEP padding at work. It adds random bytes before encryption, so the same plaintext produces unique ciphertext each time. This prevents attackers from spotting patterns in your encrypted data - a vulnerability that plagued older schemes like PKCS#1v1.5. Try it yourself: encrypt 'hello', then encrypt 'hello' again. Two completely different outputs, but both decrypt back to the same message. Just remember you can't search or compare encrypted values using this tool.
Q Why does the private key look so long compared to the public key?
A That's not a bug — it's the math working as intended. The public key contains just the modulus and exponent (n and e), roughly 270 characters in PEM form. The private key packs in both primes, the modulus, the private exponent, and several pre-computed values for faster decryption. All of that adds up to about 1,700 characters for RSA-2048. If you ever see a private key that's suspiciously short, it's probably not a real RSA key. A quick sanity check: paste both into a text editor and count the character lengths — the private key should be roughly six times longer.
Q Can I encrypt a file, or only plain text?
A Only plain text up to about 190 bytes per encryption round with RSA-2048. That's roughly 190 characters. For longer content, you'd need a hybrid approach: encrypt the file with a symmetric cipher like AES, then encrypt that AES key with this tool's RSA public key. You won't paste a PDF directly into the message box. A practical workaround: base64-encode smaller files, but that shrinks your already-tight limit even further.
Q Is it safe to encrypt passwords with RSA for storage?
A Not really, and here's why: RSA is asymmetric, so if your app gets breached, the private key sitting on the server becomes the single point of failure. For password storage, you want a one-way hash like bcrypt or Argon2, not encryption you can reverse. This tool does let you encrypt a password for transit, but don't use it as a vault. A better pattern: use RSA here to wrap a symmetric key, then store that wrapped key—and still hash the password separately with a slow KDF.
Q Will clearing my browser cache delete my generated RSA keys?
A Yes, closing the tab or clearing local storage wipes your keys instantly. This tool doesn't save anything to a server, meaning persistence is entirely up to you. Copy your private key and save it as a .pem file immediately after generation. If you accidentally close the browser, you'll need to generate a fresh pair from scratch.
Q Can I share the private key with my team members?
A Sharing your private key completely defeats the purpose of asymmetric encryption. Anyone holding that private key can decrypt your messages and impersonate you online. Keep the private key locked in your local machine and only distribute the public key to colleagues. If multiple people need to send you confidential data, give them your public PEM file. Never email the private key, even inside a password-protected zip file.
Q What happens if I lose my private key after encrypting a file?
A You permanently lose access to any data encrypted with its matching public key. Mathematics guarantees that decryption is impossible without those specific prime factors. Always back up your generated PEM files to an external drive immediately. Forgetting this step locked out many developers during internal testing phases. Make sure to store a secure copy before closing this browser tab.

How to Use RSA Encryption

Related Tools