Encrypt Online
Theme

RSA Key Generator & Encryption

Generate RSA keys, encrypt with public keys, and verify signatures

Safety note: Keys are generated. Keep private keys secure and never share them publicly.
RSA key generation + encryptionGenerate keys, encrypt with a public key, and verify signatures

Generate RSA Key Pair

Use encryption keys for RSA-OAEP. Use signing keys for the separate sign-and-verify workflow.
Keys are generated. Save them before leaving this page.

RSA Public Key Encryption

Encrypt small messages with a public key (RSA-OAEP). For large data, encrypt a short key with RSA and use it to encrypt the file.

Maximum message size for this key: 190 bytes (RSA-OAEP with SHA-256).

RSA Private Key Decryption

Sign and verify

Signature verification is sometimes mislabeled "public key decrypt," but it is a distinct operation. Sign with the private key, then verify the message and signature with the public key.

Sign message (private key)

Verify signature

Related Tasks

RSA Encryption Online and Key Generation

This RSA tool helps you generate RSA keys online, encrypt with a public key, decrypt with a private key, and sign or verify messages. It is designed for debugging, testing APIs, and validating cryptography workflows.

Common Uses
  • Generate RSA keys for local testing and development.
  • Encrypt a short secret or token with a public key.
  • Decrypt an RSA payload with a private key.
  • Verify signatures when a system "encrypts" with a private key.
Why Signature Verification Is Not Decryption

"Public key decrypt" is a misleading name sometimes used for signature verification. A sender signs with a private key; a verifier uses the public key to check the signature over the exact message. The operation does not reveal encrypted plaintext.

Validation Tips for Developers
  • Compare results with OpenSSL using the same padding and hash (RSA-OAEP with SHA-256 or PKCS1 v1.5 signing).
  • Make sure the payload, headers, and exact whitespace match what you are signing or encrypting.
  • Use known test vectors before wiring the tool into production workflows.
OpenSSL Examples

Use OpenSSL to verify that keys, encryption, and signatures match what this tool produces. The commands below assume you have a PEM public key in public.pem and a private key in private.pem.

Encrypt with a public key (RSA-OAEP)

# Mac / Linux
echo -n "hello" | openssl pkeyutl -encrypt -pubin -inkey public.pem -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 | base64 # Windows PowerShell
"hello" | openssl pkeyutl -encrypt -pubin -inkey public.pem -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 | openssl base64

Decrypt with a private key (RSA-OAEP)

# Mac / Linux
base64 -d encrypted.txt | openssl pkeyutl -decrypt -inkey private.pem -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 # Windows PowerShell
Get-Content encrypted.txt | openssl base64 -d | openssl pkeyutl -decrypt -inkey private.pem -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256

Sign and verify (RSA-PKCS1 v1.5)

# Create the exact message bytes
printf '%s' 'hello' > message.txt # Sign to a binary signature file
openssl dgst -sha256 -sign private.pem -out signature.bin message.txt # Verify the same bytes with the public key
openssl dgst -sha256 -verify public.pem -signature signature.bin message.txt

On Windows, the OpenSSL executable is often available through Git for Windows or the OpenSSL installer. Make sure line endings match the exact message you sign or encrypt.

Helpful References