crypto-scenario-skill

crypto-scenario-skill is a skill for Claude Code, Codex from jiushiwon/wg-skills. It costs 174 tokens per session (1,706 once invoked), scanned A, original, Apache-2.0.

A reference guide for choosing cryptography for common software tasks. Cryptography is the use of mathematical methods to protect passwords, messages, data, and proof of identity.

In plain words
What is it for?
It supports password storage, payment and webhook signature checks, API signing, login tokens, sensitive database fields, file checksums, commit signing, and TLS connections.
Why use it?
It helps avoid unsafe algorithm choices and common implementation mistakes, such as storing passwords with a simple hash or accepting an unsigned payment callback. It explains what to use and what to avoid for each scenario.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It supports password storage, payment and webhook signature checks, API signing, login tokens, sensitive database fields, file checksums, commit signing, and TLS connections.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jiushiwon/wg-skills/crypto-scenario-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jiushiwon/wg-skills --skill crypto-scenario-skill
Clone the repo
git clone --depth 1 https://github.com/jiushiwon/wg-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for crypto-scenario-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/jiushiwon/wg-skills/crypto-scenario-skill/github.svg)](https://agentmods.dev/skills/jiushiwon/wg-skills/crypto-scenario-skill)
Your own site
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/crypto-scenario-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/crypto-scenario-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for crypto-scenario-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/crypto-scenario-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/crypto-scenario-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 174 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00174 $0.01706
Opus 5.5 $0.00070 $0.00682
Sonnet 5.5 $0.00035 $0.00341
Haiku 4.5 $0.00017 $0.00171

Measured 20d ago against content hash 0dac4e4ba772, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

crypto-scenario-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

backend/crypto-scenario-skill/SKILL.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Crypto Scenario Skill

按场景而不是按算法名给结论。每个场景回答三件事:推荐什么、为什么、绝对不能用什么。

使用方式

  1. 先在下表定位场景 → 拿到推荐算法与禁止项。
  2. 按 references/code-snippets.md 取对应语言的代码范式(Java / Python / Go / Node)。
  3. 细节(微信支付报文格式、bcrypt 盐机制、JWT 选型)按需读 references/ 下的专题文件。
  4. 让 AI 写这类代码时,把 references/ai-guardrails.md 的约束块整段贴进 prompt。

场景决策表

场景 推荐 一句话理由 绝对禁止
用户密码存储 Argon2id 优先,scrypt 备选,bcrypt 用于存量系统,PBKDF2-HMAC-SHA-256 用于需要 FIPS 合规的场景 按环境压测成本参数,使用成熟库与独立随机盐 MD5 / SHA1 / SHA256 裸哈希、可逆加密、自研
微信支付回调验签 RSA-SHA256(平台证书验签)+ 敏感字段 AEAD_AES_256_GCM 官方强制算法,私钥不出商户 回调不验签、敏感字段不加密
支付宝开放平台签名 RSA2(SHA256WithRSA) 支付宝 2015 年定下的标准 RSA(SHA1)老算法、MD5
对接第三方开放接口 HmacSHA256(双方共享密钥) 双方持有同一密钥即可验 把密钥写死在代码里
Webhook 回调验签(自建) Ed25519(非对称)或 HmacSHA256 公钥可分发,私钥不出服务器 回调不验签、先处理业务后验签
JWT 登录态签名 单服务 HS256(密钥 ≥256 位);多服务互验 RS256 / EdDSA 自签自发够用就别上非对称 alg: none、短密钥、密钥进仓库
数据库敏感字段加密 AES-256-GCM(应用层)+ 附加认证数据绑字段 拖库只见乱码,且防密文搬字段 ECB 模式、密钥与库同库存放
文件完整性校验 SHA-256 快、够用、标准化 MD5、SHA1(已可构造碰撞)
Git 提交签名 SSH(Ed25519,默认已启用)或 GPG 证明"这笔提交是我发的" 无
传输 TLS 1.3 全站强制 TLS 1.0/1.1、自签名证书上生产

连接凭证需要取回时

SSH、数据库密码和第三方 API Key 需要交给目标服务使用。配置仅存凭证引用,秘密放 OS 凭证库或服务端 Secret Manager。确需保存本地密文时使用平台安全存储,服务端自行加密时使用 AEAD 并分离密钥。限制读取权限和有效期,避免把明文放进日志、导出文件或通用 IPC 响应。

SuperShell 实例:Electron 主进程优先用 keytar。keytar 模块加载失败时,现有实现使用 safeStorage 加密本地文件。核查时应确认实际存储后端,Linux 的 basic_text 不应作为安全回退。安全后端不可用时拒绝持久化,或让用户本次输入。优先由主进程取用凭证完成连接,检查渲染进程能否通过 IPC 取回明文。

参考:Electron safeStorage https://www.electronjs.org/docs/latest/api/safe-storage 参考:OWASP 密码存储 https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html

强制红线

  1. 不自己实现算法 —— 全部用成熟库(Java Bouncy Castle / Spring Security,Python cryptography + passlib,Go golang.org/x/crypto,Node node:crypto + bcrypt)。
  2. 密钥永不入库、不进仓库 —— 走环境变量或密钥管理服务,.env 必须 gitignore;启动时校验密钥长度,不达标直接失败退出。
  3. 用户登录密码只存密码哈希 —— 使用库验证输入,忘记密码走重置。历史哈希在验证成功后按策略升级,写回时防止覆盖并发改密。
  4. 哈希定长到的是"文件/报文没被改",密码要的是"慢" —— 两类哈希别混用。
  5. 回调先验签、后处理业务 —— 验签通过前不落库、不发货、不调下游。
  6. 签名比较用常量时间函数 —— hmac.compare_digest / crypto.timingSafeEqual,不要用 ==。
  7. 日志必须脱敏 —— 密码、密钥、完整身份证/银行卡号一律 mask。

Read the full file on GitHub · 72 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +9 lines 0dac4e4ba772
  2. 24d ago Changed · +1 lines · +174 tokens per session 89fe4ef5a898
  3. 1mo ago First seen · 62 lines · 0 tokens per session scan A 737b3dd3e465

Subscribe to this mod's changes

crypto-scenario-skill is a skill published in the GitHub repository jiushiwon/wg-skills (154 stars, last pushed 7d ago), licensed Apache-2.0. It adds 174 tokens to every session and 1,706 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-24.

Related

crypto-scenario-skill compared with skills from other repositories

crypto-scenario-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
crypto-scenario-skilljiushiwon/wg-skillsSkill1547d agoApache-2.0A174Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill331k3d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code