// THE CULT OF PRIVACY TECHNOLOGIESTwo topics. Everything you need.
ISNE 269497 · Semester 1, 2026 · Chiang Mai University. What can go wrong with personal data, and how to put a number on it. Written in plain words, with the real breaches the exam keeps coming back to.
Threats, Risks & Vulnerabilities
What can go wrong. You learn the 5 properties that keep data safe, the attacks that break them, the weak points in a network, and how people get re-identified from "anonymous" data.
Privacy Risk Quantification
How much can go wrong — as a number. You learn what makes data risky, how to measure risk with entropy, and how to check if de-identification actually worked (IG & RIG).
The map — 4 steps
| 1 · Protect | Data has 5 properties to defend: confidentiality, integrity, availability, anonymity, indistinguishability. |
| 2 · Attack | Attackers break these properties: ransomware, DoS, SQL injection, phishing, re-identification. |
| 3 · Measure | Entropy turns "how risky is this data?" into a number in bits. |
| 4 · Reduce | De-identify the data, then use IG & RIG to prove the risk went down. |
How to use this page
- Notes — read each topic. Short and plain.
- Case Files — real breaches. Exams love these.
- Drills — 36 flashcards, then a 20-question mock exam with every answer explained.
- Cheat Sheet — one last look before the exam.
Course facts
- Instructor: Asst. Prof. Jenjira Jaimunk, PhD
- Class: Tue & Fri 13:00–14:30, Room 601 Engineering Bldg.
- Office hours: Monday 09:00–12:00
- Grades: Homework & quizzes 30% · Midterm 35% · Final 35%
// LEARNNotes
Pick a topic, open one box at a time. Every box is one idea, and every idea earns its place on the exam.
1 Security vs Privacy — the two big words
| Data Security | Information Privacy |
|---|---|
| Protects data from being stolen, changed, or destroyed. Tools: encryption, firewalls, access controls, authentication, regular updates. |
Controls who can see personal info and how it is used. Covers: names, addresses, money and health info. |
Privacy also means: collect only what is needed, be open about it, and get consent. People should know how and why their data is collected.
2 The CIA triad — 3 security properties
| Property | Simple meaning | Broken by |
|---|---|---|
| Confidentiality | Only the right people can see the data. | Data breaches, ransomware (WannaCry), insiders selling secrets. |
| Integrity | The data has not been changed — you can trust it. | Hackers modifying data, phishing emails, fake news, misinformation. |
| Availability | You can reach the data when you need it. | DoS attacks — flooding a server until it fails (GitHub 2018). |
DoS in one line: the attacker sends more requests than the service can handle, so real users get locked out.
3 The 2 privacy properties
| Property | Simple meaning | Example |
|---|---|---|
| Anonymity | An action cannot be linked to your real identity. | E-voting — nobody should learn who you voted for. |
| Indistinguishability | You cannot be picked out of the crowd in a dataset. | AOL 2006 — people were picked out of "anonymous" search logs. |
4 How to protect each property
One defence per property. Know this mapping cold — it is a classic multi-choice question.
| Defence | Protects | How |
|---|---|---|
| Encryption + access controls | Confidentiality | Only people with the key or access rights can read the data. |
| Hashing + logs | Integrity | Compare hash values or check logs to spot any change. One changed character → totally different hash. |
| Backups | Availability | If data is lost or locked, restore it from the backup. |
| De-identification | Anonymity + Indistinguishability | Techniques like k-anonymity and differential privacy hide who is who. |
Hashing in one line: a function that turns any value into a unique "digest" — change the input a tiny bit and the digest changes completely.
5 Information systems & the 3 states of data
An information system (IS) network = software + hardware + Internet + IoT devices + users, all sharing data. Data lives in 3 states:
| State | Meaning | Example |
|---|---|---|
| At rest | Stored | Data sitting in a database. |
| In transit | Moving | Data sent over the Internet. |
| In use | Being processed | Data open in an app on your laptop. |
6 Weak points — 5 vulnerable components
| Component | Main attack | Fix |
|---|---|---|
| Modem / WiFi | OS exploit; man-in-the-middle (attacker sits between you and the other side, reads or changes traffic). | Keep OS updated, use a firewall, encrypt the WiFi network. |
| Database | SQL injection — attacker types malicious SQL into an input box and the database runs it. | Encrypt stored data, de-identify shared data, access controls, monitoring. |
| Computer | Malware, ransomware, OS exploits (WannaCry). | Antivirus, firewall, updates, backups. |
| IoT devices | Default passwords, weak security → spying, botnets, entry point (casino fish tank). | Change default passwords, update firmware, encrypt communication. |
| Humans | Social engineering & phishing — tricking people into giving info. Plus malicious insiders (Snowden). | Security training, strong authentication, tech + vigilant people. |
Firewall in one line: a barrier between your private network and the Internet — lets safe traffic in, keeps bad traffic out.
7 Re-identification — 4 attack types
Re-identification = working out who someone is from "anonymous" data, then learning more about them. It breaks anonymity, indistinguishability and confidentiality.
| Attack | Simple meaning | Example |
|---|---|---|
| Inference | Learn or predict facts about a person from the data. | AOL: find one person's searches → read all their searches. |
| Amplification | Link public data with anonymised data to learn new facts. | Match medical records to public social media profiles. |
| Differencing | Compare two query results; the difference exposes one person. | Count diagnoses with target vs without → target's diagnosis. |
| Reconstruction | Rebuild original data from aggregated or synthetic data. | Rebuild personal movement paths from aggregate mobility data. |
8 Auxiliary knowledge — what attackers use
Re-identification usually needs extra knowledge on top of the dataset. Three kinds:
| Type | Meaning | Examples |
|---|---|---|
| Unique identifiers | One value = one person. | Email, phone number, medical record number. |
| Quasi-identifiers | Not unique alone — unique when combined. | Gender + date of birth + ZIP code. |
| Background knowledge | Things the attacker already knows about the target. | "Only she visited the clinic that day." |
Adversary = any person, group, organisation or government that wants to cause harm through cyber activity (NIST).
// SHOW YOUR WORKINGCalculations
Every number this course asks you to produce, with every line of working. The exam gives marks for the steps, not just the answer — so these are laid out the way you should write them on paper.
1 The log₂ toolkit — no calculator needed
Every probability in this course is a small fraction, so you only ever need a handful of logs. Three tools cover all of it.
Tool 1 — powers of two are exact
Any probability that is 1 over a power of 2 gives a whole number. If every group in your table has size 1/2, 1/4 or 1/8 of the total, you never need a decimal at all.
Tool 2 — the division rule
So log₂(3/10) = log₂3 − log₂10 = 1.585 − 3.322 = −1.737. Useful when the fraction is not a tenth.
Tool 3 — the tenths table
| p | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 |
|---|---|---|---|---|---|---|---|---|---|
| log₂ p | −3.322 | −2.322 | −1.737 | −1.322 | −1.000 | −0.737 | −0.515 | −0.322 | −0.152 |
| −p·log₂ p | 0.332 | 0.464 | 0.521 | 0.529 | 0.500 | 0.442 | 0.360 | 0.258 | 0.137 |
Memory aid: doubling p subtracts exactly 1 from log₂ p. 0.1 → 0.2 → 0.4 → 0.8 reads −3.322, −2.322, −1.322, −0.322. Same for 0.3 → 0.6.
2 H(X) — entropy of one attribute
Recipe
- Group the records by the value of X. Count each group.
- p = count ÷ total.
- Look up −p·log₂p for each group.
- Add them. That sum is H(X). Units: bits.
Worked — Alejandra, TM 1 (postcode)
Ten records. Postcode 2015 appears 3 times, 2016 six times, 2017 once.
p(2016) = 6/10 = 0.6 → 0.442
p(2017) = 1/10 = 0.1 → 0.332
─────────────────────────
H(X) = 0.521 + 0.442 + 0.332 = 1.295 bits
Worked — Alejandra, TM 2 (medical code)
A appears 5 times, B four times, C once.
H(X) = 0.500 + 0.529 + 0.332 = 1.361 bits
3 H(X,Y) — joint entropy of two attributes
When the adversary knows both attributes, one "value" is the pair. Nothing else about the method changes.
Recipe
- Write out the pair for every record: (postcode, medical code).
- Count identical pairs. These counts must still total the number of records.
- Same formula, same table, same sum.
Then run the two checks
- Marginal check. Add the pair counts down one attribute — you must recover the single-attribute counts exactly. Do it in both directions.
- Bound check. max(H(X), H(Y)) ≤ H(X,Y) ≤ H(X) + H(Y) — adding an attribute can only raise uncertainty or leave it unchanged, never lower it.
4 H(X|Y) — conditional entropy, the one everyone skips
This is the step the IG formula depends on, and it is where marks are lost. H(X|Y) asks: once the adversary has seen the de-identified value Y, how much uncertainty about the real X is left?
In words: for each possible Y, work out the entropy of X within that group only, then average those, weighted by how common each Y is.
Recipe
- Group the records by Y — one group per de-identified value.
- For each group, find p(y) = group size ÷ total.
- Inside that group, look at the original X values and compute H(X|Y=y) using the ordinary entropy formula, but with probabilities within the group.
- Multiply each group's entropy by its p(y), and add.
Method 2 — the chain rule
Use whichever is faster, and if you have time use both — they must agree, which makes it a free check on your own arithmetic.
5 IG and RIG — worked end to end
IG = how many bits about the original data the adversary gains by seeing the de-identified version. Lower is safer. RIG rescales it to 0–1 so it lines up with the privacy spectrum.
The setup is the same in both: names are encoded phonetically, so Peter and Pete collapse to p360, and the Smith family collapses to s530.
Reading A — one name repeats: Smith, Smith, Peter, Pete
| # | X — real name | Y — code |
|---|---|---|
| 1 | Smith | s530 |
| 2 | Smith | s530 |
| 3 | Peter | p360 |
| 4 | Pete | p360 |
Step 1 — H(X). Smith 2/4, Peter 1/4, Pete 1/4:
Step 2 — H(X|Y). Group by code and measure what is left inside each group:
| Y | p(y) | X inside the group | H(X|Y=y) |
|---|---|---|---|
| s530 | 2/4 = 0.5 | Smith, Smith — one value only | 0 bits |
| p360 | 2/4 = 0.5 | Peter, Pete — 50 / 50 | 1 bit |
Step 3 — IG and RIG.
RIG = 1.0 / 1.5 = 0.67
Reading B — four distinct names: Peter, Pete, Smith, Smyth
Same two codes, but now every name is different, so nothing was repeated to begin with.
Step 1 — H(X). Four equally likely names, 1/4 each:
Step 2 — H(X|Y). Now both groups are mixed:
| Y | p(y) | X inside the group | H(X|Y=y) |
|---|---|---|---|
| p360 | 2/4 = 0.5 | Peter, Pete — 50 / 50 | 1 bit |
| s530 | 2/4 = 0.5 | Smith, Smyth — 50 / 50 | 1 bit |
Step 3 — IG and RIG.
RIG = 1.0 / 2.0 = 0.50
Why they differ — and which one the slide probably means
| Reading | H(X) | H(X|Y) | IG | RIG | Spectrum label |
|---|---|---|---|---|---|
| A · Smith repeats | 1.5 | 0.5 | 1.0 | 0.67 | between moderate and high |
| B · four distinct | 2.0 | 1.0 | 1.0 | 0.50 | exactly "moderate" |
The last step is a sentence, not a number
Whichever value you get, the marks are in the interpretation:
- RIG = 0 → the de-identified data reveals nothing about the original. Perfect privacy.
- RIG = 0.5 → half the information survives. Suspicion with moderate confidence.
- RIG = 1 → everything survives. The de-identification did nothing at all.
6 Reading k and l off a table
No formula here — it is a counting exercise, and the trick is knowing what to count.
Recipe
- Identify the QID columns (the quasi-identifiers — gender, birth year, postcode). Ignore the sensitive column for now.
- Group rows that are identical across all QID columns. These groups are called equivalence classes.
- k = the size of the smallest group.
- Inside each group, count the distinct sensitive values. l = the smallest of those counts.
Worked
| Gender | Born | Postcode | Diagnosis |
|---|---|---|---|
| F | 1985 | 50200 | flu |
| F | 1985 | 50200 | flu |
| F | 1985 | 50200 | cough |
| M | 1990 | 50100 | asthma |
| M | 1990 | 50100 | flu |
| M | 1990 | 50100 | asthma |
Two groups, three rows each. Group F has diagnoses {flu, cough} → 2 distinct. Group M has {asthma, flu} → 2 distinct.
l = min(2, 2) = 2 → the table is 2-diverse
7 Exam checklist
- State the formula before you use it. It is usually worth a mark on its own.
- Show p for every group. Write "3/10 = 0.3", not just 0.3.
- Keep 3 decimal places through the working, round only at the end.
- Write the unit — bits. Entropy, IG and joint entropy are all in bits. RIG has no unit; it is a ratio between 0 and 1.
- Check the probabilities sum to 1 before computing anything.
- Run the marginal check on any joint table. Ten seconds, and it catches the error class the lecturer just confirmed.
- Sanity-check the size: 0 ≤ H ≤ log₂(distinct values), and H(X,Y) ≥ max(H(X), H(Y)).
- Finish with a sentence. "RIG = 0.50 → moderate risk, so this de-identification is too weak to publish." The interpretation is what the question is really testing.
// REAL WORLDCase Files
Eleven breaches straight from the slides. For each one know three things: what happened, which property broke, and the lesson. Exam questions are usually one of those three.
📘 Facebook / Cambridge Analytica
201850–90 million users exposed through a loophole in Facebook's API used by a third-party quiz app. Facebook knew about the issue as early as 2015 and did nothing.
🦠 WannaCry ransomware
2017Infected 250,000+ computers in 150 countries using a Windows vulnerability. Files were hijacked and encrypted; victims had to pay $300 in bitcoin for the key.
⚡ GitHub DDoS
2018A flood from 1,000+ systems peaked at 1.35 terabits/second — 126.9 million packets per second — knocking GitHub offline and then intermittent for a short time.
🔎 AOL search logs
2006AOL released "anonymised" search histories of 650,000 users for research. People who searched their own name, SSN, phone or location were re-identified — exposing all their searches.
🎬 Netflix prize data
2008Anonymised movie ratings of 500,000 subscribers were released for a contest. Researchers (Narayanan & Shmatikov) re-identified people by linking ratings with public IMDb reviews.
🏥 Massachusetts hospital data
1997Sweeney re-identified people (famously the state governor) in "anonymous" hospital discharge data by linking it with voter records using ZIP + birth date + gender.
📡 Optus breach
2022An exposed API that required no authentication let attackers pull 10+ million customer records — names, addresses, birth dates, passport and Medicare numbers. Data of 10,000 customers hit the dark web; a class action followed in 2023.
🏥 Medibank breach
2022An employee's stolen credentials gave attackers access to 200GB of data on 9.7 million customers, including medical claims. APRA made Medibank set aside $250 million.
🐠 Casino fish tank
2017Hackers entered a casino's network through an Internet-connected fish-tank thermometer, then scanned for weaknesses and stole 10GB of data.
🕵️ Edward Snowden
2013An IT administrator at an NSA contractor downloaded thousands of top-secret files in May 2013 and released them to journalists in June 2013.
📷 Nest camera
—A smart camera left on its default password can be taken over to spy on the owner and infer private information.
// TRAININGDrills
Thirty-six cards to make the definitions automatic, then a twenty-question mock exam that explains every answer — including the discussion questions lifted straight from the slides.
Flashcards
Click the card to flip it. Be honest — mark "Again" if you hesitated. Keyboard: Space flip · ←/→ move · G got it · A again.
Mock exam
Twenty questions. Single-answer ones grade the moment you click; multi-answer ones wait for Check.
// LAST LOOKCheat Sheet
Everything squeezed onto one screen. This is the page to read in the ten minutes before you walk in.
T1 The 5 properties
| Property | Meaning | Broken by | Defended by |
|---|---|---|---|
| Confidentiality | Only the right people see it | Breaches, ransomware, insiders | Encryption, access controls |
| Integrity | Data not changed, trustworthy | Modified data, phishing, fake news | Hashing, logs |
| Availability | Reachable when needed | DoS / DDoS | Backups |
| Anonymity | Action can't be linked to you | Re-identification | De-identification |
| Indistinguishability | Can't be picked from the crowd | Re-identification | De-identification (k-anonymity, differential privacy) |
T1 4 re-identification attacks
| Inference | Learn/predict facts about a person from the data (AOL). |
| Amplification | Link public data + anonymised data → new facts. |
| Differencing | Query with target vs without → difference exposes them. |
| Reconstruction | Rebuild original data from aggregated/synthetic data. |
Fuel: unique identifiers · quasi-identifiers · background knowledge. Key stat: 87% of US unique on gender + DOB + 5-digit ZIP.
T1 Component → attack → fix
| Modem/WiFi | OS exploit, man-in-the-middle | Updates, firewall, encrypt WiFi |
| Database | SQL injection | Encrypt, de-identify, monitor |
| Computer | Malware, ransomware | Antivirus, updates, backups |
| IoT | Default passwords, botnets | Change passwords, update, encrypt |
| Humans | Phishing, social engineering, insiders | Training, strong authentication |
T2 4 risky elements → defence models
| Uniqueness | Rare values stand out (Jenjira vs John) | → k-anonymity: each value combo shared by ≥ k records |
| Uniformity | Repeated values reveal a person | → l-diversity: ≥ l different sensitive values per group |
| Linkable tokens | PII hiding in the data (emails in free text) | → remove/mask direct identifiers |
| Correlation | One attribute predicts another; links datasets | → break correlations, perturb values |
T2 Threat models & spectrum
| Threat models | ① single attribute < ② combination of attributes · ③ direct identifiers extracted + linked externally. More knowledge = more risk. |
| Privacy spectrum | 0.0 absolute privacy · 0.25 low suspicion · 0.5 moderate · 0.75 high · 1.0 provably exposed |
T2 Formulas & key numbers
| Fair coin 0.5/0.5 | 1 bit (max uncertainty) | Certain outcome 1.0/0.0 | 0 bits |
| Coin 0.6/0.4 | 0.971 bits | Coin 0.8/0.2 | 0.722 bits |
| Alejandra TM1 (postcode) | 1.295 bits | TM2 (medical code) | 1.361 bits |
| TM3 (both attributes) | highest risk — recompute from the pairs printed 1.895 is a known error | Encoding example RIG | 0.50 or 0.67 slide under correction — see Calc §5 |
Read: higher entropy = more unique values = more info for the attacker = higher re-ID risk. Lower IG = better de-identification.
📁 Cases in one line each
| Facebook/CA '18 | Quiz-app API loophole, 50–90M users, $5B fine |
| WannaCry '17 | Windows flaw, 250k PCs, 150 countries, $300 BTC ransom |
| GitHub '18 | DDoS 1.35 Tbps — availability down |
| AOL '06 | 650k "anonymous" search logs → users re-identified |
| Netflix '08 | 500k subscribers re-identified by linking with IMDb |
| Massachusetts '97 | Governor re-identified via ZIP+DOB+gender |
| Optus '22 | API with no authentication, 10M+ records |
| Medibank '22 | Stolen credentials, 200GB, 9.7M customers, $250M |
| Casino '17 | Fish-tank thermometer → 10GB stolen |
| Snowden '13 | Insider downloaded top-secret NSA files |
⚡ Last-minute answers
- Ransomware → confidentiality broken (attacker controls the data) and availability (you lose access).
- Insider selling secrets → confidentiality.
- Re-identified from an anonymised dataset → indistinguishability.
- Integrity is preserved by hashing + logs (not encryption, not backups).
- Social networking, location, transaction and web-search data are all sensitive.
- k = 5 → every record looks like at least 4 others.
- 3 states of data: at rest · in transit · in use.
// WHO BUILT THISZann
One of four course consoles I built for this semester. Same shell, same keyboard shortcuts, same offline-first rule — open the file and it works, with the Wi-Fi off.
Author
This course
Built with
Vanilla HTML, CSS and JavaScript. No framework, no build step, no dependencies, no network calls — one file you can open from a USB stick. Progress, theme and your place in each section are stored in localStorage on your own device and nowhere else.