Course contentsShow
← Software Engineering
Lesson 1043 of 1,93332. Security EngineeringFree lesson

A02: Cryptographic Failures

Risks from weak encryption, exposed sensitive data, and improper cryptographic implementations.

A02: Cryptographic Failures

What you'll learn: How weak or missing encryption can expose sensitive data and compromise your application's security.

What Are Cryptographic Failures?

Cryptographic failures occur when sensitive data is inadequately protected through weak, missing, or incorrectly implemented encryption. This is the second most critical security risk in OWASP's Top 10 because it directly exposes user data to attackers.

Think of cryptography like a safe protecting your valuables. A cryptographic failure is like having a safe with:

  • A broken lock (weak encryption)
  • No lock at all (missing encryption)
  • The combination written on the door (poor key management)

Common Cryptographic Failures

Storing Sensitive Data in Plain Text: Transmitting passwords, credit cards, or personal information without encryption. We covered password hashing earlier—storing passwords as plain text is a classic cryptographic failure.

Using Weak Algorithms: Relying on outdated algorithms like MD5 or DES that can be cracked. Remember we learned about bcrypt, scrypt, and Argon2 for password hashing? Using weaker alternatives creates vulnerabilities.

Missing Encryption in Transit: Sending data over HTTP instead of HTTPS means attackers can intercept it (man-in-the-middle attacks).

Poor Key Management: Hardcoding encryption keys in source code, storing them alongside encrypted data, or failing to rotate them regularly.

Insufficient Randomness: Using predictable values for tokens, IVs (initialization vectors), or salts. Recall that salts prevent rainbow table attacks—but only if they're truly random.

Why This Matters

When cryptography fails, exposed data enables identity theft, fraud, and compliance violations (GDPR, PCI-DSS). Even if access controls are perfect (A01), weak cryptography can leak data directly.

Key Takeaway: Cryptographic failures expose sensitive data through weak encryption, missing protection, or improper implementation—always use proven algorithms, encrypt data in transit and at rest, and manage keys securely.