Skip to main content
Glama

CipherHUB Cryptography Toolkit

rsa_encryption

Read-only

[rsa] RSA 公钥加密。 【参数】

  • rsa_public_key_in_pem:PEM 格式公钥

  • plain_data_in_hex:明文 Hex

  • rsa_padding_mode:RSAES_PKCS1_V1_5 / RSAES_OAEP_SHA_1 / RSAES_OAEP_SHA_224 / RSAES_OAEP_SHA_256 / RSAES_OAEP_SHA_384 / RSAES_OAEP_SHA_512 【明文长度限制】受 key_size 和 padding 约束:PKCS1v1.5 上限 = 模长字节 − 11;OAEP 上限 = 模长字节 − 2×哈希输出 − 2(RSA-4096 + OAEP-SHA256 = 446 字节,OAEP-SHA512 = 382 字节)。 【输出】cipher_data_in_hex、cipher_length。 【安全建议】推荐使用 OAEP 而非 PKCS1v1.5。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "rsa_encryption"
  }
}

Input Schema

NameRequiredDescriptionDefault
rsa_padding_modeNoRSA 加密填充模式,可选值:RSAES_PKCS1_V1_5 / RSAES_OAEP_SHA_1 / RSAES_OAEP_SHA_224 / RSAES_OAEP_SHA_256 / RSAES_OAEP_SHA_384 / RSAES_OAEP_SHA_512
plain_data_in_hexNo明文的十六进制字符串
rsa_public_key_in_pemNoRSA 公钥的 PEM 文本(含 BEGIN/END 头尾的 Base64 编码文本)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / plain_data_in_hex / description
      Added value: +"明文的十六进制字符串"
    • addedInput schema / properties / rsa_padding_mode / description
      Added value: +"RSA 加密填充模式,可选值:RSAES_PKCS1_V1_5 / RSAES_OAEP_SHA_1 / RSAES_OAEP_SHA_224 / RSAES_OAEP_SHA_256 / RSAES_OAEP_SHA_384 / RSAES_OAEP_SHA_512"
    • addedInput schema / properties / rsa_padding_mode / enum
      Added value: +[
      +  "RSAES_PKCS1_V1_5",
      +  "RSAES_OAEP_SHA_1",
      +  "RSAES_OAEP_SHA_224",
      +  "RSAES_OAEP_SHA_256",
      +  "RSAES_OAEP_SHA_384",
      +  "RSAES_OAEP_SHA_512"
      +]
    • addedInput schema / properties / rsa_public_key_in_pem / description
      Added value: +"RSA 公钥的 PEM 文本(含 BEGIN/END 头尾的 Base64 编码文本)"
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare this a side-effect-free local computation (readOnlyHint=true, openWorldHint=false), so the description only needs to add mechanics — and it does: it documents the failure boundary (plaintext length vs. key size/padding) and the returned artifacts (cipher_data_in_hex, cipher_length). It does not mention determinism or whether ciphertext differs across calls, which would be useful for PKCS1v1.5 vs OAEP expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The bracketed section headers (参数 / 明文长度限制 / 输出 / 安全建议) make it scannable and front-loaded. The parameter list restates schema descriptions verbatim, which is mild duplication, but the constraint and security sections earn their space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by naming both return fields; with a pure computation tool it covers inputs, outputs, hard limits, and a security default. An agent can call this correctly without opening the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description goes beyond the schema by tying rsa_padding_mode to a concrete security preference and by translating key_size/padding into a plaintext-size limit that the schema never expresses. That added meaning is exactly what an agent needs before choosing a padding mode.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('RSA 公钥加密'), and the '[rsa]' prefix plus the word '加密' clearly separates it from the RSA signing/verification siblings and from sm2_encryption/sm9_encryption. It never explicitly says which sibling to prefer, but the operation itself is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Guidance is concrete and operational: it recommends OAEP over PKCS1v1.5 and spells out the maximum plaintext length per padding family, including worked examples (RSA-4096 + OAEP-SHA256 = 446 bytes, OAEP-SHA512 = 382 bytes). What is missing is explicit routing ('use rsa_decryption to reverse this'), so it stops just short of full when-to-use coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.