Elysia Tools Docs
EN
Language
ZHESPTRUFRDEEN
Back to site
Browse tools

Security

RSA Encrypt / Decrypt

Encrypt text with an RSA public key or decrypt ciphertext with the matching private key, using OAEP padding (SHA-1 or SHA-256). Handles long messages by chunking. Keys and data stay local. PKCS#1 v1.5 is intentionally not offered (Node disables it for decryption due to Bleichenbacher attacks).

html· HTML resultOpen tool

Quick start

Call this tool from your code in three languages.

cURL
curl -X POST 'https://api.elysiatools.com/en/api/tools/rsa-encrypt-decrypt' \
  -H 'Content-Type: application/json' \
  -d '{"mode":"encrypt","publicKey":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwWF6fs85MGuVStFAWF1F\ns/mKPXptWGW1zHSHr4xCDARhbkc0X5qYF0Eg/pyRNXY9hV9IP6YnMUKw1d1rYuyK\nq6xj4xMjU5FWUdd5ZV8r2LfHmUN5agLFcXiK2HR/OlyK6POeXWYaUoahBe1NqIvS\nr30UDL1IEgs4hPRUgYJYlFGGxsLl7P0uF0Tjsu93o4+Jey9XRhKWXdwB5m7RxlER\nKgr6LCARfodZYWjA7nM/r6L9Xy2sHPW9bFLe/1mfa9hrMMAVpAsHxsAJsTlmdnhs\ns6otGp3ietGmshROOv2K12JlloAeZD3jTi8xIp7K7VRlbypGl1lqZ1h+g6BVIN2t\nSQIDAQAB\n-----END PUBLIC KEY-----\n","privateKey":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----","passphrase":"Only if the private key is passphrase-protected…","message":"Hello, RSA!","ciphertext":"Paste the ciphertext produced by this tool…","oaepHash":"sha256","encoding":"hex"}'

© 2026 Elysia Tools. Developer documentation.

Back to siteBrowse tools

API reference

Send a POST request with your inputs as JSON. File parameters require a separate upload first.

Endpoint

HTTP
POST https://api.elysiatools.com/en/api/tools/rsa-encrypt-decrypt

Parameters

NameTypeRequiredDescription
modeselectNo—
publicKeytextareaNo—
privateKeytextareaNo—
passphrasetextNo—
messagetextareaNo—
ciphertexttextareaNo—
oaepHashselectNo—
encodingselectNo—

Response format

HTML result

JSON
{
  "result": "<div>Processed HTML content</div>",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}

MCP integration

Add this tool to your Model Context Protocol server so AI agents can list and call it.

Server configuration

Add this block to your MCP client configuration:

mcp.json
{
  "mcpServers": {
    "elysiatools-rsa-encrypt-decrypt": {
      "name": "rsa-encrypt-decrypt",
      "description": "Encrypt text with an RSA public key or decrypt ciphertext with the matching private key, using OAEP padding (SHA-1 or SHA-256). Handles long messages by chunking. Keys and data stay local. PKCS#1 v1.5 is intentionally not offered (Node disables it for decryption due to Bleichenbacher attacks).",
      "baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=rsa-encrypt-decrypt",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

List available tools

After connecting to the SSE endpoint, list the exposed tools:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Call this tool

Invoke the tool by its id, passing arguments built from its parameters:

tools/call
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "rsa-encrypt-decrypt",
    "arguments": {
  "mode": "encrypt",
  "publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwWF6fs85MGuVStFAWF1F\ns/mKPXptWGW1zHSHr4xCDARhbkc0X5qYF0Eg/pyRNXY9hV9IP6YnMUKw1d1rYuyK\nq6xj4xMjU5FWUdd5ZV8r2LfHmUN5agLFcXiK2HR/OlyK6POeXWYaUoahBe1NqIvS\nr30UDL1IEgs4hPRUgYJYlFGGxsLl7P0uF0Tjsu93o4+Jey9XRhKWXdwB5m7RxlER\nKgr6LCARfodZYWjA7nM/r6L9Xy2sHPW9bFLe/1mfa9hrMMAVpAsHxsAJsTlmdnhs\ns6otGp3ietGmshROOv2K12JlloAeZD3jTi8xIp7K7VRlbypGl1lqZ1h+g6BVIN2t\nSQIDAQAB\n-----END PUBLIC KEY-----\n",
  "privateKey": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
  "passphrase": "Only if the private key is passphrase-protected…",
  "message": "Hello, RSA!",
  "ciphertext": "Paste the ciphertext produced by this tool…",
  "oaepHash": "sha256",
  "encoding": "hex"
}
  }
}
Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).

Questions or issues? Contact [email protected]

Browse tools
Open tool