Skip to main content
Glama

CipherHUB Cryptography Toolkit

key_derivation

[kdf] 执行密钥派生(KDF),从高熵秘密或口令派生对称密钥材料。 【支持算法】

  • HKDF(默认):RFC 5869 extract-then-expand,底层哈希 Sha256(默认)/ Sha384 / Sha512

  • Sm3Kdf:GB/T 32918 密钥派生,SM3(Z ∥ be32(ct)),ct 从 1 起,适合对 SM2 ECDH 共享秘密派生密钥

  • Pbkdf2Sm3:RFC 8018 PBKDF2,PRF 为 HMAC-SM3,用于口令拉伸 【参数】(按算法适用,错配会被拒)

  • algorithm:HKDF / Sm3Kdf / Pbkdf2Sm3,默认 HKDF

  • hash_algorithm:仅 HKDF,默认 Sha256

  • input_in_hex:HKDF 的 IKM / Sm3Kdf 的共享秘密 Z,Hex(1B~16MB),与 password 二选一

  • password:仅 Pbkdf2Sm3,口令原文 utf-8(1~1024B)

  • salt_in_hex:HKDF/Pbkdf2Sm3 可选盐 Hex(≤256B)。HKDF 空=未提供(RFC 5869 补 HashLen 零);Pbkdf2Sm3 空=服务端生成 16B 随机盐并在响应回显

  • info_in_hex:仅 HKDF,可选上下文信息 Hex(≤256B)

  • iterations:仅 Pbkdf2Sm3,10000~4000000(默认 10000;受 8s 网关约束,eet CLI 上限为 16777216,互通测试建议取 ≤100 万区间)

  • derived_key_length:派生长度,16~1024B(默认 32;Pbkdf2Sm3 上限 256B) 【输出】derived_key_in_hex、derived_key_in_base64、salt_used_in_hex(实际使用的盐,Pbkdf2Sm3 未提供盐时回显服务端随机盐)、salt_generated、algorithm、hash_algorithm、iterations、derived_key_length、input_bytes。 【典型用途】ECDH 共享秘密到会话密钥的收口、口令到加密密钥的拉伸、多上下文密钥隔离(HKDF info)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
passwordNo密码(原始字符串,非编码格式;私钥工具为私钥加密密码,KDF Pbkdf2Sm3 为待拉伸口令)
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)HKDF
iterationsNoPBKDF2 迭代次数(整数;KDF Pbkdf2Sm3 范围 10000~4000000,默认 10000)
info_in_hexNoHKDF 上下文信息的十六进制字符串(可选,≤256B)
salt_in_hexNo盐的十六进制字符串(KDF,可选 ≤256B;Pbkdf2Sm3 留空则服务端生成 16B 随机盐并回显)
input_in_hexNo输入秘密的十六进制字符串(KDF:HKDF 的 IKM / Sm3Kdf 的共享秘密 Z,1B~16MB)
hash_algorithmNo哈希算法名称,可选值:Sha1 / Sha224 / Sha256 / Sha384 / Sha512(ECC 不支持 Sm3)Sha256
derived_key_lengthNoHKDF/KDF 派生密钥长度(整数,16~1024 字节;KDF Pbkdf2Sm3 上限 256)

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?

无任何 annotations,描述承载了全部行为披露责任。它详细说明了 HKDF 的 extract-then-expand 过程、Pbkdf2Sm3 空盐时服务端生成随机盐并在响应回显、RFC 5869 空盐补零行为、iterations 受 8s 网关约束、输出字段等。行为透明度和副作用说明远超一般工具描述。

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?

描述结构清晰:先一句话概述目的,再用“【支持算法】【参数】【输出】【典型用途】”分节。内容密度高但每一条都有具体指导价值,没有任何冗余空话。虽长度可观,但鉴于工具本身涉及三种算法和 8 个参数,这种详尽程度是合理且必要的。

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?

工具复杂度高(8 参数、3 算法、算法间参数互斥),且无输出 schema,但描述提供了完整的输出字段清单(derived_key_in_hex、salt_used_in_hex、salt_generated 等),并补充了跨参数约束、长度范围、错误行为(错配被拒)和性能上限。即使没有输出 schema,智能体也能据此预期返回值并正确调用。

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

Parameters5/5

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

虽然 schema 描述覆盖率为 100%,但描述在 schema 基础上补充了大量语义,如每个参数适用的算法(hash_algorithm 仅 HKDF、password 仅 Pbkdf2Sm3)、输入长度限制、默认值说明、Pbkdf2Sm3 空盐的服务端回显行为、iterations 的互通测试建议区间等。这些信息对正确构造参数至关重要,远非重复 schema 可替代。

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?

明确以动词“执行密钥派生(KDF)”开头,点明核心资源与目标(从高熵秘密或口令派生对称密钥材料),并列出三种支持算法。与同组工具(如 hash_sum、hmac_sum、sm2_decryption 等)明显区分,无歧义。

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?

描述给出了清晰的使用场景与算法选择依据,如“HKDF(默认)”“Sm3Kdf 适合对 SM2 ECDH 共享秘密派生密钥”“Pbkdf2Sm3 用于口令拉伸”,并提及“典型用途”和“参数按算法适用,错配会被拒”。虽未显式与兄弟工具做“何时不用”的对比,但对一个独立 KDF 工具而言,使用指引已足够充分。

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.