Skip to main content
Glama

CipherHUB Cryptography Toolkit

ctr_cipher

[symmetric_cipher] [symmetric_cipher] CTR 计数器模式加解密(AES-256-CTR / SM4-CTR)。CTR 是把块密码转成密钥流的模式:加解密为同一操作(密钥流 XOR),无填充,密文长度与明文等长,任意长度输入(1B ~ 16MB)。algorithm 可选 AES256CTR(key 32B,cryptography 实现)或 SM4CTR(key 16B,GmSSL C 库实现,与 eet 的 sm4-ctr 同源)。iv_in_hex 为 16 字节初始计数器块(32 hex 字符),同 key/iv 下加解密互为逆操作。注意:CTR 不提供认证(无 MAC/tag)——需要防篡改时优先用 stream_cipher 的 AEAD 模式(AES-GCM/ChaCha20-Poly1305/SM4-GCM),CTR 仅适合已有独立认证层或互操作对数场景。返回字段:output_data_in_hex、output_length、output_sha256、algorithm。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)AES256CTR
iv_in_hexNo初始向量的十六进制字符串,固定 32 个 hex 字符(16 字节)
key_in_hexNo密钥的十六进制字符串。长度取决于算法:AES256=64 字符(32B),AES128/SM4=32 字符(16B)
input_data_in_hexNo输入数据的十六进制字符串(加密时为明文,解密时为密文,1B~16MB)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: encryption and decryption are the same XOR operation, there is no padding, ciphertext is the same length as plaintext, input range is 1B–16MB, and CTR provides no authentication. It also specifies the key-length requirements and the IV semantics, so the agent understands side effects and security limitations.

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 description is dense but every sentence contributes: mode semantics, key constraints, security caveat, and return fields. The only minor blemish is the duplicated leading tag '[symmetric_cipher] [symmetric_cipher]', which adds no value.

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?

Despite lacking an output schema, it lists the expected return fields (output_data_in_hex, output_length, output_sha256, algorithm) and covers all operational constraints needed to call the tool correctly. The security caveat and alternative-tool routing make the context complete for an agent.

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?

The schema already covers 100% of parameters, so the baseline is 3. The description adds meaningful beyond-schema detail by specifying exact key byte lengths, implementation origins (cryptography vs GmSSL, same source as eet sm4-ctr), and clarifying that iv_in_hex is the 16-byte initial counter block.

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

Purpose5/5

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

The description immediately states it performs CTR-mode encryption/decryption for AES-256-CTR and SM4-CTR, making the operation and scope explicit. It also distinguishes itself from stream_cipher's AEAD modes by naming them as the alternative when tamper resistance is required.

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

Usage Guidelines5/5

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

It gives explicit guidance: use stream_cipher's AEAD modes when tamper resistance is needed, and use CTR only when there is already an independent authentication layer or an interoperability scenario. This clearly tells an agent when to select this tool versus its siblings.

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.

TDQS

A3.9/5.0
Disambiguation4/5

Most tools target a distinct algorithm+operation pair (e.g., rsa_sign vs sm2_sign vs ml_dsa_sign), and descriptions are detailed. However, block_cipher and stream_cipher both perform symmetric encryption, and ecc_key_exchange and hybrid_kex overlap as key exchange, requiring careful reading to distinguish.

Naming Consistency3/5

Naming is inconsistent across algorithm families: key generation mixes generate_ecc/generate_rsa with ml_dsa_keygen/ml_kem_keygen, and encryption mixes rsa_encryption/sm2_encryption with block_cipher/stream_cipher. Within each family (e.g., rsa_sign/rsa_verify, ml_dsa_sign/ml_dsa_verify), names are predictable, but the overall pattern is not uniform.

Tool Count2/5

32 tools is far above the typical 3-15 range for a well-scoped server. While every tool has a distinct function, the large surface makes the set heavy and harder to navigate, especially with multiple algorithm families and niche utilities.

Completeness5/5

The toolkit gives comprehensive coverage: key generation, encryption/decryption, signing/verification for RSA, ECC, SM2, ML-DSA, ML-KEM, plus symmetric ciphers, hashing, and key exchange. Full workflows are supported with no dead ends, and even helper tools for debugging are included.