← Back to Skills Marketplace
loofare

文件加解密 (file-crypto)

by loofare · GitHub ↗ · v1.3.0 · MIT-0
cross-platform ⚠ suspicious
114
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install file-crypto
Description
使用来布公司内置的 file-crypto SDK 对服务器本地文件进行加密或解密处理,以及获取 Agent 身份令牌(authId)。当用户提到"加密文件"、"解密文件"、"文件加密"、"文件解密"、"获取authId"、"获取鉴权"、"encrypt file"、"decrypt file",或者提供了服务器...
README (SKILL.md)

file-crypto — 文件加解密 Skill

关于本 Skill

本 skill 是来布公司内部 file_crypto SDK 的命令行使用封装,用于对服务器本地文件执行加密或解密处理,以及获取 Agent 身份令牌。

  • 运行环境:仅在来布公司服务器本地执行,不访问任何外部网络
  • 数据流向:文件读写均在服务器本地完成,不上传至第三方
  • 身份令牌:authId 是来布内部系统的用户身份标识,由公司自有后台签发,不涉及第三方凭证

前置知识

file_crypto SDK 已预装在服务器上,必须在指定目录下调用

/data/endecode-win-linux

命令格式:

cd /data/endecode-win-linux
python3 -m file_crypto --action \x3Cencrypt|decrypt|getAuth> [业务参数]

支持三种操作:

action 说明 必填参数
encrypt 文件加密 --filePath--authId
decrypt 文件解密 --filePath--authId
getAuth 获取 Agent 身份令牌 --agentId

典型流程:首次使用时,先执行 getAuth 获取 authId(有效期 15 天),再用该 authId 执行加解密操作。


执行流程

情况一:加密 / 解密文件

第一步:确认参数

从用户输入中获取以下三项,缺一不可:

  1. 操作类型:加密(encrypt)还是解密(decrypt)?
  2. 文件路径--filePath):完整的服务器物理路径
  3. 用户身份令牌--authId):由 getAuth 获取,最长 64 字符

如果用户没有 authId,引导其先执行 getAuth(见情况二)。

第二步:构造并执行命令

加密:

cd /data/endecode-win-linux && python3 -m file_crypto --action encrypt --filePath \x3C文件路径> --authId \x3C身份令牌>

解密:

cd /data/endecode-win-linux && python3 -m file_crypto --action decrypt --filePath \x3C文件路径> --authId \x3C身份令牌>

第三步:解析结果

✅ 成功"code": 0"success": true):

{
  "code": 0,
  "message": "处理成功",
  "success": true,
  "data": {
    "sourceFilePath": "/data/upload/test.pdf",
    "targetFilePath": "/data/output/test_encrypt.pdf",
    "action": "encrypt"
  }
}

向用户报告原始路径(sourceFilePath)和处理后路径(targetFilePath):

✅ 加密成功!

  • 原始文件:/data/upload/test.pdf
  • 处理后文件:/data/output/test_encrypt.pdf

❌ 失败,根据 code 区分:

code message 说明 建议提示
400 请求参数非法 参数格式有误 检查文件路径、--action 值及 --authId 是否已传入且不超过 64 字符
401 身份验证失败 authId 无效或已过期 确认 authId 是否正确,或重新执行 getAuth 获取新令牌(有效期 15 天)
404 源文件不存在 文件路径不存在 确认文件路径是否正确,文件是否已上传至服务器
500 文件处理失败 SDK 内部异常 检查文件格式是否受支持,或联系管理员查看服务器日志

情况二:获取 Agent 身份令牌(getAuth)

当用户需要初次获取 authId,或令牌已过期时执行。

第一步:确认参数

获取用户的 Agent 标识--agentId):由来布公司内部系统分配的唯一标识字符串。

第二步:构造并执行命令

cd /data/endecode-win-linux && python3 -m file_crypto --action getAuth --agentId \x3CAgent标识>

第三步:解析结果

✅ 成功"code": "200",注意为字符串):

{
  "code": "200",
  "message": "success",
  "data": {
    "authId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  }
}

向用户返回 data.authId 的值,并说明有效期:

✅ 获取成功!您的身份令牌为: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 有效期 15 天,请保存备用,用于后续文件处理操作。

❌ 失败"code": "500",注意为字符串):

{
  "code": "500",
  "message": "agentId未绑定用户",
  "data": null
}

❌ 获取失败:Agent 标识未绑定用户。 请确认 agentId 是否正确,或联系管理员完成绑定。


批量处理

对多个文件逐一执行命令,汇总结果:

文件处理完成(3/3):
✅ /data/upload/a.pdf → /data/output/a_encrypt.pdf
✅ /data/upload/b.pdf → /data/output/b_encrypt.pdf
❌ /data/upload/c.pdf → 失败(源文件不存在)

注意事项

  • 本工具仅处理服务器本地文件,不支持本地桌面文件,不访问外部网络
  • 命令必须在 /data/endecode-win-linux 目录下执行
  • 文件路径区分大小写,请原样传入
  • 身份令牌(authId)有效期为 15 天,过期后重新执行 getAuth 获取
  • getAuth 返回的 code 字段为字符串"200"/"500"),与加解密的整数 code 不同
  • 处理后的文件路径以实际 targetFilePath 返回值为准
Usage Guidance
要不要安装/启用前请考虑: - 确认目标服务器确实有 /data/endecode-win-linux 目录、已预装 file_crypto SDK 和 python3;否则该 skill 无法工作。 - 该 skill 需要处理并返回 authId(敏感令牌),并会对用户指定的服务器文件路径做读写操作——只对受信任或必要的文件路径使用,并在可能的情况下限定可操作目录。 - 虽然 SKILL.md 表明不访问外网,但 agent 仍可能通过其他技能或输出泄露文件内容或令牌;确保代理权限、日志与审计策略到位,先在非敏感文件/测试环境验证行为。 - 如果你担心最小权限,考虑建立操作白名单(允许的目录/文件类型)或要求人工确认每次处理的具体路径。
Capability Analysis
Type: OpenClaw Skill Name: file-crypto Version: 1.3.0 The skill provides a wrapper for a local file encryption SDK but introduces a significant risk of shell injection. In SKILL.md, the instructions direct the agent to construct shell commands using unvalidated user input (e.g., --filePath and --authId) executed via 'python3 -m file_crypto'. While the stated purpose is legitimate for an internal tool, the lack of input sanitization or guidance to escape shell metacharacters could allow an attacker to achieve Remote Code Execution (RCE) on the server. No evidence of intentional malice or data exfiltration was observed.
Capability Tags
crypto
Capability Assessment
Purpose & Capability
名称与描述声明的功能(对服务器本地文件进行加/解密、获取内部 authId)与 SKILL.md 中要求的操作一致;没有要求与功能不相关的云凭证、外部服务或额外二进制。
Instruction Scope
SKILL.md 明确要求在 /data/endecode-win-linux 目录下执行 `python3 -m file_crypto` 并接受用户提供的完整服务器路径与 authId。该范围与目的相符,但会让 agent 有能力读取/写入任意由用户或调用者提供的服务器文件路径——这是此类工具的正常行为,用户应确保只对受信任或必要的路径执行操作。还应确认目标服务器实际预装了 python3 和该 SDK,否则命令会失败。
Install Mechanism
无安装规范(instruction-only),不会在安装时下载或写入代码,风险较低;SKILL.md 假定 SDK 已预装于指定目录。
Credentials
不要求额外环境变量或外部凭证;唯一敏感项是内部 authId(由 getAuth 返回)——这是该功能合理需要的短期令牌。没有请求与功能无关的密钥或系统配置路径。
Persistence & Privilege
不设置 always:true,不修改其它技能或全局代理配置;允许模型/agent 调用是平台默认行为,本技能并未请求异常持久化权限。
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install file-crypto
  3. After installation, invoke the skill by name or use /file-crypto
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.3.0
- 用词更新:将“鉴权 ID(authId)”统一替换为“身份令牌(authId)”或“用户身份令牌”,部分语句更为准确规范。 - 更详细说明:在开头新增 skill 运行环境、数据流向、身份令牌说明,明确文件与令牌仅限公司内网,不涉及第三方。 - 部分字段表述优化(如“Agent 身份令牌”、“Agent 标识”等),指引内容更精简明晰。 - 错误信息及提示优化,表述更统一。 - 无功能变更,仅文档和术语同步优化。
v1.2.0
- 新增“获取 Agent 鉴权 ID(authId)”支持,可通过 getAuth 操作获取有效期 15 天的 authId - 增加 `getAuth` 命令使用说明,适用于首次使用或 authId 过期场景 - 优化错误提示,明确 `authId` 过期或无效需重新获取 - 文档说明 code 字段类型差异:`getAuth` 返回字符串,其它操作返回数字 - 更新描述,明确支持“获取authId”“获取鉴权”等新关键词
v1.1.0
**A new authentication parameter is now mandatory for all file encryption and decryption actions.** - 增加了必填参数 `--authId`,用于身份鉴权,所有命令均需提供。 - 支持并规范了 `401` 鉴权失败错误的用户反馈。 - SDK 调用格式从 `file-crypto` 更名为 `file_crypto`,命令行示例已同步更新。 - 所有相关说明和示例已强调 `authId` 的获取与校验,确保调用安全。 - 其他使用说明细节优化,无功能变动。
v1.0.0
file-crypto v1.0.0 — 初始版本发布 - 新增基于 file-crypto SDK 的服务器本地文件加密与解密能力 - 支持单文件或批量加/解密(多次命令调用) - 明确用户交互流程,包括参数确认、命令构造执行、及结果解析反馈 - 详细错误码与提示,方便用户排查问题 - 强调所有操作需在指定目录执行,专处理服务器本地文件
Metadata
Slug file-crypto
Version 1.3.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is 文件加解密 (file-crypto)?

使用来布公司内置的 file-crypto SDK 对服务器本地文件进行加密或解密处理,以及获取 Agent 身份令牌(authId)。当用户提到"加密文件"、"解密文件"、"文件加密"、"文件解密"、"获取authId"、"获取鉴权"、"encrypt file"、"decrypt file",或者提供了服务器... It is an AI Agent Skill for Claude Code / OpenClaw, with 114 downloads so far.

How do I install 文件加解密 (file-crypto)?

Run "/install file-crypto" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 文件加解密 (file-crypto) free?

Yes, 文件加解密 (file-crypto) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 文件加解密 (file-crypto) support?

文件加解密 (file-crypto) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 文件加解密 (file-crypto)?

It is built and maintained by loofare (@loofare); the current version is v1.3.0.

💬 Comments