Skip to main content
Glama

CipherHUB Cryptography Toolkit

ecc_key_exchange

Read-only

[ecc] ECDH + HKDF 密钥协商,双方各用私钥+对方公钥派生相同对称密钥。 【参数】

  • alice_ecc_private_key_in_pem:己方私钥 PEM

  • bob_ecc_public_key_in_pem:对方公钥 PEM

  • hash_algorithm:HKDF 底层哈希(Sha256/Sha384/Sha512 等,不支持 Sm3)

  • salt:HKDF salt Hex(可选)

  • additional_info:HKDF info Hex(可选)

  • derived_key_length:派生密钥长度 16~1024 字节

  • alice_ecc_private_key_password:若私钥加密则传入 【输出】derived_key_in_hex、derived_key_length。 【曲线限制】Ed25519 不可用,X25519 可用。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ecc_key_exchange"
  }
}

Input Schema

NameRequiredDescriptionDefault
saltNoHKDF salt 的十六进制字符串(可选)e5af86e7a081e5ada6e4babae38090436970686572485542e38091
hash_algorithmNo哈希算法名称,可选值:Sha1 / Sha224 / Sha256 / Sha384 / Sha512(ECC 不支持 Sm3)Sha512
additional_infoNoHKDF info 的十六进制字符串(可选)536572696f75732043727970746f6772617068790a20202020437265617469766520536f6c7574696f6e730a202020204d617070696e67204469676974616c205472757374
derived_key_lengthNoHKDF/KDF 派生密钥长度(整数,16~1024 字节;KDF Pbkdf2Sm3 上限 256)
bob_ecc_public_key_in_pemNoBob 侧 ECC 公钥的 PEM 文本
alice_ecc_private_key_in_pemNoAlice 侧 ECC 私钥的 PEM 文本
alice_ecc_private_key_passwordNoAlice 侧 ECC 私钥的加密密码(原始字符串,非编码格式)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / derived_key_length / description
      Previous value: -"HKDF 派生密钥长度(整数,16~1024 字节)"New value: +"HKDF/KDF 派生密钥长度(整数,16~1024 字节;KDF Pbkdf2Sm3 上限 256)"
  2. Changed8 schema fields changed
    • addedInput schema / properties / additional_info / description
      Added value: +"HKDF info 的十六进制字符串(可选)"
    • addedInput schema / properties / alice_ecc_private_key_in_pem / description
      Added value: +"Alice 侧 ECC 私钥的 PEM 文本"
    • addedInput schema / properties / alice_ecc_private_key_password / description
      Added value: +"Alice 侧 ECC 私钥的加密密码(原始字符串,非编码格式)"
    • addedInput schema / properties / bob_ecc_public_key_in_pem / description
      Added value: +"Bob 侧 ECC 公钥的 PEM 文本"
    • addedInput schema / properties / derived_key_length / description
      Added value: +"HKDF 派生密钥长度(整数,16~1024 字节)"
    • addedInput schema / properties / hash_algorithm / description
      Added value: +"哈希算法名称,可选值:Sha1 / Sha224 / Sha256 / Sha384 / Sha512(ECC 不支持 Sm3)"
    • addedInput schema / properties / hash_algorithm / enum
      Added value: +[
      +  "Sha1",
      +  "Sha224",
      +  "Sha256",
      +  "Sha384",
      +  "Sha512"
      +]
    • addedInput schema / properties / salt / description
      Added value: +"HKDF salt 的十六进制字符串(可选)"
  3. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is known. The description adds real value beyond that: it documents the return fields, the curve restriction, the Sm3 exclusion, and the encrypted-private-key password path, which are behavioral facts the annotations do not carry.

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 one-line summary is front-loaded and the bracketed sections are easy to scan. The parameter list is somewhat redundant against a fully documented schema, but it is organized and short enough that nothing feels padded.

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?

With no output schema, the description correctly names the return values (derived_key_in_hex, derived_key_length) and flags the critical curve constraint. Only the lack of guidance about matching parameters between the two parties keeps it from being fully complete for a multi-party operation.

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?

Schema description coverage is 100%, so all seven parameters are already documented, including the hex encodings and the 16~1024 byte range. The 【参数】 block largely restates the schema, with only the explicit 'not Sm3' note adding marginal meaning, so the baseline of 3 applies.

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 gives a specific verb and resource (ECDH + HKDF key agreement) and explains the mechanism: each side combines its own private key with the peer's public key to derive the same symmetric key. This cleanly separates it from siblings such as key_derivation or hybrid_kex.

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

Usage Guidelines3/5

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

Usage is implied by the key-agreement explanation, and the curve restriction (Ed25519 unavailable, X25519 usable) usefully rules out one bad input class. However, it never states when to prefer this over key_derivation or hybrid_kex, nor any prerequisite such as both parties agreeing on hash/salt/info.

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.