security-crypto

security-crypto is a skill for Claude Code, Codex from wangjianqi/AppStore. It costs 43 tokens per session (2,983 once invoked), scanned A, original, MIT.

A reference for protecting Apple-platform apps and data with encryption, secure storage, HTTPS, certificate checks, and app-attestation features. It covers Apple's CryptoKit and Keychain tools, among other security practices.

In plain words
What is it for?
Implementing hashing, message authentication, encryption, secure credential storage, certificate pinning, App Attest, and related app-security measures.
Why use it?
It helps avoid common mistakes when protecting data in transit, on the device, and during authentication.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Implementing hashing, message authentication, encryption, secure credential storage, certificate pinning, App Attest, and related app-security measures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wangjianqi/appstore/18-security-crypto
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 wangjianqi/AppStore --skill 18-security-crypto
Clone the repo
git clone --depth 1 https://github.com/wangjianqi/AppStore

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 security-crypto

README.md
[![agentmods](https://agentmods.dev/badge/skills/wangjianqi/appstore/18-security-crypto.svg)](https://agentmods.dev/skills/wangjianqi/appstore/18-security-crypto)
Your own site
<a href="https://agentmods.dev/skills/wangjianqi/appstore/18-security-crypto"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/18-security-crypto.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,983 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.00043 $0.02983
Opus 5 $0.00022 $0.01491
Sonnet 5 $0.00009 $0.00597
Haiku 4.5 $0.00004 $0.00298

Measured 7d ago against content hash ca901b451f84, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

security-crypto 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 7d 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.

ios-claude-skills/18-security-crypto/SKILL.md · 345 lines

How it starts

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

安全与加密

安全分层

层级 威胁 防护手段
传输层 中间人攻击、流量劫持 HTTPS + Certificate Pinning
存储层 数据泄露、越狱读取 Keychain + Data Protection
代码层 逆向工程、注入 混淆 + App Attest
认证层 Token 窃取、重放攻击 JWT + 短有效期 + PKCE
API 层 滥用、爬虫 速率限制 + 签名验证

CryptoKit

哈希

import CryptoKit

func sha256(_ data: Data) -> String {
    let hash = SHA256.hash(data: data)
    return hash.compactMap { String(format: "%02x", $0) }.joined()
}

func sha256(_ string: String) -> String {
    guard let data = string.data(using: .utf8) else { return "" }
    return sha256(data)
}

HMAC(消息认证码)

func hmac(key: Data, message: Data) -> String {
    let key = SymmetricKey(data: key)
    let signature = HMAC<SHA256>.authenticationCode(for: message, using: key)
    return signature.compactMap { String(format: "%02x", $0) }.joined()
}

AES 加解密

func encrypt(plaintext: Data, key: SymmetricKey) throws -> Data {
    let sealedBox = try AES.GCM.seal(plaintext, using: key)
    return sealedBox.combined!
}

func decrypt(ciphertext: Data, key: SymmetricKey) throws -> Data {
    let sealedBox = try AES.GCM.SealedBox(combined: ciphertext)
    return try AES.GCM.open(sealedBox, using: key)
}

func generateAESKey() -> SymmetricKey {
    SymmetricKey(size: .bits256)
}

签名验证

func sign(data: Data, privateKey: P256.Signing.PrivateKey) throws -> Data {
    let signature = try privateKey.signature(for: data)
    return signature.rawRepresentation
}

func verify(data: Data, signature: Data, publicKey: P256.Signing.PublicKey) -> Bool {
    guard let sig = try? P256.Signing.ECDSASignature(rawRepresentation: signature) else {
        return false
    }
    return publicKey.isValidSignature(sig, for: data)
}

Key Agreement(密钥协商)

func sharedSecret(privateKey: P256.KeyAgreement.PrivateKey, publicKey: P256.KeyAgreement.PublicKey) throws -> SharedSecret {
    return try privateKey.sharedSecretFromKeyAgreement(with: publicKey)
}

Read the full file on GitHub · 345 lines

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. 7d ago First seen · 345 lines · 43 tokens per session scan A ca901b451f84

Subscribe to this mod's changes

security-crypto is a skill published in the GitHub repository wangjianqi/AppStore (11 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 2,983 once invoked, about $0.0002 per session on Opus 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-08-31.