AGENT SKILL

cryptographic-review

Finds cryptographic failures (weak hashing, insecure modes, hardcoded keys, weak PRNG, disabled TLS verification) from code evidence. Use when docs or code cover password storage, encryption, token or API key generation, outbound HTTPS or key management.

License 许可
MIT
所属仓库
Eliyce/paqad-ai
最近更新
2026-11-13
Stars
★ 8
Forks
0

01 前言 Front Matter

name
cryptographic-review
metadata
{ "cacheable": "false", "model_tier": "reasoning", "paqad-meta": "skill.meta.yaml", "output_format": "markdown" }
description
Finds cryptographic failures (weak hashing, insecure modes, hardcoded keys, weak PRNG, disabled TLS verification) from code evidence. Use when docs or code cover password storage, encryption, token or API key generation, outbound HTTPS or key management.

02 资源文件 7

03 SKILL.md 正文

What It Does

Reviews the application's cryptographic implementation for weaknesses that could allow an attacker to recover sensitive data, forge tokens, or intercept communications (covering password storage, symmetric encryption, random number generation, key management, and TLS configuration. Maps to OWASP 2025 A04) Cryptographic Failures.

Use This When

When module docs or code evidence describes password storage, data encryption, token generation, API key creation, external HTTPS calls, or certificate/key management.

Inputs

  • Read module docs to identify where cryptography is used.
  • Read references/crypto-weakness-patterns.md before scanning each area.
  • Read code and configuration files for cryptographic implementation details.

Procedure

  1. Encryption at rest: Find database columns or file stores that contain PII, financial data, authentication credentials, or health records. Verify encryption is applied and the encryption key is not stored in the same location as the encrypted data.

  2. Encryption in transit: Verify all inter-service and client-server communication uses TLS 1.2+. Search for patterns that disable certificate verification: verify=False, rejectUnauthorized: false, InsecureSkipVerify: true, CURLOPT_SSL_VERIFYPEER = false, ssl._create_unverified_context(), NODE_TLS_REJECT_UNAUTHORIZED=0.

  3. Key management: Scan codebase for hardcoded secrets, API keys, or encryption keys embedded as string literals or in config files committed to the repository. Verify that key rotation procedures exist. Verify keys are not stored alongside the data they protect.

  4. Password storage: Identify the hashing algorithm used for passwords:

    • MD5, SHA1, SHA256 (even with salt) → flag as weak for password hashing; fast algorithms enable brute-force
    • bcrypt with cost factor ≥ 10 → acceptable
    • argon2id with memory ≥ 64MB, iterations ≥ 3 → recommended
    • PBKDF2 with ≥ 100,000 iterations → acceptable
    • Check that each password has a unique random salt (not a global salt)
  5. Random number generation: Find uses of Math.random(), rand(), mt_rand(), random.random(), java.util.Random in security-sensitive contexts (session ID generation, token generation, OTP generation, CSRF token generation). These are not cryptographically secure. Require crypto.randomBytes(), random_bytes(), secrets.token_bytes(), java.security.SecureRandom.

  6. Symmetric encryption: Find uses of ECB mode (AES/ECB, openssl_encrypt(..., "aes-128-ecb", ...)). ECB mode leaks patterns in ciphertext, identical plaintext blocks produce identical ciphertext. Check for static/hardcoded IVs. Verify IVs are generated with a CSPRNG per encryption operation.

Output Contract

  • Match assets/output.template.md: ## Findings with severity, WSTG-CRYP id (from assets/wstg-mapping.txt), Evidence: file:line, and Required action: per bullet.
  • Output must pass scripts/lint-findings.sh (exit 0).
  • Never include raw secret values: file:line only.

Escalate / Stop Conditions

  • Ask when the encryption library is not identified: cannot verify algorithm without knowing the library.
  • Warn when MD5 or SHA1 is used anywhere for password hashing: these are never acceptable regardless of salt.
  • Do not flag cryptography findings for non-security data (e.g., MD5 used for cache key generation or file checksums is acceptable).

Resources

  • references/crypto-weakness-patterns.md
  • scripts/scan-crypto-smells.sh: pre-investigation grep for known anti-patterns
  • scripts/lint-findings.sh: enforces WSTG-CRYP id, Evidence:file:line, and no raw-secret leak
  • assets/output.template.md
  • assets/wstg-mapping.txt

04 同仓库更多 Skills

Eliyce
Eliyce/paqad-ai

sample-skill

Sample bundled skill fixture

★ 8
Eliyce
Eliyce/paqad-ai

processing-invoices

Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.

★ 8
Eliyce
Eliyce/paqad-ai

processing-invoices

Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.

★ 8
Eliyce
Eliyce/paqad-ai

understand-idea

Chat and Claude Code: Step 1 of the discover journey: clarifies the goal, who benefits, success and constraints into the idea block. Use when the journey directs it to step 1, not directly.

★ 8
Eliyce
Eliyce/paqad-ai

size-work

Chat and Claude Code: Suggest a size for a ticket from comparable finished work, as a labelled suggestion the team still owns. Use it when someone asks "how big is this?", "roughly how much work is ABC-12?", or wants a backlog item sized. It finds the team's sizing scale at first use, picks two to five of the closest finished tickets with links, and gives a size or range with the drivers behind it and a confidence of low, medium or high, lowered and explained when the area's documents are template text. Every result is labelled a suggested size, never a date or a commitment. It writes nothing into the size field unless the user says "set it", and it refuses to overwrite an existing size unless the user asks to replace it. Produces the sizing block of the record.

★ 8
Eliyce
Eliyce/paqad-ai

refine-ticket

Chat and Claude Code: Improve one or more existing tracker tickets without losing the author's intent. Use it when someone wants a ticket read, diagnosed and tidied up ("this ticket is vague", "fix up ABC-12", "split this, it's too big"). It reads each ticket in full and snapshots it with its last-updated time, says what is wrong with evidence, and proposes a field-by-field before and after change set limited to summary, description, labels, parent, links and new child tickets on a split. It writes nothing until an explicit "apply it" bound to that exact change set, re-checks the ticket for conflicting edits just before writing, never replaces rich descriptions with plain text, never deletes or closes a ticket, and reads each ticket back after applying. Produces the existing and changes blocks of the record.

★ 8