COMS W4181 · Security I · Fall 2026 · Lecture 1

Introduction &
Threat Models

Columbia University

$ ./think --like-an-adversary goal -> threat model -> mechanism -> break it
QR code for the course page course page
[!] First thing: the class time changed
4:10–5:25 PMMonday and Wednesday. This is the correct time.
4:10–6:00 PMwhat was listed earlier. That was wrong.
  • 75 minutes, not 110. Same days, same room, 702 Hamilton Hall.
  • The course page and the schedule are updated. If you have the old time in your calendar, fix it now.
  • Tell a classmate who is not here today.
[+] About me
Zhuo Zhang, as a LEGO figure

I am Zhuo Zhang. Please call me Zhuo or ZZ.

  • Assistant professor in Columbia CS. My office is CSB 457.
  • What I work on: security for software systems, both traditional ones and AI-driven ones.
  • Where I come from: I was an avid CTF player, and I still do hard-core hacking and open-source work.
  • Website: zzhang.xyz. The course page lives there too.
[+] Your teaching assistants
Annie Wang
Madalina Stoicov
Nitish Ramaraj
[email protected]
@nitishramaraj
SeungHyun Sung
  • Office hours are on a shared Google Calendar. Scan the code, or use the link on the course page.
  • Competition emails go to all four TAs, with me in CC. They run the setup session and check every proof of concept.
  • The handle under each name is their GitHub account. You will see them in the competition repositories.
QR code for the TA office hours calendar TA office hours
[+] Where and when
The entrance of Hamilton Hall, Columbia University Hamilton Hall. We are in room 702. Photo: Beyond My Ken, CC BY-SA 4.0, Wikimedia Commons.
  • Monday and Wednesday, 4:10 to 5:25 PM. 26 classes. The first one is today, the last one is Dec 14.
  • 702 Hamilton Hall, this room.
  • My office is CSB 457. The TAs' office hours are on a shared Google Calendar, QR code on the TA slide. Mine are TBA.
  • No class on Mon Nov 2 (academic holiday) and Wed Nov 25 (Thanksgiving).
[+] Where we are going
  • 01How this course works: goals, grading, the competition, the rules
  • 02Adversarial thinking: the mindset, and its three questions
  • 03Three announcements: the final exam, a new competition rule, the round weights
  • 04Recap: security goals and threat models, in plain words
  • 05A worked example: an election, from goals to attacks. Then money, and who the adversary is

First we go through how the course works. Then the lecture proper: a way of thinking, and one everyday example with no computers in it. The way of thinking is exactly the same when there are.

[+] Course goals

Understand the fundamental principles of security.

  • What are the common security mechanisms? Why do they often go wrong?
  • What are the underlying principles behind building secure systems?
  • Why is building secure systems hard?
[ 01 ]

How this course works

Grading, deadlines, the competition, and the rules. All of it is also on the course page.

[+] The course, top-down your course grade curved at the end, median B+ 30% homework + midterms two units of 15% each homework 20% + midterm 80% same problems, new numbers 30% final exam required, Mon Dec 21 no make-up written exam oral exam if you miss it 40% hacking competition round 1: 20%, round 2: 80% plant one bug, hunt the rest curved: class median at 85% +1 extra credit, per item added before the curve attendance, in reverse: +1 bug bounty: +1 per bug

Three parts add up to 100%. Extra credit goes on top, before the curve. The next slides take each part in turn.

[+] Homework and midterms: 30% HOMEWORK 1 Problem 1 · n = 128 Problem 2 · p = 61, q = 53 Problem 3 · key = 0x2a due Tue Oct 6, 11:59 PM · no late days MIDTERM 1 Problem 1 · n = 256 Problem 2 · p = 67, q = 71 Problem 3 · key = 0x3f Wed Oct 7, in class, the day after same problems numbers tweaked ONE UNIT = 15% OF THE COURSE GRADE · TWO UNITS IN TOTAL homework 20% midterm 80%

Do the homework yourself, and the midterm will look familiar.

Homework 2 and Midterm 2 work the same way: due Tue Nov 10, 11:59 PM, exam Wed Nov 11. If you miss a midterm you take an oral exam instead, and the homework does not count for that unit.

[+] The final exam: 30%
30%of the course grade
Mon Dec 213:30–6:30 PM
requiredno exceptions
  • There is no make-up written exam. If you cannot attend a midterm or the final, you take an oral exam instead.
  • For a midterm taken orally, the homework is not taken into consideration. The oral exam alone decides that unit.
  • The room goes on the course page as soon as the registrar confirms it. Block the afternoon now.
[+] The hacking competition: 40%

Everyone plants a bug. Then everyone hunts for everyone else's bugs.

PREPARATION PHASE ATTACK PHASE pick a program a real open-source project jq, zstd, ripgrep, LuaJIT plant one bug a crash: segfault or abort the tests must still pass read everyone's code every submission is public the diff and all find their bugs prove each with a script as many as you can DEFENSE nobody finds your bug by the end of the round -> you keep the full defense score ATTACK every bug you find in someone else's program -> attack points, plus first blood if you are quick

Two rounds of this. It is the most fun part of the course, and I think the part that teaches the most.

[+] You hunt everyone, and everyone hunts you you your program hides 1 bug Alice hides 1 bug Bob hides 1 bug Carol hides 1 bug Dave hides 1 bug Eve hides 1 bug Frank hides 1 bug you hunt in their programs as many as you like and they hunt in yours everyone can read your diff found, first blood found alone, first blood too not found not found yours survived

Two bugs found: attack points twice, first blood twice, since alone on a bug means first. Your own bug survived: the full defense score. Bob and Eve come back on the scoring examples. We will put up a leaderboard soon: refreshed every week or two, and right away when a bug gets found.

[x] What counts as a bug
on facebook/zstd, say
$ ./compile.sh && ./test.sh [ok] 1975/1975 tests passed # healthy $ ./poc.sh build, then run the crafted input ... Segmentation fault (core dumped) $ echo $? 139
Counts A segmentation fault, an abort, or a similar fatal signal, reached from normal program input.
Does not count Wrong output, a hang, running out of memory, or anything that needs a change to the build or test scripts.
And the tests still pass A bug that breaks the test suite is not a hidden bug, it is a broken program.
[+] Pick a program from the project list
  • About 130 real programs so far, each a fork pinned to the commit ProgramBench was built from, with compile.sh and test.sh at the root.
  • Tests kept must be a number. N/A means the project is not ready yet.
  • The TA checkboxes mean validated. Only validated projects are eligible.
  • Used in round shows what earlier rounds touched. The fresh-project bonus looks at that column.
The project list table in the competition repository on GitHub github.com/ZhangZhuoSJTU/Columbia-COMS-W4181-Security1-project-list
[!] A hint for defenders: everyone can run diff
found in minutes
$ git diff main..pr-7 --stat src/parse.c | 3 ++- 1 file changed, +2 -1
good luck
$ git diff main..pr-12 --stat src/parse.c | 184 ++++++++----- src/buffer.c | 97 +++++--- src/util.h | 41 +++- 6 files changed, +322 -208
  • Make the diff bigger than the bug. Refactor around it.
  • Add semantically equivalent changes. Same behaviour, more to read.
  • Touch several files. One file with one hunk is a signpost.
  • Mind the cap: at most 15% of the original lines of code. Counted after clang-format, rustfmt, or gofmt, so one giant line does not help.
  • Keep it honest: obfuscate the diff, never the build or test scripts. Touch those and you are disqualified for the round: 0 points, attack included.
[+] Competition timeline ROUND 1 ROUND 2 prepare 17 days attack 28 days prepare 14 days attack 28 days start looking early Sep 16 · setup Oct 2 · PR due Oct 30 · attack ends Nov 13 · PR due Dec 11 · attack ends SEP OCT NOV DEC Sep 20 · register Oct 7 · Midterm 1 HW1 due Oct 6 Nov 11 · Midterm 2 HW2 due Nov 10 final Dec 21

Round 1: prepare Sep 16 to Oct 2, attack Oct 3 to Oct 30. Round 2: prepare Oct 31 to Nov 13, attack Nov 14 to Dec 11. The project list is public from day one, so you can look early.

Competition deadlines are 11:59 PM by the system clock, GitHub for pull requests and CourseWorks for attack PoCs. Homework is different: due at 11:59 PM the day before its midterm, with no late days.

[+] Competition scoring, per round

Five scores. A, B, C, and D are weights, and I announce the numbers at the start of each round. Round 1 counts 20% of the competition, Round 2 the other 80%.

ScoreYou get it whenPoints
Submissionyour pull request is in on timeA. Each late day costs A/3, at most two.
Defensenobody finds your bug by the end of the attack phaseB, all or nothing
Attackyou find someone else's bugB / n, shared with the n people who found it
First bloodyou are among the first three to find a bugC, 0.8 C, 0.6 C, in order
Fresh projectyours is the first valid pull request on a project no round has usedD, to that one student
$ round = submission + defense + attack + first_blood + fresh
[+] Scoring, a worked example (1/2) ONE ROUND, FOR YOU · EXAMPLE WEIGHTS A = 50, B = 50, C = 10, D = 5 A 50 [1] pull request opened on time submission + 50 B 50 [2] nobody found your bug by the end of the attack phase defense + 50 B/2 25 [3] you found Bob's bug; 2 people found it, so 50 / 2 each attack + 25 C 10 [4] and you were the first one on Bob's bug first blood + 10 B 50 [5] you found Eve's bug, and nobody else did: 50 / 1 attack + 50 C 10 [6] alone on Eve's bug means you were first there, too first blood + 10 D 5 [7] your project was fresh, and yours was the first valid PR fresh project + 5 round total, before the curve = 200

Alone on a bug means first blood on it too. Two days late, the most you can be, would have made line [1] 50 × (1 − 2/3), about 16.7; a third day and the pull request is out. Round 1 counts 20%, Round 2 counts 80%, and the weighted total is curved.

[+] Scoring, a worked example (2/2) SAME WEIGHTS, A WORSE ROUND: ONE DAY LATE, YOUR BUG FOUND, THIRD ON BOB'S BUG, PROJECT NOT FRESH A 33.3 late 0 [1] pull request opened one day late: 2A/3 submission + 33.3 B lost 0 [2] Carol found your bug on day 9, and Frank on day 20 defense, lost + 0 B/3 16.7 [3] you found Bob's bug; 3 people found it, so 50 / 3 each attack + 16.7 0.6C 6 [4] and you were the third one on Bob's bug: 0.6 C first blood + 6 B 50 [5] you found Eve's bug, and nobody else did: 50 / 1 attack + 50 C 10 [6] alone on Eve's bug means you were first there, too first blood + 10 D [7] your project was used in an earlier round: no fresh bonus fresh project, none + 0 round total, before the curve = 116

One day late keeps two thirds of A. Defense is all or nothing: two finders or twenty, the 50 is gone. Third on Bob's bug still pays, a third of B plus 0.6 C. The dashed boxes are what example 1 had and this round does not.

[+] From competition points to a grade round 1 + round 2 your raw points, added up competition curve class median -> 85% 40% of the course next to 30% + 30% exams course curve median B+
  • Add up your two rounds. Every score on the previous slide, both rounds.
  • I curve that total so that the class median sits at 85% of the competition points.
  • The curved number is 40% of your course grade, next to 30% for homework and midterms and 30% for the final.
  • The course grade is curved once more, with the median at B+. Extra credit is added before this curve.
[!] Competition rules (1/2)
  • One program, one bug, per round. You pick from the project list. Two students may pick the same program, but the fresh-project bonus goes to the earlier valid pull request.
  • The system clock is the time. Submission: when your pull request was opened on GitHub. Attack: when your PoC landed on CourseWorks. Emails do not count.
  • Crash means crash. A segmentation fault, an abort, or a similar fatal signal. Wrong output, hangs, and running out of memory do not count.
  • The tests still pass. Your program must build and pass the project's test suite. Touch the build or test scripts, or the test data, and you are disqualified for the round: 0 points.
[!] Competition rules (2/2)
  • PoCs are private, pull requests are public. Your defense PoC goes on the pull request as a zip locked with your password. Attack PoCs go through CourseWorks, named victim-attacker-poc.sh.
  • Late days, on submission only. Each late day costs a third of the submission score. After two late days the pull request no longer counts, but you can still attack in that round.
  • Your own work. Talking about techniques is fine. Sharing diffs, PoCs, crashing inputs, or passwords is an integrity violation.
  • Stay in bounds. Attack the pull requests in our forks and nothing else. GitHub itself, the TAs' machines, and other students' accounts are off limits.
[+] Extra credit
+1
Attendance, in reverse
Attendance is not required. But if fewer than one third of the class shows up to a lecture, everyone who is there gets one extra-credit point.
An empty lecture hall A room like this is worth a point to everyone in it. Photo: Yinan Chen, public domain.
+1
Bug bounty
Find a real bug in any GitHub project with more than 1,000 stars and get it confirmed by the maintainers. Follow the project's security policy, and do not go public before the fix.
The teaching bug bounty leaderboard page The bug bounty leaderboard on my site, with your name on it.

Extra credit is added before the curve. There may or may not be a cap on bug bounty points. If someone hits it, I will say so right away, so nobody keeps hunting for nothing.

[+] What to do this week
  1. Bookmark the course page. Schedule, policies, grading, and every lecture deck live there.
  2. Wed Sep 16: bring a laptop. No lecture that day. The TAs help you set up the competition environment.
  3. By Sun Sep 20, 11:59 PM: register. One email to the TAs, CC me, with your UNI, your GitHub handle, and a competition password you use for nothing else.
  4. Read the competition page. The submission steps and the full scoring are there. We do not go through the mechanics today.
QR code for the course page zzhang.xyz/teaching/security1-fall26
The course page The competition page is linked from it.
[ 02 ]

The art of
adversarial thinking

The most useful habit you will take from this course.

[+] What is adversarial thinking?

“Security requires a particular mindset. Security professionals - at least the good ones - see the world differently. They can't walk into a store without noticing how they might shoplift. They can't use a computer without wondering about the security vulnerabilities. They can't vote without trying to figure out how to vote twice. They just can't help it.”

— Bruce Schneier

[!] Adversarial thinking: a disclaimer

Hopefully you will learn to think like a criminal mastermind but behave like a gentleperson.

We teach these attacks so you can defend against them. Running them against systems you do not own, or have no permission to test, is a crime. And Columbia's academic integrity policy applies to everything you do in this course.

[+] Adversarial thinking: three key questions [ 1 ] Security goal what policy must hold? [ 2 ] Threat model who is the adversary, and what can they do? [ 3 ] Mechanism what enforces the goal against that adversary? then attack the mechanism, and see what the adversary can still do

No mechanism is “secure” by itself. It is secure for a given goal, against a given adversary.

[+] Key security goals
[C]
Confidentiality
Data not leaked.
Nobody unauthorized learns it.
[I]
Integrity
Data not modified.
Nobody unauthorized changes it.
[A]
Availability
Data is accessible when needed.
Nobody can deny it to you.
[T]
Authenticity
Data origin cannot be spoofed.
It is really from who it claims.

Almost every goal we will see this semester is one of these four, or a mix of them.

[+] You can apply adversarial thinking anywhere
  • Columbia ID cards Can you fake an ID card? What does the reader check, and what does the person at the door check?
  • ATM machine How does the service person get access to refill it with cash? Can you look like the service person?
  • MTA MetroCard Can you increase the card balance without paying? Where does the balance live, on the card or on a server?

Try this on anything you used today.

[ 03 ]

Before we continue:
three announcements

The date of the final exam, one new competition rule, and how the two competition rounds are weighted. All three are on the course page as well.

[!] Announcement 1: the final exam
Mon Dec 21one week after the last class, which is Mon Dec 14
3:30–6:30 PMthree hours, in the afternoon
30%of your course grade
  • Block that afternoon now. Put it in your calendar today, and do not book travel that leaves before the evening of December 21.
  • The room is not confirmed yet. The registrar assigns it. As soon as I have it, it goes on the course page, and I will say it in class too.
  • There is no make-up written exam. If you really cannot attend, you take an oral exam with me instead. Email me as early as you can.
  • The exam is required for everyone. It is one of the three parts of the grade: 30% homework and midterms, 30% final, 40% competition.
[!] Announcement 2: a new competition rule (1/2)
The rule, exactly as it is written on the competition page Your change may touch at most 15% of the program's original lines of code, counted after formatting.

That is one sentence with three pieces. Here is what each piece means.

  • “Touch” means lines added plus lines removed, the two numbers that git diff --stat prints. A line you edit counts twice: once as removed, once as added.
  • “Original lines of code” is the size of the program before your change: the line count of the tree in our fork, the one you started from.
  • “Counted after formatting” means we format both trees first, the original and yours, with the same formatter at default settings, and only then diff them. So squeezing ten statements onto one line does not shrink your diff.
  • The formatters: clang-format for C and C++, rustfmt for Rust, gofmt for Go. Run the one for your language yourself before you count.
[!] Announcement 2: the cap, with numbers (2/2) say your program is 20,000 lines long
$ clang-format -i original/**/*.c mine/**/*.c # C: same formatter, both trees $ wc -l original/ # the size before your change 20000 total $ git diff --stat original mine # after formatting 14 files changed, 2000 insertions(+), 800 deletions(-) touched = 2000 + 800 = 2800 cap = 15% of 20000 = 3000 2800 <= 3000 [ok] a valid submission 3300 > 3000 [x] not valid
  • Why have a cap at all? In the attack phase everyone reads every pull request. Without a cap, someone could rewrite half the program and nobody could read anything. The cap keeps the game about hiding a bug well.
  • Over the cap means not a valid submission. It is as if you had not submitted for that round. So check the size before you open the pull request, and leave yourself some margin.
[!] Announcement 3: Round 1 is 20%, Round 2 is 80% YOUR COMPETITION POINTS, BEFORE THE CURVE Round 1 20% Sep 16 to Oct 30 Round 2 80% Oct 31 to Dec 11
$ competition_points = 0.2 × round_1 + 0.8 × round_2 # then curved, then 40% of the course
  • Why not 50 / 50? Because Round 1 is a warm-up. Most of you have never planted a bug or hunted for one. Round 1 is where you learn how the game is played: how people hide bugs, how people find them, what a good diff and a good proof of concept look like.
  • So a rough Round 1 does not sink you. A mistake in Round 1 costs a quarter of what the same mistake costs in Round 2.
  • Round 2 is where the points are. Take every attack and every defense you learned in Round 1, and use it there.
[!] Announcement 3: the same rule, with numbers
StudentRound 1Round 20.2 × R1 + 0.8 × R2Points
Alice10020020 + 160180
Bob20010040 + 80120
Carol6020012 + 160172
  • Alice and Bob both scored 300 raw points. Alice ends 60 points ahead, because her good round was the one that counts four times as much.
  • Carol had a weak Round 1 and a strong Round 2. She lands within 8 points of Alice. That is the whole point of the weighting: learn in Round 1, deliver in Round 2.
  • These points are then curved, so that the class median sits at 85%, and the curved number is 40% of your course grade.
[ 04 ]

Recap: security goals
and threat models

Last time we ended with three questions and four goals. Before we use them on a real example, here they are again, in plain words.

[+] Recap: adversarial thinking asks three questions
[1]
Security goal
What do we want to stay true, no matter who tries to break it? One sentence about the system, not about the attacker.

Example: nobody but me reads my diary.
[2]
Threat model
Who might try to break it, and what can they do? A list of the adversary's abilities, and of what we assume they cannot do.

Example: my little brother. He can open drawers, but he cannot pick a lock.
[3]
Mechanism
What we build, or what we do, so that the goal holds against that adversary.

Example: a locked drawer. Enough against my brother. Not enough against my father, who can simply order me to open it, suspecting I hide wine in there.

“Is it secure?” is not a full question. The full question is: does this mechanism keep this goal, against this adversary?

[+] Recap: the four security goals, in plain words
[C]
Confidentiality
Nobody who should not see the data gets to see it.

Diary: nobody else reads it.
[I]
Integrity
Nobody who should not change the data gets to change it.

Diary: nobody adds a page or erases one.
[A]
Availability
The data, or the service, is there when you need it.

Diary: I can open it whenever I want. Nobody takes it away.
[T]
Authenticity
The data really comes from where it says it comes from.

Diary: a page signed “me” was really written by me.
  • Every goal you will write this semester is one of these four, or a mix of them. When you write a goal down, say which letter it is.
  • Goals can pull against each other. We will see it today: a vote that is easy to check is hard to keep secret.
[+] The method we will follow today, top-down
  1. Describe the system in plain words, as if everyone were honest. What goes in, what comes out, who does what.
  2. Write down the security goals. One sentence each, and say which of the four goals it is.
  3. Write down the threat model. Who might attack, what they want, what they can do, and what we assume they cannot do.
  4. Choose a mechanism for each goal. Something you build, or a procedure that people follow.
  5. Attack it. For each goal and each adversary, ask: does the mechanism still hold? Where it does not, you have found a gap. Fix it, or write down that you accept it.

That is the whole lecture, and most of the course. Today we run it on an election.

[ 05 ]

Worked example:
an election

No computers anywhere. We describe the system, write down the goals, name the adversaries, choose the mechanisms, and then try to break them.

[+] Step 1: the system, with everyone honest

A town of 1,000 people elects a mayor. Two candidates, A and B. Here is election day.

[1] show up a resident walks into the town hall [2] get a ballot a worker hands you one paper ballot [3] mark it A or B, with a pencil, alone in a booth [4] drop it in fold it, put it in the ballot box [5] count at 8 PM the workers open the box and count the candidate with more votes is the new mayor
  • The rules, when everyone is honest: every resident over 18 may vote, each person votes once, and the candidate with more votes wins.
  • This is the correctness story: what the system does with honest people. Security starts at the next question: what happens when someone is not honest?
[+] Step 2: what do we want to stay true? Four goals
G1 · one person, one vote Authenticity [T]. Only residents over 18 vote, each of them once. Every counted ballot came from a real voter.
G2 · the count is honest Integrity [I]. Every ballot in the box is counted as it was marked. Nothing is added, lost, or changed.
G3 · the vote is secret Confidentiality [C]. Nobody can learn how you voted. Not the workers, not the candidates, not even if you want to prove it.
G4 · the election happens Availability [A]. Everyone who wants to vote can, and the result is out on election night. Nobody can shut it down.

G3 has a strange tail: you cannot prove your own vote, even if you want to. In a few slides you will see why. It is what makes buying votes pointless.

[+] Step 3: who might attack? Four adversaries COMMON, AND WEAK RARE, AND POWERFUL T1 · a voter dishonest; wants their candidate to win T2 · a poll worker an insider; handles the ballots all day T3 · a campaign has money to spend and people to send T4 · a government hostile; has police, power lines, and roads each one can do everything the one before it can, and more
  • A threat model is a list of abilities, not a name. “T2” really means “someone who can hold the ballots and be alone with them”, whoever that turns out to be.
  • It also says what we assume the adversary cannot do. For example: we assume T1 cannot get near the ballot box. Assumptions like this are where systems get broken later, so write them down.
[+] Step 3: what each adversary can and cannot do
AdversaryWhat they can doWhat we assume they cannot do
T1 · a voterShow up twice. Claim a name that is not theirs. Mail in a second ballot.Touch the ballot box, see other people's ballots, or change the count.
T2 · a poll workerEverything T1 can, plus: hold the ballots, read them, lose a stack, add a stack, misreport the tally.Send away the people who come to watch the count.
T3 · a campaignPay voters, if it can check how they voted. Pay a worker. Print convincing fake ballots. Spread lies.Be at every station at once, or force anyone to do anything.
T4 · a governmentCut the power. Close the roads. Threaten or arrest workers. Change the law on the day.Not much. Nothing a town's poll workers do can stop it.
T4 is out of scope. A town election cannot stop a government, so we say so out loud, cross T4 out, and design against T1 to T3 only. Every later slide ignores T4.
[+] Step 4: choose a mechanism for each goal G1 · one person, one vote authenticity the voter roll a printed list of every eligible resident; at the door the poll worker checks your ID and crosses out your name G2 · the count is honest integrity the sealed box and a public count shown empty, sealed, watched all day by the poll worker, then opened and counted in front of everyone G3 · the vote is secret confidentiality the booth and the identical ballot every ballot is the same blank paper; you mark it alone, fold it, drop it in yourself; no phones inside G4 · the election happens availability many stations, paper, and the law several stations, open 6 AM to 8 PM, pencil and paper, and a law that says every station must open

Notice: one poll worker runs the station. A mechanism can be a thing, like a lock or a sealed box, or a procedure, like “the worker stays with the box.” Things break; procedures get skipped.

[x] Step 5: attack G1, one person, one vote
G1 · one person, one vote · authenticity The goal: only residents over 18 vote, each of them once.
The mechanism, the voter roll: a printed list of residents over 18. At the door the worker checks your ID, crosses you out, and hands you one ballot.
  • T1 comes back at 5 PM in a different coat. Holds. Their name was crossed out at 9 AM. No second ballot.
  • T1 uses the name of a neighbor who moved away. Depends. With a stale list and no ID check, they get a ballot. The roll is only as good as both.
  • T2, the worker, quietly skips crossing out their friends. Breaks. One worker checks the list, and nobody checks the worker.
New mechanism: a second worker, from the rival candidate's side Both workers check the list and the ID. Rival sides do not cover for each other.
[x] Step 5: attack G2, the count is honest
G2 · the count is honest · integrity The goal: every ballot in the box is counted as it was marked.
The mechanism, the sealed box and a public count: shown empty at 6 AM, sealed, the worker stays with it all day, counted at 8 PM in front of everyone.
  • T1 tries to stuff ten extra ballots into the box. Holds. They were handed one ballot, and the worker is watching the box.
  • T2, alone with the box at lunch, swaps fifty ballots. Breaks. The worker is the only person watching the box, and the worker is the attacker.
  • T3 prints 500 fake ballots and pays the worker to add them. Breaks. The public count at 8 PM counts the fakes too. Nobody knows they are fake.
New mechanisms: the second worker again, plus one free check The rival worker stays with the box too. And at 8 PM, ballots in the box must equal names crossed out.
[x] Step 5: attack G3, the vote is secret
G3 · the vote is secret · confidentiality The goal: nobody can learn how you voted, not even if you want to prove it.
The mechanism, the booth and the identical ballot: every ballot is the same blank paper. You mark it alone, fold it, drop it in yourself. No phones.
  • T3 pays $50 to anyone who votes for A. Holds. The buyer cannot check, so voters take the money and vote as they like.
  • T3 asks voters to photograph their ballot. Depends on the no-phones rule. Better: let voters swap a spoiled ballot for a new one, so a photo proves nothing.
  • T2 puts a tiny dot on each ballot, in a different spot per voter, and notes who got which. Breaks. After the count, the dots reveal every person's vote.
New mechanism: the second worker, once more The rival worker checks that every ballot handed out is blank and identical.
[x] Step 5: attack G4, the election happens
G4 · the election happens · availability The goal: everyone who wants to vote can, and the result is out on election night.
The mechanism, many stations, paper, and the law: several stations open 6 AM to 8 PM, paper and pencils, and a law that every station must open.
  • T1 blocks the door of one station. Holds. The police move them along, and there are other stations.
  • T2 “oversleeps” and opens the station at noon. Breaks with one worker. With the second worker, who also has a key, it holds.
  • T3 spreads a rumor that voting is on Wednesday. Partly breaks. No lock stops a lie. The fix is information: every household gets a card with the date.

Not every mechanism is a lock. Some are procedures, some are information, and some are the law.

[+] The scoreboard: secure against whom?
GoalT1 voterT2, one workerT2, two workersT3 campaign
G1 one person, one voteholdsbreaksholdsholds
G2 the count is honestholdsbreaksholds if ballots are counted against namesholds if ballots are counted against names
G3 the vote is secretholdsbreaksholdsholds if no phones in the booth
G4 the election happensholdsbreaksholdspartly, lies get through

T4 has no column. We crossed it out on the threat-model slide: this election does not try to stop a government.

Secure against a voter. Against a worker, only once there are two of them. Partly against a campaign. “Is it secure?” has no answer. “Secure against whom?” does.

[+] Money: the same three questions, 5,000 years ago
  • The system. Before coins, people in Mesopotamia kept accounts with small clay tokens. One token meant one sheep, or one jar of grain. The tokens stayed in a temple, or traveled sealed inside a clay envelope.
  • The goals. Only the temple may create tokens, so a token is real proof of a debt: authenticity. And anyone handed a token can check that it is genuine, without walking to the temple.
  • The threat model. Anyone with a lump of clay can make a token that looks the same. Clay is free and the shapes are simple. Inside the temple, the walls did the security work. Outside, nothing does.
  • The question. How do you make a token that can travel from hand to hand and still meet both goals?
Ancient clay counting tokens Clay counting tokens: the accounting record before writing.
[+] Money: the mechanism, then and now

Coins, from around the 6th century BCE, answered the question with three ideas. The paper money in your wallet uses the same three.

COINS, 6th CENTURY BCE A BANKNOTE, TODAY made of something you cannot get gold and silver: nobody can make more of it made of something you cannot get cotton paper with a security thread inside a mark that is hard to copy the mint's stamp: a skilled engraver's work a mark that is hard to copy watermark, hologram, color-shifting ink a price for forging forgers were punished, often by death a price for forging counterfeiting: up to 20 years in prison

Anyone can check a bill: hold it to the light, tilt it, feel the paper. Only the central bank can make one. Keep that shape in mind. The crypto lecture builds it out of math.

[+] Who is the adversary? It depends on who you are OPPORTUNISTIC UNLIMITED opportunist the dishonest voter organized crime the campaign with money insider the poll worker nation state the hostile government You cannot defend against all of them equally, and you do not have to. Name your adversary first. That sets your budget.
  • For a town election, T1 to T3 is the right target. For a national election, the government is the whole point. Same system, different adversary, different budget.
  • The same is true for you. A criminal wants money and goes after whoever is easiest. A government can control the network itself. Most of the cryptography in this course exists for the second one.
[+] Takeaways
  • Write the goal down first, in one sentence. Say which of the four it is: confidentiality, integrity, availability, authenticity.
  • Name the adversary and list what they can do. “Secure” only ever means secure against them. The same election holds against a voter and falls to a government.
  • A mechanism answers one goal against one adversary, and it rests on assumptions. The ballot box stops a voter; it stops a worker only once a second worker is watching.
  • Goals pull against each other. A ballot with your name on it is easy to check and impossible to keep secret. You pick mechanisms for all the goals at once.
$ ./think --like-an-adversary --next crypto # next: how to make data that cannot be forged
[+] Acknowledgements

These lecture materials were provided by Suman Jana (Columbia University), and this deck is a re-typeset and extended version of his Security I slides. The money example follows his; the election example is new.

Some slides in the original material are borrowed from Vitaly Shmatikov and Ari Juels.

Errors introduced in the re-working are mine.

← all lectures