Course contentsShow
← Security
Lesson 122 of 3,0523. Symmetric Cryptography Deep DiveFree lesson

Why Authentication Matters in Encryption

Understanding the difference between confidentiality and integrity, and why encryption alone doesn't prevent tampering.

Why Authentication Matters in Encryption

What you'll learn: Why encrypting data protects confidentiality but doesn't prevent an attacker from secretly modifying it.

When you encrypt data, you're making it unreadable to anyone without the key—you've achieved confidentiality. But here's the critical gap most beginners miss: encryption alone doesn't prove the data hasn't been tampered with. That requires integrity and authentication.

The Confidentiality vs. Integrity Gap

Imagine you send an encrypted letter in a locked box. The lock ensures only the recipient can read it (confidentiality). But what if someone intercepts the box, opens it with tools, changes some words, re-encrypts it with your key, and sends it along? Or worse: what if they just flip some bits in the ciphertext randomly? With many encryption modes, the recipient will decrypt something—they just won't know it's been corrupted or maliciously altered.

Real-World Example

In CBC mode (which you've learned), an attacker who flips a bit in ciphertext block N will corrupt that block when decrypted, but will cause predictable bit flips in block N+1. Without authentication, the victim has no way to detect this tampering. In CTR mode, bit flips in ciphertext translate directly to bit flips in plaintext—an attacker could change "100"to"100" to "900" without breaking the encryption.

Why This Matters

Encryption without authentication is like a sealed envelope that anyone can reseal after tampering. You need both:

  • Encryption protects confidentiality (reading)
  • Authentication protects integrity (tampering) and authenticity (who sent it)

This is why authenticated encryption modes like GCM (which you've studied) combine both: they encrypt and create an authentication tag that fails if anyone modifies even a single bit.

Key Takeaway: Encryption hides data from eavesdroppers but doesn't stop attackers from modifying it; always use authenticated encryption to protect both confidentiality and integrity.