Skip to main content
Glama

CipherHUB Cryptography Toolkit

ml_kem_encap

[pqc_kem] 使用 ML-KEM 公钥执行密钥封装(FIPS 203)。 【算法】ML-KEM-512 / ML-KEM-768 / ML-KEM-1024。 【参数】

  • algorithm:必须与 keygen 时一致

  • public_key_in_hex:ml_kem_keygen 返回的公钥 hex 【输出】ciphertext_in_hex、ciphertext_in_base64、shared_secret_in_hex、shared_secret_in_base64、shared_secret_sha256、ciphertext_bytes、shared_secret_bytes、algorithm。 【说明】每次 encap 产生不同密文(随机化),共享密钥始终 32 字节。发送 ciphertext 给密钥持有方,对方用 ml_kem_decap 恢复相同的 shared_secret。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)ML-KEM-768
public_key_in_hexNo公钥的十六进制字符串(裸密钥或 DER 编码,取决于算法)

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description discloses crucial runtime behavior: each encaps produces a different ciphertext due to randomization, and the shared secret is always 32 bytes. It also lists the exact output fields, which goes beyond a simple 'performs encapsulation' statement.

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 dense yet concise, front-loading the purpose, then organizing parameters, outputs, and usage notes in clearly labeled sections. Every sentence contributes value, with no redundant wording or filler.

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?

The tool is complex (post-quantum KEM) and has no output schema, but the description enumerates all output fields, explains the randomized behavior, and states the intended usage with ml_kem_decap. This gives the agent everything needed to understand the tool's role within the sibling set.

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 coverage is 100%, so the parameters are already documented, but the description adds critical cross-tool semantics: algorithm must match the keygen step, and public_key_in_hex is specifically the output of ml_kem_keygen. This connects the parameters to the actual workflow, exceeding the schema's generic 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 states the exact action: '使用 ML-KEM 公钥执行密钥封装(FIPS 203)', specifying the algorithm variant (ML-KEM-512/768/1024) and naming the standard. It clearly distinguishes from siblings by explicitly referencing ml_kem_decap as the counterpart and ml_kem_keygen for key generation.

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?

The description gives clear context: algorithm '必须与 keygen 时一致' and public_key_in_hex comes from 'ml_kem_keygen 返回的公钥 hex'. It also describes the intended workflow (send ciphertext, counterpart uses ml_kem_decap), but does not explicitly state when to use this tool instead of other key exchange or encryption tools.

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.