Skip to main content
Glama

CipherHUB Cryptography Toolkit

xts_cipher

Read-only

[symmetric_cipher] AES-XTS 可调窄分组模式加解密(IEEE 1619 / NIST SP 800-38E)。algorithm 可选 AES128XTS(key 32B = 数据密钥 16B + 调组密钥 16B)或 AES256XTS(key 64B = 32B + 32B)。tweak_in_hex 为 16 字节调整值,编码数据单元编号/扇区地址,密文与数据单元位置绑定。process_type 可选 Encrypt / Decrypt(两个变换不同,须显式声明)。输入 16B ~ 16MB,无填充,密文与明文等长;非 16 倍数的尾部自动走密文窃取(ciphertext stealing)。模式特点:各数据单元独立加密,支持并行与随机访问,同一数据单元加解密自同步;同一密钥下 tweak 严禁重复使用(否则两个数据单元明文相同会直接暴露相等关系);XTS 只提供保密性、可塑性攻击下无认证,需要防篡改时在外层叠加 AEAD 或签名。典型使用场景:BitLocker / LUKS2 / FileVault 全盘加密,AMD SEV-SNP 以 AES-256-XTS + VEK 加密 guest 内存(tweak 按物理地址派生,每页唯一),Intel TDX 内存加密同族。返回字段:output_data_in_hex、output_length、output_sha256、algorithm。

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": "xts_cipher"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)AES256XTS
key_in_hexNo密钥的十六进制字符串。长度取决于算法:AES256=64 字符(32B),AES128/SM4=32 字符(16B)
process_typeNo操作类型,可选值:Encrypt / DecryptEncrypt
tweak_in_hexNo
input_data_in_hexNo输入数据的十六进制字符串(加密时为明文,解密时为密文,1B~16MB)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false; the description adds substantial context on top — no padding, ciphertext length equals plaintext length, ciphertext stealing for non-block-multiple tails, the 16B–16MB input bound, and the hard prohibition on tweak reuse under the same key (with the equality-leak consequence spelled out). It also warns that output is malleable and unauthenticated, which is exactly the kind of trait an agent cannot infer from annotations.

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?

Well front-loaded: purpose first, then algorithm/key/tweak/process_type semantics, then mode caveats, then use cases, then return fields. Dense but mostly earning its space; the BitLocker/SEV-SNP/TDX enumeration is the one block that could be compressed to a single clause without losing selection value.

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?

For a five-parameter crypto primitive with no output schema, the definition covers everything an agent needs: allowed algorithms and key lengths, tweak construction, mandatory direction declaration, size limits, padding/stealing behavior, and even the return fields (output_data_in_hex, output_length, output_sha256, algorithm). The security caveat about unauthenticated output closes the last gap that would cause a wrong invocation.

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 80%, and the description still adds real meaning: it decomposes the key into a data key plus a tweak key (32B/64B split for AES128XTS/AES256XTS), explains that tweak_in_hex is a 16-byte value encoding the data unit number or sector address that binds ciphertext to position, and stresses that Encrypt and Decrypt are distinct transforms requiring an explicit process_type. It also tightens the input lower bound to 16B versus the schema's looser 1B~16MB, which is a genuine XTS constraint the schema would otherwise mislead on.

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?

States a specific verb and resource — 'AES-XTS 可调窄分组模式加解密' — and pins it to standards (IEEE 1619 / NIST SP 800-38E). The mode-level traits it lists (per-data-unit tweak, parallel/random access, ciphertext stealing, no authentication) let an agent distinguish this from block_cipher, ctr_cipher and stream_cipher without opening any schema.

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?

Gives concrete deployment contexts (BitLocker/LUKS2/FileVault, AMD SEV-SNP, Intel TDX) and an explicit exclusion: XTS provides confidentiality only, so tamper resistance must come from layering AEAD or a signature on top. It stops short of naming which sibling tool to pick instead (e.g. block_cipher vs ctr_cipher), so the when-to-use guidance is strong but not fully routable.

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.