RSA Encryption

This online tool helps you encrypt messages using RSA. It supports PKCS#1 and OAEP with various hash algorithms. Read more

Encrypt a short message with RSA

RSA encryption uses the recipient’s public key to produce ciphertext that the corresponding private key can decrypt. This tool supports PKCS#1 v1.5 and OAEP with SHA-1, SHA-224, SHA-256, or SHA-384, plus selectable input and ciphertext encodings.

RSA is intended for short values such as symmetric keys, not large files or arbitrary long messages. Real systems normally use hybrid encryption: RSA protects a randomly generated content-encryption key, while an authenticated symmetric cipher protects the data.

How to encrypt with RSA

  1. Enter the message and select its byte encoding.
  2. Paste the recipient’s trusted RSA public key.
  3. Select the exact padding and OAEP hash expected by the recipient.
  4. Encrypt and transmit the ciphertext using the selected Hex or Base64 representation.

Message-size limits depend on the modulus and padding. OAEP allows at most k - 2hLen - 2 bytes, where k is the modulus length in bytes and hLen is the hash output length.

Choose compatible padding

RFC 8017 requires RSAES-OAEP support for new applications and retains RSAES-PKCS1-v1_5 for compatibility. Both sides must agree on padding, hash, key, and byte encoding.

The menu label ECB is a library naming convention; RSA is not a block cipher operating in ECB mode.

RSA encryption FAQ

Why is my message too long?

RSA padding consumes part of the modulus capacity. Encrypt a short symmetric key and use an authenticated symmetric scheme for the actual message.

Can the private key encrypt a message?

Private-key signature operations are not a substitute for public-key encryption. Use the dedicated signing tool when authenticity is required.

How do I decrypt the result?

Use RSA Decryption with the matching private key, padding, hash, and ciphertext encoding.

Input
Output
Share Link
Settings