Objective
Verify that sensitive data is identified and protected throughout its lifecycle using cryptographic mechanisms that are appropriate for the data, threat model, application architecture and regulatory requirements.
Cryptographic failures occur when an application does not adequately protect information that requires confidentiality, integrity, authenticity or non-repudiation.
The review should cover more than simply checking whether HTTPS is enabled. It should consider data classification, encryption at rest and in transit, algorithms, protocols, certificates, password storage, secret handling, key generation, key storage, rotation and lifecycle management.
Scope
Review cryptographic protection across:
Prerequisites
| Authorization | Confirm authorization to inspect application configuration, network communication and cryptographic implementation. |
|---|---|
| Data classification | Identify sensitive and regulated data processed, stored or transmitted by the application. |
| Architecture | Understand application components, trust boundaries, storage systems and external integrations. |
| Cryptographic inventory | Obtain available information about algorithms, protocols, certificates, keys and cryptographic libraries. |
Methodology
The assessment should begin with the information being protected rather than with a particular cryptographic algorithm.
| Review area | Primary question |
|---|---|
| Data classification | What information requires protection? |
| Data lifecycle | Where is sensitive information created, transmitted, stored and destroyed? |
| Cryptographic mechanism | Is an appropriate cryptographic control used for the required security property? |
| Algorithm and protocol | Are approved and appropriately configured algorithms and protocols being used? |
| Key management | Are keys generated, stored, accessed, rotated and revoked securely? |
| Implementation | Does the implementation avoid exposing secrets or bypassing the intended cryptographic control? |
Test procedure
Sensitive data protection
The organization should explicitly identify information that requires protection. Cryptographic requirements should then be derived from the sensitivity and security requirements of that information.
Information about identifiable individuals, according to the applicable legal and organizational classification.
Passwords, authentication secrets, recovery secrets, session credentials and similar data.
Payment, transaction or financial information requiring protection.
API keys, encryption keys, signing keys, tokens and other credentials.
Information subject to specific statutory, regulatory or organizational protection requirements.
Confidential organizational information requiring controlled access and protection.
The requirement should be based on data classification, threat model, architecture and applicable requirements. Encrypting everything without a key-management strategy can create complexity without providing meaningful security.
Cryptographic mechanism review
| Mechanism | Review focus |
|---|---|
| Encryption | Determine whether an appropriate authenticated encryption or other approved mechanism is used for the required purpose. |
| Password storage | Verify that passwords are stored using an appropriate password hashing or password-based key derivation mechanism, rather than reversible encryption or unsalted fast hashes. |
| Hashing | Verify that hashing is used only where appropriate and that unsuitable legacy algorithms are not used for security purposes. |
| Digital signatures | Review signing algorithms, key protection, verification and trust-chain behavior. |
| Randomness | Security-sensitive values should use a cryptographically secure random number generator appropriate to the platform. |
Example of an insecure implementation
// Example only
$passwordHash = md5($password);
// Hardcoded encryption key
$key = "my-secret-key";
// Sensitive data transmitted without transport protection
http://example.invalid/api/account
The code above intentionally demonstrates insecure patterns for recognition during testing. It is not a remediation example.
Transport security
Verify that sensitive information is protected while crossing untrusted or partially trusted networks.
Example request
GET /account/profile HTTP/2
Host: application.example
Cookie: [redacted]
Response:
HTTP/2 200
Content-Type: application/json
HTTPS protects an applicable network connection. It does not protect sensitive information that is subsequently stored insecurely, logged, backed up without protection or exposed through application interfaces.
Cryptographic key management
Strong algorithms cannot compensate for poor key management. Review the entire lifecycle of cryptographic keys.
| Lifecycle stage | Verification question |
|---|---|
| Generation | Are keys generated using appropriate cryptographic mechanisms? |
| Storage | Are keys protected from unauthorized access and accidental disclosure? |
| Access | Is access restricted according to least privilege? |
| Rotation | Is there a practical process for replacing keys when required? |
| Revocation | Can compromised or obsolete keys be invalidated? |
| Destruction | Are retired keys handled according to organizational requirements? |
Cryptographic keys, API credentials and other sensitive secrets should not be embedded directly into source code or committed to public repositories. Use an appropriate secret-management mechanism and restrict access according to the application's requirements.
Example secret exposure
ENCRYPTION_KEY="production-secret-key"
API_TOKEN="production-api-token"
DATABASE_PASSWORD="production-password"
Assessment
| Condition | Assessment consideration |
|---|---|
| Appropriate protection | The sensitive information has appropriate protection throughout the relevant lifecycle. |
| Missing protection | Sensitive information is transmitted or stored without a required security control. |
| Weak cryptography | An obsolete, weak or inappropriate cryptographic mechanism is used. |
| Key exposure | Cryptographic keys or secrets can be accessed by unauthorized parties. |
| Poor key lifecycle | Keys cannot be appropriately rotated, revoked or replaced. |
| Insecure transport | Sensitive traffic can be transmitted without appropriate transport protection. |
Failure criteria
The application stores authentication passwords using an unsuitable fast hashing mechanism without an appropriate password-specific protection strategy. The implementation does not provide adequate resistance against offline password recovery if the stored credential data is compromised.
Remediation
Remediation should address both the cryptographic mechanism and the surrounding key-management process.
- Identify and classify all sensitive information.
- Map where sensitive information is transmitted, processed and stored.
- Define cryptographic requirements for each relevant data class.
- Use current, well-reviewed cryptographic algorithms and protocols appropriate to the use case.
- Use established platform or library cryptographic APIs rather than implementing cryptographic primitives manually.
- Store passwords using an appropriate password hashing or password-based key derivation mechanism.
- Protect cryptographic keys independently from the encrypted data where the architecture requires it.
- Remove hardcoded production secrets from source code.
- Restrict secret and key access using least privilege.
- Establish key rotation and revocation procedures.
- Protect sensitive network communication using appropriately configured secure transport.
- Review backups, logs, exports and temporary storage for unintended exposure.
Example remediation pattern
// Do not embed production secrets directly in source code.
// Application retrieves the required secret from an
// approved secret-management mechanism at runtime.
$encryptionKey = $secretManager->get("application/encryption-key");
// Use the key only for its intended purpose.
// Do not log or expose the key.
Custom encryption algorithms, custom password hashing schemes and ad-hoc cryptographic protocols are difficult to implement and review correctly. Prefer established, well-maintained cryptographic libraries and platform APIs.
Verification
Sensitive information has appropriate protection and the cryptographic implementation satisfies the application's documented requirements.
Required cryptographic protection remains absent, weak, improperly implemented or unnecessarily exposed.
The cryptographic control could not be adequately evaluated with the available access or evidence.
Evidence requirements
Redact passwords, private keys, encryption keys, API tokens, session secrets and other sensitive cryptographic material from screenshots, logs, source-code excerpts and reports.
Classification
| WebOTG procedure | WebOTG-CR-001 |
|---|---|
| OWASP category | A04:2025 — Cryptographic Failures |
| Procedure type | Cryptographic protection and sensitive data security review |
| Assessment result | PASS / FAIL / NOT TESTED |
| Finding severity | Determine according to the sensitivity of the affected information, exposure, exploitability, cryptographic weakness and resulting security impact. |
WebOTG-CR-001 is a WebOTG-defined verification procedure. The identifier is not an OWASP-defined test identifier.
References
| Source | Relevance |
|---|---|
| OWASP Top 10:2025 — A04 | Primary category definition for Cryptographic Failures. |
| OWASP Web Security Testing Guide | Testing guidance for cryptographic and transport-security assessment. |
| OWASP Application Security Verification Standard | Verification requirements related to cryptography, data protection and secure communication. |
| NIST Cryptographic Standards | Authoritative guidance and standards for cryptographic mechanisms and key management. |
| TLS protocol specifications | Technical reference for secure network transport. |
WebOTG should maintain authoritative source URLs, document versions and review dates through its content management system so that references can be updated without modifying the procedure structure.