Skip to main content
Glama

CipherHUB Cryptography Toolkit

hybrid_kex

[pqc_kem] 执行 X25519 + ML-KEM-768 混合密钥交换全流程演示。 【标准参考】IETF X-Wing 草案(draft-connolly-cfrg-xwing-kem)。 【参数】所有密钥参数均可选:

  • alice_x25519_private_key_pem / bob_x25519_private_key_pem:X25519 PEM 私钥

  • alice_ml_kem_public_key_base64 / bob_ml_kem_public_key_base64:ML-KEM-768 公钥,支持 raw 或 SPKI DER Base64

  • alice_ml_kem_secret_key_base64 / bob_ml_kem_secret_key_base64:ML-KEM-768 私钥,支持 raw 或 PKCS#8 DER Base64

  • ML-KEM 公钥和私钥必须同时提供;留空则服务端使用 CSPRNG 随机生成 raw keypair 【流程】

  1. Alice 和 Bob 各持有 X25519 + ML-KEM-768 密钥对

  2. Alice 用 Bob 公钥做 X25519 ECDH + ML-KEM Encap

  3. Bob 用自己私钥做 X25519 ECDH + ML-KEM Decap

  4. 双方将 ecdh_ss || ml_kem_ss 通过 HKDF-SHA256 派生 32 字节最终密钥 【输出】双方中间值 + 最终密钥 + keys_match(bool)验证一致性。 【安全等级】组合后达到 NIST Level 3(ML-KEM-768)+ Level 1(X25519),抵抗经典和量子攻击。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bob_x25519_public_key_pemNo
bob_x25519_private_key_pemNoBob 侧 X25519 私钥的 PEM 文本
alice_x25519_public_key_pemNo
alice_x25519_private_key_pemNoAlice 侧 X25519 私钥的 PEM 文本
bob_ml_kem_public_key_base64NoBob 侧 ML-KEM 公钥的 Base64 字符串(raw 或 SPKI DER)
bob_ml_kem_secret_key_base64NoBob 侧 ML-KEM 私钥的 Base64 字符串(raw 或 PKCS#8 DER)
alice_ml_kem_public_key_base64NoAlice 侧 ML-KEM 公钥的 Base64 字符串(raw 或 SPKI DER)
alice_ml_kem_secret_key_base64NoAlice 侧 ML-KEM 私钥的 Base64 字符串(raw 或 PKCS#8 DER)

TDQS

A4.1/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 and does well: it discloses the fallback to CSPRNG generation, the requirement that ML-KEM keys be provided together, and the HKDF derivation and output fields. It does not mention error behavior, but for a stateless demo this is reasonably transparent.

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 well-structured with labeled sections (参数, 流程, 输出, 安全等级) and front-loads the purpose. It is somewhat lengthy and repeats some schema details, but every section contributes useful context without being excessively verbose.

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?

For a demo with 8 parameters and no output schema, the description explains the flow, key formats, output types (including keys_match), and security level. It could be more specific about the exact output structure and error cases, but it is largely sufficient for an agent to understand and invoke the tool.

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

Parameters3/5

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

The description lists key parameters and adds useful constraints like '公钥和私钥必须同时提供' and random-generation fallback. However, most of this is duplicated in the schema's root description and property descriptions, and the description omits the X25519 public key fields entirely, so it adds only marginal value beyond the 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?

The description opens with a clear action: '执行 X25519 + ML-KEM-768 混合密钥交换全流程演示' and adds the X-Wing draft reference, making the tool's purpose unmistakable and distinguishing it from sibling tools like ml_kem_encap/ml_kem_decap and ecc_key_exchange.

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 provides context by explaining the full-process demo, optional key provisioning, and the exact flow and security level. However, it does not explicitly name alternatives or state when not to use this tool versus the separate ml_kem or ecc_key_exchange tools, so it misses 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.