b2KIT

RSA Encrypt / Decrypt Tool

Encrypt short messages with an RSA public key and decrypt with the private key using OAEP padding.

Tested tool guide Tested browser tools Checked August 16, 2026

What RSA Encrypt / Decrypt Tool does and how it behaves

RSA is asymmetric: the public key encrypts, the private key decrypts, and the two come as a matched pair. This tool applies OAEP padding from PKCS#1, the standard scheme for encrypting small payloads, and works on keys pasted into the page. The surprise most people hit first is the payload ceiling: a 2048-bit key carries at most 190 bytes of message with SHA-256 (214 with SHA-1), so a paragraph, let alone a file, will not fit - which is why the tool is short-message only. Expect the output to be a single base64 block, different on every run even for identical input.

How the result is produced

1

OAEP is randomized and self-checking

Before the RSA exponentiation, OAEP mixes the message with a fresh random seed, so encrypting the same text twice never yields the same ciphertext - by design, not a fault. On decryption, OAEP verifies the padding structure; if the wrong key or an edited ciphertext is supplied, the operation fails outright rather than returning corrupted-looking text. You cannot tell a wrong key from a damaged message by the error alone.

2

Capacity is set by key size

OAEP ciphertext is always exactly as long as the key: 256 bytes for 2048 bits, 512 bytes for 4096. The message budget is the key length minus two hash outputs and two bytes of overhead - 190 bytes with a 2048-bit key and SHA-256, 214 with SHA-1, and 446 with a 4096-bit key and SHA-256. Longer input is rejected before encryption begins, so the tool is limited to short messages.

Good uses

  • Send a token or password to someone whose public key you have: you encrypt with their public key, and only their private key can read it.
  • Round-trip test a key pair: encrypt a test phrase with the public key, decrypt with the private key; a clean result confirms the keys actually belong together before you trust them for real traffic.
  • Read a message someone encrypted to you: paste your private key and their base64 ciphertext and recover the original text; if decryption fails, the ciphertext does not match your key or was altered in transit.

Limits and checks

  • The tool refuses oversized input: a 2048-bit key with SHA-256 accepts at most 190 bytes of message. Long text, documents, and encoded blobs do not fit; use hybrid encryption - a random symmetric key for the data, RSA for that key - instead.
  • Key format mistakes are the most common import failure: 'BEGIN PUBLIC KEY' (SPKI) and 'BEGIN RSA PUBLIC KEY' (PKCS#1) are different wrappers, as are 'BEGIN PRIVATE KEY' (PKCS#8) and 'BEGIN RSA PRIVATE KEY'. The whole PEM block, headers and footer included, must be pasted intact; if your key is buried inside a certificate, extract it first.
  • You are pasting a private key into a web page. The computation runs locally and nothing is uploaded, but the page, browser extensions, and anyone at your screen can see what you paste. Use freshly generated test keys for experiments; never paste a production private key.

Common questions

Can I encrypt a file or a long message with this?

No - RSA-OAEP capacity is fixed by the key size, about 190 bytes for a 2048-bit key with SHA-256, and longer input is rejected. RSA is designed to carry small secrets; large data is normally encrypted with a symmetric cipher like AES using a fresh random key, and only that key is RSA-encrypted - so-called hybrid encryption.

Is it safe to paste my real private key into this page?

The encryption and decryption run locally in the browser and nothing is uploaded - but anything the page itself runs can see what you paste, and so can extensions, screenshots, or people watching your screen. For tests and experiments, generate a throwaway key pair; reserve your production private key for software you trust, and never share it with anyone.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools