Syllabus Lesson 139 of 156 · Privacy tech beyond blocking
Privacy tech beyond blocking

Choose the right tool

Why it matters Privacy tools are not interchangeable. Using secure aggregation where you needed differential privacy, or PSI where a count would do, can leak exactly what you meant to protect. Product teams make this choice every day. This exercise trains the one question that settles it: who should learn what?

Ask "who learns what"

Each technique in this module is a promise about knowledge. Before picking one, write down every party (the user, the company, a partner, the public) and what each is allowed to learn. The right tool is the one whose promise matches that list.

TechniqueIts promise
Differential privacyResults barely change with or without any one person
Private Set IntersectionTwo parties learn which items they share, and nothing else
PSI cardinalityTwo parties learn only how many items they share
Secure aggregationA server learns a total but no single contribution
Privacy PassA site learns a trusted issuer vouched for you, unlinkably
Oblivious HTTPOne party knows who asks, another knows what is asked

The six scenarios

  1. S1. A clinic network wants to publish weekly counts of visits to each clinic, so that nobody reading them can tell whether a particular person visited, even someone who knows everyone else's visits.
  2. S2. Two shops plan a joint loyalty offer. Each must know exactly which of its own customers are also customers of the other, without seeing the rest of the other's list.
  3. S3. An advertiser wants to know how many people who saw an ad later bought something at a shop. Neither side should learn which people.
  4. S4. A fitness app wants the total steps walked in a city each day, computed from phones, without its server ever seeing any one phone's count.
  5. S5. A forum wants to let in visitors who were already checked by a trusted service, without showing a puzzle and without being able to track them across sites.
  6. S6. A browser wants to ask a safety service whether a site is known to be harmful, without the service learning which user asked.

Tricky pairs

S1 and S4 both produce totals. The difference is what is protected: secure aggregation hides the inputs from the server but reveals the exact total, while differential privacy protects people from what the published output reveals. S2 and S3 both compare lists; the question is whether names are needed or a number will do.

How to answer

Fill in the dict choices: each scenario maps to a pair, the technique copied exactly from TECHNIQUES and the letter of the matching property from PROPERTIES. A tuple is written with round brackets, like ("secure aggregation", "D"). The checker hides the answer key, so read the scenario, not the tests.

Beyond this module: two more tools. Homomorphic encryption lets a server compute on data it cannot read: you send encrypted numbers, it adds or multiplies them while still encrypted, and only you can decrypt the result. It is real and improving, but still much slower than normal computing, so today it is practical mainly for narrow tasks such as simple sums or lookups. On-device machine learning avoids the problem altogether by running the model on your phone or laptop, so the data never leaves; the cost is a smaller model and your device's battery. This course's own tutor works that way.

In other languages

The same answer sheet as a JavaScript object, or a Go map:

// JavaScript
const choices = { S4: ["secure aggregation", "D"] /* ... */ };

// Go
choices := map[string][2]string{"S4": {"secure aggregation", "D"}}

In real design reviews, teams often write the "who learns what" list as a table in the design document before choosing any technique.

Recap

  • Choose a privacy technique by listing who may learn what, then matching that to the technique's promise.
  • Secure aggregation hides inputs; differential privacy protects people from the published output.
  • Ask for the least that answers the question: a count (PSI cardinality) instead of names when a count will do.
  • Homomorphic encryption and on-device ML are further options, each with real costs.
Your turn

Fill in the dict choices so that each key "S1" to "S6" maps to a tuple (technique, letter): the technique copied exactly from TECHNIQUES and the letter (A to F) of the property in PROPERTIES that it guarantees. Use each technique once.

Spotted a problem in this lesson? Report it

Code · runs in your browser
Output