Cryptographic Weakness Detection
Detection Workflow
- Identify cryptographic functions: Search for crypto-related function names, encryption/decryption operations, hash function usage
- Extract crypto parameters: Identify algorithms used, check key sizes and modes, examine IV/nonce handling
- Check for hardcoded secrets: Use
strings to find potential keys, search for common password/key patterns, analyze data sections for secrets
- Assess implementation security: Check for constant-time comparisons, verify proper padding, assess randomness of IVs/nonces
Key Patterns
- Weak algorithms: DES, 3DES, RC4, MD5, SHA1, ECB mode, small key sizes (<128 bits)
- Hardcoded secrets: passwords/passphrases, keys, IVs/nonces, magic numbers
- Insecure key management: keys embedded in code, plaintext storage, weak RNG, reused IVs/nonces
- Implementation issues: timing attacks, side-channel vulnerabilities, incorrect padding, missing authentication
Output Format
Report with: id, type, subtype, severity, confidence, location, algorithm, mode, key_size, issues, recommendation, cve_references, mitigation.
Severity Guidelines
- CRITICAL: Hardcoded private keys or passwords
- HIGH: Broken algorithms (DES, RC4) in security-critical code
- MEDIUM: Weak algorithms in non-critical code
- LOW: Minor crypto implementation issues
See Also
patterns.md - Detailed detection patterns and exploitation scenarios
examples.md - Example analysis cases and code samples
references.md - CWE references and mitigation strategies
1---2name: analyzing-crypto-weakness3description: Identifies weak cryptographic algorithms, hardcoded keys, and insecure key management practices in binary code. Use when analyzing encryption/decryption, authentication mechanisms, or reviewing cryptographic implementations.4---5
6# Cryptographic Weakness Detection
7
8## Detection Workflow
9
101. **Identify cryptographic functions**: Search for crypto-related function names, encryption/decryption operations, hash function usage
112. **Extract crypto parameters**: Identify algorithms used, check key sizes and modes, examine IV/nonce handling
123. **Check for hardcoded secrets**: Use `strings` to find potential keys, search for common password/key patterns, analyze data sections for secrets
134. **Assess implementation security**: Check for constant-time comparisons, verify proper padding, assess randomness of IVs/nonces
14
15## Key Patterns
16
17- Weak algorithms: DES, 3DES, RC4, MD5, SHA1, ECB mode, small key sizes (<128 bits)
18- Hardcoded secrets: passwords/passphrases, keys, IVs/nonces, magic numbers
19- Insecure key management: keys embedded in code, plaintext storage, weak RNG, reused IVs/nonces
20- Implementation issues: timing attacks, side-channel vulnerabilities, incorrect padding, missing authentication
21
22## Output Format
23
24Report with: id, type, subtype, severity, confidence, location, algorithm, mode, key_size, issues, recommendation, cve_references, mitigation.
25
26## Severity Guidelines
27
28- **CRITICAL**: Hardcoded private keys or passwords
29- **HIGH**: Broken algorithms (DES, RC4) in security-critical code
30- **MEDIUM**: Weak algorithms in non-critical code
31- **LOW**: Minor crypto implementation issues
32
33## See Also
34
35- `patterns.md` - Detailed detection patterns and exploitation scenarios
36- `examples.md` - Example analysis cases and code samples
37- `references.md` - CWE references and mitigation strategies