Private set intersection

Also known as: PSI

On this page 6

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.

  1. Party A hashes each item to a group element and raises it to a secret exponent a, then sends the results to party B.
  2. 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.
  3. Party B also sends its own items transformed with b alone, which A raises to a.
  4. 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 familyCore primitiveStrengthTypical limitation
Diffie-Hellman PSICommutative exponentiationSimple, low communicationSlower on very large sets
OT-based PSIOblivious transfer extensionVery fast computationHigher bandwidth
OPRF-based PSIOblivious pseudorandom functionGood balance, flexibleNeeds careful implementation
Homomorphic PSIFully or partially homomorphic encryptionEfficient for unbalanced setsHeavy server computation
Circuit-based PSIGarbled circuitsSupports computation on the resultHighest overhead
Main families of private set intersection protocols

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.

VariantWhat is revealedTypical use
Full PSIThe shared items themselvesContact discovery, list matching
One-sided PSIIntersection to one party onlyClient checks against a server list
PSI cardinalityOnly the number of shared itemsAudience overlap measurement
PSI-sum or PSI with computationAn aggregate over matched recordsAdvertising conversion measurement
Threshold PSIIntersection only above a set sizeFraud and threat intelligence sharing
Common PSI output variants

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.

PSI is a narrow, highly efficient tool for one task: matching without disclosure. Other privacy-enhancing technologies address broader computations or different threat models.

TechniqueMain purposeRelation to PSI
Hashed matchingJoin lists by hashed identifiersInsecure substitute PSI replaces
Secure multi-party computationCompute any function jointlyPSI is a specialized, faster case
Homomorphic encryptionCompute on encrypted dataUsed inside some PSI protocols
Data clean roomControlled joint analysis environmentOften uses PSI for the join step
Differential privacyLimit inference from outputsProtects aggregate PSI results
PSI and neighboring privacy-enhancing technologies

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.