Performing Cryptographic Audit of Application
Overview
A cryptographic audit systematically reviews an application's use of cryptographic primitives, protocols, and key management to identify vulnerabilities such as weak algorithms, insecure modes, hardcoded keys, insufficient entropy, and protocol misconfigurations. This skill covers building an automated crypto audit tool that scans Python and configuration files for common cryptographic weaknesses.
When to Use
- When conducting security assessments that involve performing cryptographic audit of application
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Familiarity with cryptography concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Detect usage of deprecated algorithms (MD5, SHA-1, DES, RC4)
- Identify insecure cipher modes (ECB) and padding schemes
- Find hardcoded keys, passwords, and secrets in source code
- Verify TLS/SSL configuration strength
- Check key derivation function parameters
- Validate random number generator usage
- Produce a structured audit report with findings and remediation
Key Concepts
Cryptographic Weakness Categories
| Category |
Examples |
Risk Level |
| Weak Hashing |
MD5, SHA-1 for integrity/signatures |
High |
| Insecure Encryption |
DES, 3DES, RC4, Blowfish |
High |
| Bad Cipher Mode |
ECB mode for any block cipher |
High |
| Insufficient Key Size |
RSA < 2048, AES-128 for long-term |
Medium |
| Hardcoded Secrets |
Keys/passwords in source code |
Critical |
| Weak KDF |
Low iteration PBKDF2, plain MD5 |
High |
| Poor Entropy |
time-based seeds, predictable IVs |
High |
| Deprecated Protocols |
SSLv3, TLS 1.0, TLS 1.1 |
High |
Security Considerations
- Review both application code and configuration files
- Check third-party dependencies for known crypto vulnerabilities
- Verify certificates and TLS configurations on deployed servers
- Ensure secrets are loaded from environment variables or vaults
- Review key storage and rotation practices
Validation Criteria
1---2name: performing-cryptographic-audit-of-application3description: A cryptographic audit systematically reviews an application's use of cryptographic primitives, protocols, and key management to identify vulnerabilities such as weak algorithms, insecure modes, hardco4license: Apache-2.05---6# Performing Cryptographic Audit of Application
7
8## Overview
9
10A cryptographic audit systematically reviews an application's use of cryptographic primitives, protocols, and key management to identify vulnerabilities such as weak algorithms, insecure modes, hardcoded keys, insufficient entropy, and protocol misconfigurations. This skill covers building an automated crypto audit tool that scans Python and configuration files for common cryptographic weaknesses.
11
12
13## When to Use
14
15- When conducting security assessments that involve performing cryptographic audit of application
16- When following incident response procedures for related security events
17- When performing scheduled security testing or auditing activities
18- When validating security controls through hands-on testing
19
20## Prerequisites
21
22- Familiarity with cryptography concepts and tools
23- Access to a test or lab environment for safe execution
24- Python 3.8+ with required dependencies installed
25- Appropriate authorization for any testing activities
26
27## Objectives
28
29- Detect usage of deprecated algorithms (MD5, SHA-1, DES, RC4)
30- Identify insecure cipher modes (ECB) and padding schemes
31- Find hardcoded keys, passwords, and secrets in source code
32- Verify TLS/SSL configuration strength
33- Check key derivation function parameters
34- Validate random number generator usage
35- Produce a structured audit report with findings and remediation
36
37## Key Concepts
38
39### Cryptographic Weakness Categories
40
41| Category | Examples | Risk Level |
42|----------|----------|------------|
43| Weak Hashing | MD5, SHA-1 for integrity/signatures | High |
44| Insecure Encryption | DES, 3DES, RC4, Blowfish | High |
45| Bad Cipher Mode | ECB mode for any block cipher | High |
46| Insufficient Key Size | RSA < 2048, AES-128 for long-term | Medium |
47| Hardcoded Secrets | Keys/passwords in source code | Critical |
48| Weak KDF | Low iteration PBKDF2, plain MD5 | High |
49| Poor Entropy | time-based seeds, predictable IVs | High |
50| Deprecated Protocols | SSLv3, TLS 1.0, TLS 1.1 | High |
51
52## Security Considerations
53
54- Review both application code and configuration files
55- Check third-party dependencies for known crypto vulnerabilities
56- Verify certificates and TLS configurations on deployed servers
57- Ensure secrets are loaded from environment variables or vaults
58- Review key storage and rotation practices
59
60## Validation Criteria
61
62- [ ] Scanner detects all injected test weaknesses
63- [ ] MD5/SHA-1 usage for security purposes is flagged
64- [ ] ECB mode usage is flagged
65- [ ] Hardcoded keys/passwords are detected
66- [ ] Weak KDF parameters are identified
67- [ ] Report includes severity, location, and remediation
68- [ ] False positive rate is below 10%