Cryptography is About Definitions, Not Secrets
Part 1 of 6. Encryption syntax, security parameters, perfect and semantic security, IND-CPA, and the reduction from a definition to a construction.
Outline — prose not written
The ramp stays concrete: define the scheme, see why perfect secrecy is too expensive, then introduce computational security and its game-based form.
Throughline
Security is not “the plaintext looks scrambled.” It is a quantified claim about an attacker, its resources, and what counts as winning.
1. Define the object before securing it
- A symmetric-key encryption scheme is :
- Explain the notation:
- allows randomized output.
- denotes deterministic assignment.
- indexes a family of schemes; for now, treat it as the security knob.
- Define correctness first:
- Note that some schemes, especially lattice-based ones, permit negligible decryption failure; return to that in Part 6.
- Introduce Kerckhoffs's principle: algorithms are public, while generated secret values remain secret.
- Use a substitution cipher to separate “large key space” from “secure.”
Reference: Katz–Lindell §2.1
2. First attempt: reveal absolutely nothing
- Work one one-time-pad example:
- Define perfect secrecy through identical ciphertext distributions:
- Give the equivalent posterior view:
- Explain why a uniform one-time-pad key achieves it.
- Show key reuse leaking the XOR of both messages:
- Use Shannon's theorem as the limit:
- Land the problem: perfect secrecy works, but securely distributing a message-sized one-use key is the problem encryption was meant to solve.
Reference: Katz–Lindell ch. 2; Shannon (1949)
3. The escape: computational security
- Weaken “identical distributions” to “no efficient algorithm can distinguish them.”
- Return to and define:
- adversary runtime:
- advantage: a function of
- acceptable advantage: negligible in
- Use examples to separate asymptotic and concrete claims:
| Function | Negligible? | Why |
|---|---|---|
| Yes | Eventually smaller than every inverse polynomial | |
| No | It is itself an inverse polynomial | |
| No, as a function of | Constant asymptotically, but tiny as a concrete probability |
- Distinguish three quantities often collapsed into “security parameter”:
- theoretical parameter
- concrete parameter sizes, such as an RSA modulus or AES key
- estimated security level, such as 128 bits of work
- Use the arithmetic as intuition only; not every scheme with costs to break.
Reference: Katz–Lindell §3.1
4. The intuitive goal: semantic security
-
State semantic security in the chosen-plaintext setting:
Given a ciphertext and allowed side information, an efficient attacker should learn no efficiently computable property of the plaintext that it could not predict without the ciphertext.
-
Use a concrete example: encrypting a salary should hide not only the amount but also predicates such as “is it above $100,000?”
-
Explain why “the attacker cannot recover the entire plaintext” is too weak.
-
Include equality and repeated-message leakage as useful counterexamples.
-
Explain why the semantic definition matches the real goal but is cumbersome to prove directly.
Reference: Goldwasser–Micali (1982); Katz–Lindell ch. 3
5. The equivalent game: IND-CPA
- State the bridge explicitly: semantic security under chosen-plaintext attack is equivalent to IND-CPA.
- Define the experiment:
- .
- The adversary queries an encryption oracle.
- It submits equal-length .
- The challenger samples and returns .
- The adversary may continue querying, then outputs .
- Require negligible advantage for every PPT adversary.
- Explain each design choice:
- equal lengths remove trivial length leakage
- oracle access models attacker-controlled plaintexts; for public-key encryption, anyone can encrypt already
- randomized encryption prevents direct comparison
- Give the equivalence intuition:
- learning a predicate distinguishes messages chosen to differ on that predicate
- distinguishing messages reveals a predicate of the hidden message
- Show deterministic encryption losing immediately.
- Use ECB as the visual example: AES remains sound, but deterministic composition leaks structure.
- Keep the proof boundary clear:
- a winning adversary disproves security
- failing to find one does not prove security
- a reduction proves that a winner would break an assumed-hard primitive
Figure to add — the ECB penguin
Add /figures/cryptography/ecb-penguin.png. The caption should separate the
secure primitive from the insecure deterministic mode.
Reference: Katz–Lindell ch. 3
6. From definition to construction
- Show the smallest PRF-based randomized scheme:
- State the requirements:
- is at least as long as
- is a secure PRF
- is fresh; collisions among polynomially many encryptions are negligible
- Sketch the hybrid proof:
- Replace with a truly random function using PRF security.
- Condition on a fresh .
- The challenge mask is uniform, so the hidden bit is independent of the ciphertext.
- Record the concrete bound:
- State what IND-CPA does not provide: ciphertext integrity or resistance to active tampering. That is the opening problem for Part 2.
Assumptions introduced
- One-way functions exist.
- PRFs can be constructed from one-way functions.
- Practical block ciphers such as AES are modeled as secure PRPs.
Go deeper
- Katz–Lindell ch. 2–3
- Boneh–Shoup ch. 2–5
- Goldwasser–Micali, Probabilistic Encryption (1982)
- Shannon, Communication Theory of Secrecy Systems (1949)
- Scribed applied cryptography notes, §2.1
Applied Cryptography: From Definitions to Computing on Secrets
A six-part series. Start with what "secure" even means, then build a secure channel, authenticate the other end, prove statements without revealing them, compute jointly on private inputs, and finally compute on data no one can see.
Building a Secure Messenger From Scratch
Part 2 of 6. Diffie–Hellman, key derivation, authenticated encryption, and the ratchets that protect past and future messages.