← 返回 Skills 市场
71
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install laosi-crypto-encoder
功能描述
编码工具�?- Base64编码/解码、URL编码/解码、SHA256/MD5哈希计算、UUID生成、JWT解析
使用说明 (SKILL.md)
Crypto Encoder - 编码工具�?
激活词: 编码 / base64 / 哈希 / hash / uuid
功能
- Base64 编码/解码
- URL 编码/解码
- SHA256/SHA512/MD5 哈希
- HMAC 签名
- UUID v4 生成
- JWT Token 解析
- 密码强度检�?
Python 实现
import base64, hashlib, hmac, uuid, json, re
from datetime import datetime
from typing import Dict, Optional
class CryptoEncoder:
def __init__(self):
self.history: list = []
def base64_encode(self, text: str) -> str:
"""Base64编码"""
result = base64.b64encode(text.encode("utf-8")).decode("ascii")
self._log("base64_encode", text, result)
return result
def base64_decode(self, encoded: str) -> str:
"""Base64解码"""
result = base64.b64decode(encoded.encode("ascii")).decode("utf-8")
self._log("base64_decode", encoded, result)
return result
def url_encode(self, text: str) -> str:
"""URL编码"""
from urllib.parse import quote
result = quote(text, safe="")
self._log("url_encode", text, result)
return result
def url_decode(self, encoded: str) -> str:
"""URL解码"""
from urllib.parse import unquote
result = unquote(encoded)
self._log("url_decode", encoded, result)
return result
def sha256(self, text: str) -> str:
"""SHA256哈希"""
result = hashlib.sha256(text.encode("utf-8")).hexdigest()
self._log("sha256", text, result)
return result
def sha512(self, text: str) -> str:
"""SHA512哈希"""
return hashlib.sha512(text.encode("utf-8")).hexdigest()
def md5(self, text: str) -> str:
"""MD5哈希"""
return hashlib.md5(text.encode("utf-8")).hexdigest()
def hmac_sha256(self, message: str, key: str) -> str:
"""HMAC-SHA256签名"""
return hmac.new(
key.encode("utf-8"),
message.encode("utf-8"),
hashlib.sha256
).hexdigest()
def generate_uuid(self) -> str:
"""生成UUID v4"""
return str(uuid.uuid4())
def parse_jwt(self, token: str) -> dict:
"""解析JWT Token(不验证签名�?""
parts = token.split(".")
if len(parts) != 3:
return {"error": "Invalid JWT format"}
try:
header = json.loads(base64.urlsafe_b64decode(parts[0] + "=="))
payload = json.loads(base64.urlsafe_b64decode(parts[1] + "=="))
return {
"header": header,
"payload": payload,
"signature": parts[2][:20] + "...",
}
except Exception as e:
return {"error": str(e)}
def password_strength(self, password: str) -> dict:
"""密码强度检�?""
score = 0
checks = {
"length": len(password) >= 8,
"uppercase": bool(re.search(r"[A-Z]", password)),
"lowercase": bool(re.search(r"[a-z]", password)),
"digits": bool(re.search(r"\d", password)),
"special": bool(re.search(r"[!@#$%^&*(),.?\":{}|\x3C>]", password)),
}
score = sum(checks.values())
if score \x3C= 2:
strength = "weak"
elif score \x3C= 3:
strength = "fair"
elif score \x3C= 4:
strength = "good"
else:
strength = "strong"
return {
"score": score,
"max_score": 5,
"strength": strength,
"checks": checks,
}
def _log(self, operation: str, input_val: str, output_val: str):
self.history.append({
"operation": operation,
"input": input_val[:50],
"output": output_val[:50],
"timestamp": datetime.now().isoformat()
})
def batch_encode(self, text: str) -> Dict[str, str]:
"""批量编码"""
return {
"original": text,
"base64": self.base64_encode(text),
"url": self.url_encode(text),
"sha256": self.sha256(text),
"md5": self.md5(text),
"uuid": self.generate_uuid(),
}
# 使用示例
crypto = CryptoEncoder()
# Base64
encoded = crypto.base64_encode("Hello, 世界!")
decoded = crypto.base64_decode(encoded)
print(f"Base64: {encoded}")
print(f"解码: {decoded}")
# URL编码
url_enc = crypto.url_encode("https://example.com/path?q=你好&lang=�?)
print(f"URL编码: {url_enc}")
# 哈希
print(f"SHA256: {crypto.sha256('password123')}")
print(f"MD5: {crypto.md5('Hello')}")
# HMAC
print(f"HMAC: {crypto.hmac_sha256('message', 'secret-key')}")
# UUID
print(f"UUID: {crypto.generate_uuid()}")
# JWT解析
jwt_token = "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiYWxpY2UiLCJleHAiOjE3MDkxMjM0NTZ9.signature"
parsed = crypto.parse_jwt(jwt_token)
print(f"JWT Header: {parsed.get('header')}")
print(f"JWT Payload: {parsed.get('payload')}")
# 密码强度
strength = crypto.password_strength("MyP@ssw0rd!")
print(f"密码强度: {strength['strength']} ({strength['score']}/{strength['max_score']})")
# 批量编码
batch = crypto.batch_encode("OpenCode 2026")
print(f"\
批量编码:")
for k, v in batch.items():
print(f" {k}: {v[:40]}")
编码对照
| 输入 | Base64 | SHA256 (�?�? | MD5 |
|---|---|---|---|
hello |
aGVsbG8= |
2cf24dba |
5d41402a |
12345 |
MTIzNDU= |
8d969eef |
827ccb0e |
使用场景
- API认证: Base64编码Basic Auth、Bearer Token
- **数据完整�?*: SHA256校验文件哈希
- 密码存储: MD5/SHA256哈希(加盐)
- Token处理: 解析JWT、生成API密钥
- **Web开�?*: URL编码参数、CSRF Token生成
依赖
- Python 3.8+
- 标准库(base64, hashlib, hmac, uuid, json�?
安全使用建议
Install only if you are comfortable with a local helper for encoding and hashing. Do not paste real passwords, bearer tokens, API keys, JWTs, or other secrets into the provided sample code unless you remove or disable the in-memory history logging first.
能力标签
能力评估
Purpose & Capability
The documented capabilities match the artifact: Base64 and URL encoding, hashing, HMAC, UUID generation, JWT parsing, and password-strength checks using Python standard libraries.
Instruction Scope
The implementation includes an in-memory history list that stores the first 50 characters of some inputs and outputs; this is visible in the code but not separately warned about in the description.
Install Mechanism
The package contains only SKILL.md and hub.json, with no install script, executable payload, declared dependencies, or package download behavior.
Credentials
The skill uses local computation only and does not request filesystem scanning, network access, subprocess execution, or external services.
Persistence & Privilege
There is no disk persistence or privilege escalation, but the sample class retains partial plaintext operation history in memory until the object is discarded.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install laosi-crypto-encoder - 安装完成后,直接呼叫该 Skill 的名称或使用
/laosi-crypto-encoder触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
- Added premium badge to skill metadata.
- Introduced hub.json file for metadata management.
- Minor text encoding/corruption present in documentation.
- No functional code changes.
v1.0.0
Crypto Encoder 1.0.0 – 编码工具箱首发版
- 支持 Base64 编码/解码、URL 编码/解码功能
- 提供 SHA256/SHA512/MD5 哈希计算与 HMAC-SHA256 签名
- 支持 UUID v4 生成与 JWT Token 解析(不验签)
- 密码强度检查与批量编码工具
- 适用 API认证、数据校验、Token处理等多种场景
元数据
常见问题
Crypto Encoder Pro 是什么?
编码工具�?- Base64编码/解码、URL编码/解码、SHA256/MD5哈希计算、UUID生成、JWT解析. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 71 次。
如何安装 Crypto Encoder Pro?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install laosi-crypto-encoder」即可一键安装,无需额外配置。
Crypto Encoder Pro 是免费的吗?
是的,Crypto Encoder Pro 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Crypto Encoder Pro 支持哪些平台?
Crypto Encoder Pro 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Crypto Encoder Pro?
由 534422530(@534422530)开发并维护,当前版本 v2.0.0。
推荐 Skills