Skip to content

About

Zero-Knowledge Private Set Intersection & Homomorphic Lookalike Audience Mesh. Enables cross-enterprise swarms to discover shared high-propensity buyer intents and collaborative lookalikes without exposing raw PII, customer graphs, or competitive secrets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zk-cleanroom

Python 3.10+ License: MIT Zero Dependencies

Zero-Knowledge Private Set Intersection & Homomorphic Lookalike Audience Mesh
Enables cross-enterprise swarms to discover shared high-propensity buyer intents and collaborative lookalikes without exposing raw PII, customer graphs, or competitive secrets.


Strategic Overview

The death of third-party cookies, Apple ATT, and aggressive privacy regulations (GDPR Article 9, CCPA) have dismantled traditional programmatic ad targeting. Enterprise brands possess rich, first-party behavioral graphs, but cannot cross-pollinate with partner ecosystems without severe legal liability and customer trust erosion.

zk-cleanroom provides a decentralized Cryptographic Data Cleanroom based on:

  1. Diffie-Hellman Private Set Intersection (DH-PSI): Computes customer intersection cardinality with zero knowledge of non-overlapping entities using commutative exponentiation: $$H(x)^{k_A k_B} \equiv H(x)^{k_B k_A} \pmod p$$
  2. Paillier Additive Homomorphic Lookalike Scoring: Computes vector similarity inner products directly in ciphertext space without decrypting candidate feature coordinates: $$\llbracket \mathbf{x} \cdot \mathbf{y} \rrbracket = \prod_{i=1}^d \llbracket x_i \rrbracket^{y_i} \pmod{n^2}$$
  3. Zero Plaintext PII Egress: Mathematically guarantees $0\text{ bytes}$ of raw customer identifiers, email hashes, or behavioral telemetry are exposed between participants.

Core Mathematical Architecture

1. Diffie-Hellman Commutative PSI

Given RFC 3526 1536-bit safe prime $p$, parties $A$ and $B$ generate private keys $k_A, k_B \in [2, p-2]$:

  • Step 1: $A \to B: {H(a_i)^{k_A} \pmod p}$, $B \to A: {H(b_j)^{k_B} \pmod p}$
  • Step 2: $A \to B: { (H(b_j)^{k_B})^{k_A} \pmod p }$, $B \to A: { (H(a_i)^{k_A})^{k_B} \pmod p }$
  • Overlap: $Z_A \cap Z_B = { H(x)^{k_A k_B} \pmod p }$

2. Paillier Additive Homomorphic Encryption

Key parameters: $n = p \cdot q$, $\lambda = \text{lcm}(p-1, q-1)$, $g = n + 1$:

  • Encryption: $c = (1 + m \cdot n) \cdot r^n \pmod{n^2}$
  • Decryption: $m = L(c^\lambda \pmod{n^2}) \cdot \lambda^{-1} \pmod n$
  • Inner Product: $\llbracket \mathbf{x} \cdot \mathbf{y} \rrbracket = \prod_{i=1}^d c_i^{y_i} \pmod{n^2}$

Installation & Quickstart

git clone https://github.com/AAH20/zk-cleanroom.git
cd zk-cleanroom

Zero third-party dependencies. Pure Python 3.10+ standard library.

from zk_cleanroom import EnterpriseParticipant, CleanroomMeshCoordinator

coordinator = CleanroomMeshCoordinator()

# Enterprise A & Enterprise B
party_a = EnterpriseParticipant("CORP_A", ["[email protected]", "[email protected]"], {"[email protected]": [50, 100]})
party_b = EnterpriseParticipant("CORP_B", ["[email protected]", "[email protected]"], {"[email protected]": [40, 90]})

# 1. Discover shared customers (DH-PSI)
shared = coordinator.discover_shared_customers(party_a, party_b)
print(f"Discovered Mutual Accounts: {shared}")

# 2. Homomorphic Lookalike Matching (0 PII leaked)
matches = coordinator.match_lookalikes(sponsor=party_a, evaluator=party_b, target_profile_vector=[2, 1])
print(f"Top Lookalike: {matches[0].candidate_id} (Score: {matches[0].similarity_score})")

Running Test Suite

python3 -m unittest discover -s tests -v

License

MIT License. Authored by Ahmed Hassan.

About

Zero-Knowledge Private Set Intersection & Homomorphic Lookalike Audience Mesh. Enables cross-enterprise swarms to discover shared high-propensity buyer intents and collaborative lookalikes without exposing raw PII, customer graphs, or competitive secrets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages