01 — Foundations
The Encryption Process
Confidentiality is only the first goal. Real systems must also guarantee the message arrived untouched, and that it really came from who claims to have sent it.
Formal definition
Encryption E and decryption D with key k:c = E(k, m) # plaintext m → ciphertext c
m = D(k, c) # ciphertext c → plaintext m
# Correctness requirement (must hold for all m, k):
D(k, E(k, m)) = m
The key space K must be large enough that trying every k ∈ K (brute force) is infeasible — e.g. 2¹²⁸ for AES-128.Encryption alone buys only confidentiality. Two further properties must be engineered separately:
Integrity
Guarantees data has not been altered in transit. Achieved with hash functions and MACs. The receiver can verify the message is byte-for-byte identical to what the sender sent. Defends against active attackers who modify ciphertext.Authority / Authenticity
Proves who sent the message and that the sender cannot later deny it (non-repudiation). Achieved with digital signatures and certificates. The receiver verifies sender identity using a public key the sender cannot repudiate.Threat model — who are we defending against?
| Attacker | Capability | Defeated by |
|---|---|---|
| Passive eavesdropper | Reads everything on the wire, never modifies | Encryption (confidentiality) |
| Active tamperer | Flips bits, replays, reorders messages | Hash / MAC (integrity) |
| Impersonator | Injects messages claiming to be someone else | Signatures / certificates (authenticity) |
Why all three?
Encrypting alone gives no integrity — many modes (e.g. CBC without MAC) can be subtly tampered with. A hash alone gives no authenticity — anyone can compute it. Only a MAC or signature combines integrity + authenticity. Modern systems (TLS, AEAD like AES-GCM) bundle all three.The three goals at a glance
| Goal | Tool | Defends Against | Property |
|---|---|---|---|
| Confidentiality | Encryption (symmetric/asymmetric) | Eavesdropping | Hidden contents |
| Integrity | Hash, MAC | Modification, tampering | Untouched bytes |
| Authenticity | Digital Signature | Impersonation, repudiation | Provable origin |
Exam one-liner: Encryption = secrecy, Hash/MAC = untouched, Signature = provable origin. AEAD gives all three at once.