The standard match operation involves a sender and a receiver. The sender performs an intersection match with a receiver, such that the receiver learns the result of the intersection, and the sender learns nothing. Protocols such as PSI allow the sender and receiver to protect, to varying degrees of security guarantees and without a trusted third-party, private data records that are used as inputs in performing the intersection match.
The examples support kkrt, dhpsi, npsi and bpsi: the protocol can be selected with the -proto argument. Note that npsi is the default.
go run generate.go
This will create two files, sender-ids.txt
and receiver-ids.txt
with 100 IDs in common between them. You can confirm the commonality by running:
comm -12 <(sort sender-ids.txt) <(sort receiver-ids.txt) | wc -l
go run receiver/main.go
The receiver will learn of the intersection between sender-ids.txt
and receiver-ids.txt
and write the results to common-ids.txt
go run sender/main.go
The sender sends the contents of sender-ids.txt
to the receiver but learns nothing.
comm -12 <(sort receiver-ids.txt) <(sort common-ids.txt) | wc -l
comm -12 <(sort sender-ids.txt) <(sort common-ids.txt) | wc -l