Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm2_decryption

[sm2] SM2 私钥解密。 【参数】

  • sm2_private_key_in_pem:PEM 格式私钥

  • cipher_data_in_hex:密文 Hex

  • cipher_format:必须指定 C1C3C2_ASN1 / C1C2C3_ASN1 / C1C3C2 / C1C2C3

  • sm2_private_key_password:若私钥加密则传入 【输出】plain_data_in_hex、plain_length。 【注意】cipher_format 必须与加密时的格式对应,否则解密失败。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cipher_formatNoSM2 密文编码格式,可选值:C1C3C2_ASN1 / C1C2C3_ASN1 / C1C3C2 / C1C2C3
cipher_data_in_hexNo密文的十六进制字符串
sm2_private_key_in_pemNoSM2 加密私钥的 PEM 文本(含 BEGIN/END ENCRYPTED PRIVATE KEY 头尾)
sm2_private_key_passwordNoSM2 私钥的加密密码(原始字符串,非编码格式)

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states the output fields (plain_data_in_hex, plain_length) and warns that a mismatch in cipher_format leads to failure. It also covers the condition for providing a password, which is useful behavioral context beyond a bare function signature.

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

Conciseness5/5

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

The description is highly structured with sections for parameters, output, and notes. It is concise, with no wasted words, and front-loads the purpose. Each line serves a distinct function, making it easy to scan.

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?

For a cryptographic tool with 4 parameters and no output schema, the description covers the essential aspects: purpose, parameter formats, output fields, and a critical failure condition. It is sufficient for an AI agent to invoke the tool correctly.

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. The description adds value by emphasizing that cipher_format is mandatory ('必须指定'), clarifying that the key is in PEM format, and explaining when the password is required. These details go beyond the schema descriptions.

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 clearly states 'SM2 私钥解密' (SM2 private key decryption), specifying the exact operation and resource. It distinguishes from siblings like sm2_encryption and sm2_sign by focusing on decryption with private key.

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?

Provides clear usage context: cipher_format must be specified and must match the encryption format, otherwise decryption fails. It also notes when the private key password is needed. However, it does not explicitly mention alternatives like sm2_encryption for the reverse operation, so it lacks explicit exclusions.

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.