Private set intersection (PSI) is a cryptographic protocol that allows two or more parties, each holding a private set of items, to compute the items they have in common without revealing anything about the items that are not shared. In privacy engineering, PSI is a specialized form of secure multi-party computation used to match customer lists, contact books, identifiers or threat indicators while keeping the rest of each dataset confidential.
A naive approach, in which both sides exchange hashed identifiers, looks private but is not: email addresses and phone numbers come from small, guessable spaces, so hashes can be reversed by brute-force or dictionary attacks. PSI replaces that shortcut with protocols whose security can be stated precisely.
How private set intersection protocols work
Most practical PSI protocols rely on a shared cryptographic transformation that only produces matching outputs when the inputs match, while each party can apply only its own secret part of the transformation. The classic construction uses commutative encryption based on the Diffie-Hellman assumption.
- Party A hashes each item to a group element and raises it to a secret exponent a, then sends the results to party B.
- Party B raises the received values to its own secret exponent b, producing values of the form H(x) to the power ab, and returns them to A.
- Party B also sends its own items transformed with b alone, which A raises to a.
- Party A compares the two lists of doubly encrypted values; equal values identify the shared items, and nothing else matches.
Neither side can reverse the other side’s exponent, so non-matching items stay hidden. Modern protocols replace exponentiation with oblivious transfer extension and oblivious pseudorandom functions (OPRF), which are much faster for large sets because they rely mostly on symmetric cryptography.
The following table summarizes the main protocol families and their typical properties.
| Protocol family | Core primitive | Strength | Typical limitation |
|---|---|---|---|
| Diffie-Hellman PSI | Commutative exponentiation | Simple, low communication | Slower on very large sets |
| OT-based PSI | Oblivious transfer extension | Very fast computation | Higher bandwidth |
| OPRF-based PSI | Oblivious pseudorandom function | Good balance, flexible | Needs careful implementation |
| Homomorphic PSI | Fully or partially homomorphic encryption | Efficient for unbalanced sets | Heavy server computation |
| Circuit-based PSI | Garbled circuits | Supports computation on the result | Highest overhead |
Security models and output variants
The guarantees of PSI depend on the adversary model a protocol is proven secure under. A semi-honest (honest-but-curious) model assumes both parties follow the protocol but try to learn more from what they see. A malicious model also covers parties that deviate from the protocol, for example by submitting inputs designed to probe the other set.
PSI also comes in several output variants. Revealing the full intersection is not always acceptable, so many deployments use PSI cardinality, which reveals only how many items match, or PSI with computation, which reveals an aggregate such as the sum of purchase values over matched customers.
| Variant | What is revealed | Typical use |
|---|---|---|
| Full PSI | The shared items themselves | Contact discovery, list matching |
| One-sided PSI | Intersection to one party only | Client checks against a server list |
| PSI cardinality | Only the number of shared items | Audience overlap measurement |
| PSI-sum or PSI with computation | An aggregate over matched records | Advertising conversion measurement |
| Threshold PSI | Intersection only above a set size | Fraud and threat intelligence sharing |
Even a secure protocol reveals its output by design. If one party can run repeated queries with crafted sets, it can learn the other set item by item. Policies such as rate limits, minimum set sizes and added noise from differential privacy are therefore part of a sound deployment.
Private set intersection compared with related techniques
PSI is a narrow, highly efficient tool for one task: matching without disclosure. Other privacy-enhancing technologies address broader computations or different threat models.
| Technique | Main purpose | Relation to PSI |
|---|---|---|
| Hashed matching | Join lists by hashed identifiers | Insecure substitute PSI replaces |
| Secure multi-party computation | Compute any function jointly | PSI is a specialized, faster case |
| Homomorphic encryption | Compute on encrypted data | Used inside some PSI protocols |
| Data clean room | Controlled joint analysis environment | Often uses PSI for the join step |
| Differential privacy | Limit inference from outputs | Protects aggregate PSI results |
A data clean room often combines several of these layers: PSI to join records, aggregation to produce statistics and differential privacy to limit what a single result reveals about individuals.
Performance and deployment considerations
Modern PSI is practical at scale. Optimized two-party protocols can intersect sets of millions of items in seconds to minutes on ordinary servers, with performance depending on set sizes, network bandwidth and the security model chosen.
- Unbalanced PSI suits a small client set checked against a large server set, as in mobile contact discovery or password breach lookups.
- Preprocessing of the larger set offline reduces online latency.
- Input normalization of emails, phone numbers and names must be identical on both sides, or true matches are missed.
- Audited open-source libraries are strongly preferred over custom implementations, because subtle errors break the security proof.
A common mistake is to treat the protocol as the whole privacy control. Metadata such as set sizes, timing and the identity of the counterparty can still leak information, and many protocols reveal each party’s set size unless padding with dummy items is added. Teams should document what each party learns, who may run queries and how long intermediate encrypted values are retained.
Under the GDPR, the inputs to PSI often remain personal data, so PSI does not remove the need for a legal basis or a privacy impact assessment. It does support data minimization, because each party receives only the intersection or an aggregate instead of the other party’s full list.
Understanding it simply
Imagine two people who each have a guest list and want to know which friends they share, without showing each other the rest of their lists. Private set intersection is a mathematical way to do exactly that.
Each side scrambles its list with a secret key in a special way. Only names that appear on both lists end up scrambled identically, so the matches stand out and every other name stays unreadable.
Applied in practice
A retailer and an online advertising platform want to measure whether an advertising campaign led to store purchases. The retailer holds 2.4 million loyalty-card emails with purchase totals, and the platform holds the emails of users who saw the campaign. Sharing either list directly would expose customer data and breach both companies’ privacy commitments.
The two companies run a PSI-sum protocol in which both lists are normalized, encrypted and matched. Neither side learns the other’s customers. The output shows that about 180,000 exposed users made purchases worth a stated total, and the platform adds calibrated statistical noise before reporting. The retailer gets a reliable measure of campaign impact without any raw email leaving its systems.