← Course index

CSC 514 / Fall 2026

Foundations of Cryptography

Security games, pseudorandomness, encryption, and the proof techniques that connect them.

01 / Topic atlas

Build the mental model

Original study notes synthesized from Fall 2026 course slides and practice materials.

Cryptography begins by refusing to call a scheme “secure” until the claim has a game. The challenger defines the world, the adversary receives exactly the capabilities named by the model, and advantage measures how much better the adversary performs than chance. Correctness says honest algorithms work; security says efficient attackers cannot create a forbidden outcome.

From there, the course builds a dependency chain. One-way functions make reversal difficult. Pseudorandom generators stretch short seeds. Pseudorandom functions turn a key into oracle behavior that looks random. Encryption, MACs, hashes, and signatures compose those primitives—but only when randomness, nonce use, domains, and attacker access match the proof.

The final skill is not memorizing constructions. It is learning to move between worlds: design a distinguisher for an insecure object, build a reduction for a secure one, or use hybrids when one large jump hides several smaller assumptions.

01
Start with the game

Security models & indistinguishability

Modern cryptography defines security by what an efficient adversary can distinguish or predict. A claim is only meaningful after the experiment, adversary capabilities, and winning condition are explicit.

  • A security parameter controls key sizes and the adversary’s resource bounds.
  • Negligible advantage shrinks faster than the inverse of every polynomial.
  • Kerckhoffs’s principle keeps the algorithm public and places secrecy in the key.
02
Information-theoretic security

One-time pads & perfect secrecy

The one-time pad XORs a uniformly random key with a message of equal length. Every ciphertext is compatible with every plaintext, so observation does not update the attacker’s belief about the message.

  • Correctness: decrypting c = m ⊕ k with k returns m.
  • A key must be uniformly random, message-length, secret, and never reused.
  • Reusing a key exposes m₁ ⊕ m₂ because c₁ ⊕ c₂ cancels the key.
03
Stretching short secrets

PRGs, PRFs & one-way functions

A pseudorandom generator expands a short random seed into a longer string that efficient distinguishers cannot tell from uniform. A pseudorandom function gives oracle behavior indistinguishable from a truly random function.

  • A PRG must stretch: output length is greater than seed length.
  • A PRF is keyed, deterministic, and evaluated on many inputs.
  • A structural pattern in outputs often becomes a distinguisher.
04
Turn an attack into a contradiction

Reductions & hybrid arguments

A reduction assumes an adversary breaks the constructed scheme, then uses that adversary as a subroutine to break a primitive already assumed secure. Hybrids bridge two experiments through small changes.

  • State the theorem and the contradicting assumption before constructing the reduction.
  • The simulation must give the adversary the view expected in each challenger case.
  • A hybrid proof bounds total advantage by the sum of adjacent distinguishing gaps.
05
Chosen-plaintext reasoning

Computational encryption & CPA security

CPA security asks whether an efficient adversary with encryption-oracle access can distinguish encryptions of two equal-length messages. Randomization or nonces prevent repeated plaintexts from revealing repeated ciphertext patterns.

  • The challenge messages must have equal length to avoid a trivial length leak.
  • The adversary may adapt oracle queries around the challenge.
  • Nonce uniqueness and unpredictability have different requirements across constructions.
06
Integrity needs a key

MACs, unforgeability & domain separation

A message authentication code lets parties sharing a key detect modification and authenticate origin within that key-sharing group. The unforgeability game gives the adversary a tagging oracle, then asks for a valid tag on a message not previously queried. Deterministic verification is not enough: the construction must resist chosen-message attacks.

  • A replayed valid message is not a cryptographic forgery, so protocols need freshness separately.
  • Domain separation prevents the same primitive input from meaning two different things.
  • Encrypt-then-MAC authenticates the ciphertext before decryption and avoids exposing decryption behavior.
07
Compression under attack

Hash security & the birthday boundary

A cryptographic hash compresses arbitrary input into a fixed-length digest. Preimage, second-preimage, and collision resistance describe different attacker tasks. Collisions must exist whenever the domain is larger than the range; security requires that an efficient adversary cannot find one.

  • An n-bit digest offers roughly 2ⁿ preimage work but only 2ⁿᐟ² generic collision work.
  • Collision resistance implies stronger protection than merely hiding an input.
  • A public hash key in the formal model prevents an attacker from hard-coding one collision for every security parameter.
08
From compression to arbitrary messages

Merkle–Damgård, padding & HMAC

Merkle–Damgård iterates a fixed-length compression function over padded blocks and carries a chaining value forward. Length-strengthening padding makes the encoding unambiguous. The collision-resistance proof traces equal final digests backward until it finds two different compression-function inputs with the same output.

  • Plain secret-prefix hashing can expose length-extension behavior.
  • HMAC wraps the hash with distinct inner and outer domains.
  • The reduction’s collision is located at the last point where two computation paths merge.
09
Public verification

Digital signatures & authenticity

A signature scheme separates signing authority from verification. The secret key signs; the public key verifies. Existential unforgeability under chosen-message attack asks an adversary with signing-oracle access to produce a valid signature for a new message.

  • Signatures do not provide confidentiality.
  • Hash-then-sign needs a collision-resistant encoding and a signature scheme designed for that composition.
  • Canonical serialization prevents two interpretations of the same signed bytes.
10
Choose the right proof shape

Reductions, hybrids & attacks as a workflow

Start by naming the exact security game and the primitive assumption. For a secure construction, assume an efficient breaker and route its view through a reduction. For an insecure construction, identify a visible invariant and calculate a non-negligible distinguishing or forgery advantage.

  • A reduction must simulate every oracle and challenge consistently.
  • Abort probability and guessing steps belong in the advantage calculation.
  • A proof that invokes the right assumption but gives the adversary the wrong distribution is not a proof.

02 / Interactive model

Play the security game

Choose a security definition, then move through the challenger, adversary, and winning condition.

03 / Proof lab

Build the argument,
then inspect the why.

Choose a secure reduction or an insecurity proof. Fill the missing proof ideas, check the structure, then switch on explanation mode to annotate each move.

04 / Math sandbox

Choose a problem.
Change the evidence.

Every solver shows the equation, substituted values, units, and result. Calculations stay in the browser.

Worked result—

Select values to begin.

05 / Vocabulary

Language is infrastructure.

49 definitions are connected to the narrative above through hover and keyboard-focus tooltips.

01

adversary

An algorithm that attempts to violate a stated security experiment.

02

advantage

How much better an adversary performs than the experiment’s baseline chance.

03

negligible

A function smaller than the inverse of every polynomial beyond some point.

04

security parameter

An input, commonly written 1ⁿ, that scales keys, work, and error bounds.

05

perfect secrecy

A ciphertext reveals no information about its plaintext, even to an unbounded attacker.

06

one-time pad

Encryption c = m ⊕ k using a uniform, message-length key exactly once.

07

PRG

A deterministic algorithm whose stretched output is computationally indistinguishable from uniform.

08

PRF

A keyed function family computationally indistinguishable from a random function to an oracle user.

09

distinguisher

An algorithm that identifies which of two distributions or experiments produced its view.

10

reduction

An algorithm that converts a successful attack on one construction into an attack on an assumed-secure primitive.

11

hybrid argument

A proof that moves between experiments through a sequence of small indistinguishable changes.

12

CPA security

Indistinguishability under chosen-plaintext attack.

13

PPT

Probabilistic polynomial time: the standard model for an efficient randomized algorithm.

14

correctness

The requirement that honest encryption/decryption, signing/verification, or related algorithms produce the intended result.

15

computational security

Security against efficient adversaries rather than against unlimited computation.

16

indistinguishability

The inability of an efficient algorithm to tell two experiments or distributions apart with non-negligible advantage.

17

oracle

A black-box interface an adversary may query under the rules of a security game.

18

challenge bit

A hidden random bit selecting which world or message the challenger uses.

19

OWF

One-way function: easy to evaluate but hard to invert on a random image.

20

hard-core predicate

A bit of an input that remains computationally unpredictable from the function output.

21

stretch

The number of output bits a PRG produces beyond its seed length.

22

uniform distribution

A distribution assigning equal probability to each element of its finite support.

23

entropy

A measure of uncertainty; cryptographic keys need enough unpredictable entropy, not merely a large format.

24

nonce

A value intended to be used once within the scope required by a construction.

25

IV

Initialization vector: a mode-specific starting value whose uniqueness or unpredictability requirements depend on the scheme.

26

IND-CPA

Ciphertext indistinguishability against an adversary with chosen-plaintext oracle access.

27

IND-CCA

Ciphertext indistinguishability against an adversary with chosen-ciphertext access, subject to challenge restrictions.

28

semantic security

The idea that a ciphertext reveals no efficiently computable partial information about its plaintext beyond permitted leakage.

29

MAC

Message authentication code: a keyed tag providing integrity and shared-key origin authentication.

30

EUF-CMA

Existential unforgeability under chosen-message attack.

31

forgery

A new message/tag or message/signature pair accepted by verification under the game’s freshness rule.

32

domain separation

Using distinct encodings or labels so primitive calls serving different roles cannot collide semantically.

33

preimage resistance

Given a digest, finding any input that hashes to it should be infeasible.

34

second-preimage resistance

Given one input, finding a distinct input with the same digest should be infeasible.

35

collision resistance

Finding any two distinct inputs with the same digest should be infeasible.

36

birthday bound

Collisions in an n-bit random-looking output appear after roughly 2ⁿᐟ² samples.

37

compression function

A fixed-input-length function whose output is shorter than its input.

38

Merkle–Damgård

A domain-extension transform that iterates a compression function over padded message blocks.

39

length strengthening

Padding that includes the original message length to make block encodings unambiguous.

40

length extension

The ability to continue some iterative hashes from a digest without knowing the original message.

41

HMAC

A standardized nested hash-based MAC using distinct inner and outer padded keys.

42

random oracle

An idealized public function returning consistent independent random outputs for new inputs.

43

digital signature

A public-verification authenticator produced with a private signing key.

44

hybrid

One experiment in a sequence where adjacent games differ by a controlled change.

45

game hop

A justified transition between adjacent security experiments.

46

simulation

The view a reduction constructs for its internal adversary using its own challenger interface.

47

abort event

A condition causing a reduction to stop without using the adversary’s result, reducing success probability.

48

tightness

How much security or success probability a reduction loses relative to its adversary.

49

black-box reduction

A reduction that uses an adversary through its input/output behavior without inspecting its implementation.

06 / Retrieval practice

Generate a fresh set.

Questions and answer order shuffle each time. Explanations appear only after submission.

?

Your generated questions will appear here.