Skip to main content
Glama

CipherHUB Cryptography Toolkit

stream_cipher

Read-only

[symmetric_cipher] AEAD 流式加解密(认证加密)。 【算法】AES256GCM(key=32B) / ChaCha20Poly1305(key=32B) / SM4GCM(key=16B)。 【参数】

  • algorithm:算法名

  • process_type:Encrypt 或 Decrypt

  • input_data_in_hex:明文或密文 Hex(1B~16MB)

  • key_in_hex:密钥 Hex

  • nonce_in_hex:随机数 Hex(固定 12 字节 = 24 hex 字符)

  • associated_data_in_hex:可选附加认证数据(参与 MAC 但不加密) 【输出】output_data_in_hex、output_length、output_sha256、algorithm。 【注意】加密输出包含 16 字节 auth tag;解密失败(篡改检测)会报错。

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": "stream_cipher"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)AES256GCM
key_in_hexNo密钥的十六进制字符串。长度取决于算法:AES256=64 字符(32B),AES128/SM4=32 字符(16B)
nonce_in_hexNo随机数的十六进制字符串,固定 24 个 hex 字符(12 字节)
process_typeNo操作类型,可选值:Encrypt / DecryptEncrypt
input_data_in_hexNo输入数据的十六进制字符串(加密时为明文,解密时为密文,1B~16MB)
associated_data_in_hexNo附加认证数据的十六进制字符串(参与 MAC 计算但不加密,可选)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / algorithm / description
      Added value: +"密码算法名称(具体可选值因工具而异,见工具描述)"
    • addedInput schema / properties / algorithm / enum
      Added value: +[
      +  "AES256GCM",
      +  "ChaCha20Poly1305",
      +  "SM4GCM"
      +]
    • addedInput schema / properties / associated_data_in_hex / description
      Added value: +"附加认证数据的十六进制字符串(参与 MAC 计算但不加密,可选)"
    • addedInput schema / properties / input_data_in_hex / description
      Added value: +"输入数据的十六进制字符串(加密时为明文,解密时为密文,1B~16MB)"
    • addedInput schema / properties / key_in_hex / description
      Added value: +"密钥的十六进制字符串。长度取决于算法:AES256=64 字符(32B),AES128/SM4=32 字符(16B)"
    • addedInput schema / properties / nonce_in_hex / description
      Added value: +"随机数的十六进制字符串,固定 24 个 hex 字符(12 字节)"
    • addedInput schema / properties / process_type / description
      Added value: +"操作类型,可选值:Encrypt / Decrypt"
    • addedInput schema / properties / process_type / enum
      Added value: +[
      +  "Encrypt",
      +  "Decrypt"
      +]
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the sparse annotations (readOnlyHint=true, openWorldHint=false — consistent with a pure computation that has no server-side side effects), the description discloses that ciphertext output includes a 16-byte auth tag and that decryption fails with an error on tamper detection. It also bounds input size (1B~16MB) and pins the nonce to 12 bytes, which are real behavioral facts an agent cannot get from the annotations.

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 sections (algorithm / parameters / output / notes) front-load the essentials and are easy to scan. A fair amount of the parameter block duplicates the schema descriptions, which is the main thing keeping it from a 5.

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

Completeness4/5

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

There is no output schema, so the description carries the return-value burden and does name the four output fields (output_data_in_hex, output_length, output_sha256, algorithm) plus the auth-tag caveat. Combined with the error behavior and size limits, an agent has enough to call it correctly; only finer output details (encoding of the tag, exact error shape) are unstated.

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 already 100%, so the baseline is 3, but the description adds useful semantics: it maps key length to each concrete algorithm (AES256GCM/ChaCha20Poly1305=32B, SM4GCM=16B) — notably correcting the schema's mention of AES128, which is not an allowed enum value — and explains that associated data participates in the MAC but is not encrypted. That is meaning beyond restating field names.

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 operation family ('AEAD 流式加解密/认证加密') and enumerates the three supported algorithms with their key sizes, so an agent knows exactly what this tool computes. It stops short of explicitly contrasting itself with siblings such as block_cipher or ctr_cipher, so the boundary is inferable from the algorithm list rather than stated.

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

Usage Guidelines3/5

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

Usage is implied by the AEAD framing (use this when authenticated encryption with associated data is needed), and the parameter list makes the call pattern clear. However, there is no explicit when-to-use vs when-not guidance and no mention of alternatives like block_cipher or ctr_cipher for non-AEAD modes, leaving the selection decision to inference.

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.