CipherHUB Cryptography Toolkit
io.github.bowenerchen/cipherhubProduction-grade cryptography toolkit with 31 MCP tools for classical, PQC, and KMS workflows.
Tools · 32
[utility] 健康检查 / 回显接口。客户端传入 client_msg 字符串,服务端原样回显并附加 server_msg,用于验证 MCP 通道连通性。返回字段:client_msg(回显)、server_msg(服务端附加消息)。
[random] 使用操作系统 CSPRNG 生成安全随机字节。data_length 指定字节数(1-128),返回 data_in_hex 十六进制字符串。返回字段:data_in_hex(随机数据 Hex 编码)、data_length(实际字节数)。
[hash_digest] 计算消息摘要(支持多算法批量计算)。 【支持算法】Sha1 / Sha224 / Sha256 / Sha384 / Sha512 / Sm3 / Shake128 / Shake256。 【参数】 - plain_in_hex:明文 Hex 字符串(原始数据 1B ~ 16MB) - required_hash_modes:字符串数组,指定需要计算的算法列表,默认计算…
[hash_digest] 计算 HMAC(基于哈希的消息认证码)。 【支持算法】Sha1 / Sha224 / Sha256 / Sha384 / Sha512 / Sm3(不支持 SHAKE 系列,因 SHAKE 为 XOF 非固定长度哈希)。 【参数】 - key_in_hex:密钥 Hex(16~256 字节,即 32~512 个 hex 字符) - plain_in_hex:待认证数据 …
[symmetric_cipher] 分组密码 CBC 模式加解密。 【算法】AES128(key=16B) / AES256(key=32B) / SM4(key=16B)。 【参数】 - algorithm:算法名 - process_type:Encrypt 或 Decrypt - input_data_in_hex:明文或密文 Hex(1B~16MB) - key_in_hex:密钥 He…
[symmetric_cipher] AEAD 流式加解密(认证加密)。 【算法】AES256GCM(key=32B) / ChaCha20Poly1305(key=32B) / SM4GCM(key=16B)。 【参数】 - algorithm:算法名 - process_type:Encrypt 或 Decrypt - input_data_in_hex:明文或密文 Hex(1B~16MB) …
[symmetric_cipher] PKCS7 填充/去填充工具。 【参数】 - padding_action:DoPadding(填充到 16 字节对齐)或 UnPadding(去填充) - data_in_hex:待处理数据 Hex 【输出】output_data_in_hex、output_length。 【说明】块大小固定 16 字节(AES/SM4 块大小)。通常无需单独调用此工具,b…
[rsa] 生成 RSA 密钥对。 【参数】 - key_size:2048 / 3072 / 4096(位) - private_key_password:可选,设置后私钥 PEM 用 AES-256-CBC 加密保护 【输出】public_key_in_pem、private_key_in_pem、key_size。 【后续操作】公钥用于 rsa_encryption / rsa_verify…
[rsa] RSA 公钥加密。 【参数】 - rsa_public_key_in_pem:PEM 格式公钥 - plain_data_in_hex:明文 Hex - rsa_padding_mode:RSAES_PKCS1_V1_5 / RSAES_OAEP_SHA_1 / RSAES_OAEP_SHA_224 / RSAES_OAEP_SHA_256 / RSAES_OAEP_SHA_384 /…
[rsa] RSA 私钥解密。 【参数】 - rsa_private_key_in_pem:PEM 格式私钥 - cipher_data_in_hex:密文 Hex(长度 = key_size/8 字节) - rsa_padding_mode:必须与加密时一致 - password:若私钥有密码保护则传入 【输出】plain_data_in_hex、plain_length。
[rsa] RSA 私钥签名。 【参数】 - rsa_private_key_in_pem:PEM 格式私钥 - data_in_hex:待签数据 Hex - rsa_sign_padding_mode:RSA_SIGN_PKCS1_V1_5_SHA{1,224,256,384,512} 或 RSA_SIGN_PSS_SHA{1,224,256,384,512} - rsa_sign_raw_da…
[rsa] RSA 公钥验签。 【参数】 - rsa_public_key_in_pem:PEM 格式公钥 - data_in_hex:原始数据 Hex - signature_in_hex:签名 Hex - rsa_sign_padding_mode:必须与签名时一致 - rsa_sign_raw_data_mode:必须与签名时一致 【输出】verified(bool,True=验签通过)。
[ecc] 生成 ECC 密钥对。 【曲线】ECC_SECP_256R1 / ECC_SECP_384R1 / ECC_SECP_521R1 / ECC_SECP256K1 / ECC_ED25519(仅签名)/ ECC_X25519(仅 ECDH)。 【参数】 - curve:曲线名 - private_key_password:可选,私钥 PEM 加密保护 【输出】public_key_in_…
[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 sal…
[ecc] ECC 私钥签名(SECP* 用 ECDSA,ED25519 用 EdDSA)。 【参数】 - ecc_private_key_in_pem:PEM 私钥 - plain_data_in_hex:待签数据 Hex - sign_raw_data_mode:True=对原文签名(内部先哈希),False=plain_data_in_hex 已是摘要 - hash_algorithm:Sh…
[ecc] ECC 公钥验签(SECP* 用 ECDSA,ED25519 用 EdDSA)。 【参数】 - ecc_public_key_in_pem:PEM 公钥 - plain_data_in_hex:原始数据 Hex - signature_in_hex:签名 Hex - sign_raw_data_mode:必须与签名时一致 - hash_algorithm:必须与签名时一致 【输出】ve…
[sm2] 生成 SM2(SM2P256V1 / 国密曲线)密钥对。 【参数】 - private_key_password:可选,私钥 PEM 加密保护 【输出】public_key_in_pem、private_key_in_pem、z_in_hex、point_x_in_hex、point_y_in_hex、public_key_in_hex、private_key_in_hex。 【后续操…
[sm2] SM2 公钥加密。 【参数】 - sm2_public_key_in_pem:PEM 格式公钥 - plain_data_in_hex:明文 Hex 【输出】cipher_in_hex_with_format 字典,同时返回四种编码格式: - C1C3C2_ASN1:ASN.1 DER 编码(推荐,国标 GM/T 0009) - C1C2C3_ASN1:ASN.1 DER 旧格式 - …
[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_i…
[sm2] SM2 私钥签名。 【参数】 - sm2_private_key_in_pem:PEM 格式私钥 - data_in_hex:待签数据 Hex。 · RAW 模式(sign_raw_data_mode=True):消息原文 Hex,服务端走标准 SM2 流程,内部计算 e = SM3(ZA || M) 后签名。 · DIGEST 模式(sign_raw_data_mode=Fa…
[sm2] SM2 公钥验签。 【参数】 - sm2_public_key_in_pem:PEM 格式公钥 - data_in_hex:待验签数据 Hex。 · RAW 模式(sign_raw_data_mode=True):消息原文 Hex,服务端走标准 SM2 流程,内部计算 e = SM3(ZA || M) 后验签。 · DIGEST 模式(sign_raw_data_mode=Fa…
[sm2] 解析 SM2 加密私钥(ENCRYPTED PRIVATE KEY PEM)结构,返回 ASN.1 内部字段的 JSON 视图。用于调试与教学,不会解出私钥值。返回字段:structure(ASN.1 结构 JSON,含加密算法 OID、盐、迭代次数等)。
[sm2] 将 SM2 PEM 公钥转换为裸 Hex 编码(未压缩点,04 || X || Y)。返回字段:public_key_in_hex(130 个 hex 字符,65 字节)。
[symmetric_cipher] ZUC-128 流密码(中国商密算法)。由于 ZUC 是对称流密码,加解密为同一操作,传入明文即输出密文,反之亦然。key_in_hex 固定 16 字节(32 hex 字符),iv_in_hex 固定 16 字节(32 hex 字符),input_data_in_hex 原始数据长度 1B ~ 16MB。返回字段:output_data_in_hex(输出 …
[pqc_kem] 生成 ML-KEM 密钥对(FIPS 203,后量子密钥封装标准)。 【算法选择】ML-KEM-512(NIST Level 1)/ ML-KEM-768(Level 3,推荐)/ ML-KEM-1024(Level 5)。 【参数】 - algorithm:算法名 - seed_in_hex:64 字节种子 hex(128 字符),确定性生成 - use_random_see…
[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_base6…
[pqc_kem] 使用 ML-KEM 私钥执行密钥解封装(FIPS 203)。 【算法】ML-KEM-512 / ML-KEM-768 / ML-KEM-1024。 【参数】 - algorithm:必须与 keygen/encap 一致 - secret_key_in_hex:ml_kem_keygen 返回的私钥 hex - ciphertext_in_hex:ml_kem_encap 返回…
[pqc_signature] 生成 ML-DSA 密钥对(FIPS 204,后量子数字签名标准)。 【算法选择】algorithm 支持 ML-DSA-44(NIST Level 2)/ ML-DSA-65(Level 3,默认)/ ML-DSA-87(Level 5)。 【安全等级参考】ML-DSA-44 ≈ AES-128 / ML-DSA-65 ≈ AES-192 / ML-DSA-87 …
[pqc_signature] 使用 ML-DSA 私钥对消息签名(FIPS 204)。 【双模式】sign_mode 支持 RAW(默认)和 EXTERNAL_MU 两种模式。 - RAW 模式:直接签名原始消息(liboqs,最大 256 字节) - EXTERNAL_MU 模式:先计算 mu = SHAKE-256(tr||M', 64),再通过 OpenSSL 3.5+ mu 模式签名(最…
[pqc_signature] 使用 ML-DSA 公钥验证签名(FIPS 204)。 【双模式】sign_mode 支持 RAW(默认)和 EXTERNAL_MU 两种模式,必须与签名时使用的模式一致。 - RAW 模式:直接验证原始消息签名(liboqs,最大 256 字节,空消息合法) - EXTERNAL_MU 模式:先计算 mu,再通过 OpenSSL 3.5+ mu 模式验签,可验证 …
[pqc_signature] 独立计算 ML-DSA 的 64 字节 mu 值(FIPS 204 Section 6.2)。 【用途】用于验证或调试 EXTERNAL_MU 模式的中间值,或与 AWS KMS EXTERNAL_MU 签名流程对接。 【计算公式】 - tr = SHAKE-256(raw_pk, 64) - M' = 0x00 || len(ctx) || ctx || mess…
[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_k…
Resources · 8
Complete catalog of all cryptographic algorithms supported by CipherHUB, including parameter constraints, key sizes, and compatibility notes.
cipherhub://algorithms
Mapping of all 31 MCP tools organized by category (hash, symmetric, RSA, ECC, SM2, PQC, utility), showing tool relationships.
cipherhub://tool-categories
Summary of CipherHUB vs AWS KMS interoperability verification. 70/70 passed across RSA, ECC, ECDH, Ed25519, HMAC, and ML-DSA.
cipherhub://interop/aws-kms
Summary of CipherHUB vs Tencent Cloud KMS interoperability verification. 39/39 passed including SM2, SM4, RSA, and ECC.
cipherhub://interop/tencent-kms
Summary of CipherHUB vs OpenSSL 3.6 interoperability verification. 148/154 passed including Hash, HMAC, CBC, AEAD, RSA, ECC, SM2, ML-KEM, ML-DSA, and Hybrid KEX.
cipherhub://interop/openssl36
Complete Python reference implementation of the CipherHUB encrypted REST channel protocol. Covers ECDH key agreement (SECP521R1), HKDF-SHA512 key derivation, ChaCha20-Poly1305 encryption with PKCS#7 p…
cipherhub://channel-implementation
Complete guide for AI Agents to use CipherHUB MCP tools. Includes initialization, tool listing, tool call examples, error handling, rate limit avoidance, and parameter notes for all 31 tools.
cipherhub://mcp-usage-guide
Performance benchmark data for all CipherHUB operations. Includes Avg/P50/P95/Max latency and MaxQPS for 29 test cases. AI Agents should read this before integrating to avoid triggering 429 rate limit…
cipherhub://benchmark-report
Prompts · 6
Assess post-quantum cryptography migration readiness. Guides you through generating ML-KEM/ML-DSA keys, testing encapsulation/signature flows, and comparing with classical algorithms.
Verify that a public key and private key form a valid pair. Supports RSA, ECC, and SM2. Signs a test message with the private key and verifies with the public key.
Demonstrate a complete end-to-end encryption flow: generate a key pair, derive a shared secret via key exchange, encrypt plaintext with AEAD, and decrypt to verify correctness.
Complete digital signature workflow: generate key pair, sign a message, then verify the signature. Supports RSA-PSS, ECDSA, SM2, and ML-DSA.
Demonstrate X25519 + ML-KEM-768 hybrid key exchange. Generates both classical and post-quantum key pairs, performs the full hybrid KEX, and verifies both parties derive the same shared secret.
Get algorithm recommendations based on your use case. Considers performance, security level, compliance requirements (FIPS 140-3, GM/T), and post-quantum readiness.
Similar MCP servers embedding-nearest
How to use
Add to your Claude Desktop / Cursor / Cline MCP config:
{
"mcpServers": {
"cipherhub_cryptography_toolkit": {
"url": "https://tools.cipherhub.cloud/cipherhub/mcp",
"transport": "streamable-http"
}
}
}