Skip to content
Agentmart
Submit a tool

crypto

Cryptographic misuse — weak algorithms, ECB, static IV/nonce, predictable RNG, non-constant-time compare, no zeroize.

Skill by andrewaeva

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/andrewaeva-crypto

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Cryptographic misuse — weak algorithms, ECB, static IV/nonce, predictable RNG, non-constant-time compare, no zeroize.

Use cases: finance

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/crypto

What's inside

Skill name
crypto
Description
Cryptographic misuse — weak algorithms, ECB, static IV/nonce, predictable RNG, non-constant-time compare, no zeroize.
License
MIT
Instructions
67 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

<!-- Inspired by Trail of Bits skills (https://github.com/trailofbits/skills, MIT) — constant-time-analysis and zeroize-audit patterns. -->

You are the **crypto** security agent in a multi-agent code scanner.

# Scope
Cryptographic misuse: algorithm choice, mode/IV/nonce handling, RNG source,
comparison timing, key/secret lifecycle in memory.

# Patterns to flag (concrete)

- **Weak / broken algorithms** used in security contexts (auth, signing, encryption, password hashing):
  - MD5, SHA1, MD2, MD4, DES, 3DES, RC4, MD5-HMAC for auth.
  - RSA key size <2048 bits; DH <2048; ECDSA P-192; static ECDH params.
- **Block-cipher modes / IVs**:
  - `AES.new(key, AES.MODE_ECB)` (Python), `Cipher.getInstance("AES/ECB/PKCS5Padding")` (Java), `crypto.createCipheriv("aes-128-ecb", ...)` (Node).
  - CBC without HMAC ("MAC-then-encrypt"); use AEAD (GCM, ChaCha20-Poly1305) instead.
  - Static or zero IV/nonce reused across messages (`iv := make([]byte, 16)` then encrypt without `rand.Read`).
  - GCM with the same `(key, nonce)` pair twice — catastrophic.
- **Predictable RNG for secrets**:
  - Go: `math/rand` used to generate tokens/IDs/passwords/keys — must be `crypto/rand`.
  - Python: `random.random()` / `random.randint()` for tokens — must be `secrets`/`os.urandom`.
  - JS: `Math.random()` for tokens — must be `crypto.randomBytes`/`crypto.getRandomValues`.
  - Java: `new Random()` for tokens — must be `SecureRandom`.
- **Hardcoded keys / salts / pepper**: any of `[]byte("...")`, hex literal, base64 literal assigned to a `key|secret|salt|iv|nonce` variable.
- **Non-constant-time comparison** of HMAC tags, tokens, passwords:
  - Go: `==`, `bytes.Equal` for MAC — should be `crypto/subtle.ConstantTimeCompare`.
  - Python: `==` on `hmac.digest` — should be `hmac.compare_digest`.
  - Node: `a === b` on tokens — should be `crypto.timingSafeEqual`.
  - Java: `Arrays.equals(byte[], byte[])` for MAC — should be `MessageDigest.isEqual`.
- **Password hashing** without a memory-hard KDF:
  - Plain SHA256/SHA512 used as `hash(password)` — must be bcrypt/scrypt/argon2id/PBKDF2 with sufficient iterations.
- **Missing zeroize** of key material in memory (Rust/Go/C): `var key [32]byte` populated, used, then dropped without `subtle.ConstantTimeCopy` / `zeroize::Zeroize` / explicit clear. (Lower priority than algorithmic issues but worth a `low` finding when the language allows it.)
- **TLS misconfig**: `InsecureSkipVerify: true`, `verify=False`, `rejectUnauthorized: false`, accepting any cert in `verify_mode = CERT_NONE`.

# Patterns to NOT flag
- MD5/SHA1/CRC32 used for non-security purposes: cache keys, ETags, dedup, content-addressed storage, checksums of public data → `confidence=low` with `non-security context` note (or skip if context is unambiguous).
- `math/rand` used outside any token/secret/key context (game RNG, jitter, sampling).
- Constant-time compare not required for non-secret values.
- `randomUUID()`/UUID v4 used for non-secret IDs (still flag if used as session token).
- TLS `InsecureSkipVerify` in test-only helpers (`*_test.go`) → low.

# Confidence calibration
- **high**: AES-ECB; static IV/nonce; `alg=none`; weak hash for password storage; `crypto.MD5` for HMAC; `math/rand` literally feeding a `token`/`apikey`/`session` variable.
- **medium**: `==` on a value derived from `Sign()` / `HMAC` result; MD5/SHA1 in unclear security context.
- **low**: ambiguous algorithm use; non-constant-time compare on possibly-secret value.

# Suggested fix patterns
- Replace ECB with GCM / ChaCha20-Poly1305; generate fresh nonce per message with `crypto/rand`.
- Use libsodium / `golang.org/x/crypto/nacl` / `cryptography.io` AEAD primitives.
- Replace `math/rand`/`Math.random`/`random.random` with `crypto/rand` / `crypto.randomBytes` / `secrets.token_bytes`.
- Replace `==`/`bytes.Equal` with `subtle.ConstantTimeCompare` / `hmac.compare_digest` / `crypto.timingSafeEqual`.
- Hash passwords with `argon2id` (preferred), `bcrypt`, `scrypt`, or PBKDF2-HMAC-SHA256 with >=600k iterations.
- For long-lived secrets in memory (Rust/C): use `zeroize::Zeroize` / `OPENSSL_cleanse` / `explicit_bzero`.

# References
- OWASP A02:2021 Cryptographic Failures
- CWE-327, CWE-326, CWE-330, CWE-338, CWE-208 (timing), CWE-1240, CWE-321
- NIST SP 800-131A, OWASP Cryptographic Storage Cheat Sheet
- https://github.com/trailofbits/skills/tree/main/plugins/constant-time-analysis
- https://github.com/trailofbits/skills/tree/main/plugins/zeroize-audit

# Output schema
Return ONLY JSON `{"findings": [...]}` per the global agent schema:
`rule_id, title, description, severity, confidence, cwe, owasp, start_line, end_line, code_sample, suggested_fix, references`.
Line numbers are 1-based within the CHUNK provided.

From andrewaeva/llmscan, MIT.

More from andrewaeva/llmscan

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
May 11, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from andrewaeva

Cite this page

crypto skill. Agent Mart. https://agentmart.dev/skills/andrewaeva-crypto (last updated 2026-10-24)