RSA Key Generator & Encryption
Generate RSA keys, encrypt with public keys, and verify signatures
Generate RSA Key Pair
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.
RSA Private Key Decryption
Public Key Decrypt (Signature Verify)
RSA "decrypt with public key" usually means verifying a signature. Sign with a private key, then verify with a public key.
Sign message (private key)
Verify signature (public key decrypt)
Related Tasks
- Use the SHA256 Hash Tool to hash large inputs before signing.
- Generate a secure passphrase with the Password Generator.
This RSA tool helps you generate RSA keys online, encrypt with a public key, decrypt with a private key, and verify signatures (sometimes described as RSA public key decrypt). It is designed for debugging, testing APIs, and validating cryptography workflows.
- 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.
RSA public key decrypt usually means verifying a signature. A sender signs a message with a private key. Anyone with the public key can verify the signature and confirm the message is authentic and unchanged.
- 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.
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 base64Decrypt 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:sha256Sign and verify (RSA-PKCS1 v1.5)
# Mac / Linux (sign)
echo -n "hello" | openssl dgst -sha256 -sign private.pem | base64
# Mac / Linux (verify)
echo -n "hello" | openssl dgst -sha256 -verify public.pem -signature signature.bin
# Windows PowerShell (sign)
"hello" | openssl dgst -sha256 -sign private.pem | openssl base64
# Windows PowerShell (verify)
"hello" | openssl dgst -sha256 -verify public.pem -signature signature.binOn 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.