{"library":"openmined-psi","title":"OpenMined Private Set Intersection (PSI)","description":"OpenMined PSI (Private Set Intersection) is a cryptographic library that allows two parties to compute the intersection of their private datasets without revealing non-intersecting elements. It focuses on securely computing the *size* of the intersection. The library is currently at version 2.0.6 and is actively maintained with frequent minor updates for dependency bumps and Python version support.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install openmined-psi"],"cli":null},"imports":["from openmined_psi import client","from openmined_psi import server"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from openmined_psi import client, server\n\n# Setup common inputs\nclient_inputs = [\"client@example.com\", \"client2@example.com\", \"test@example.com\"]\nserver_inputs = [\"client@example.com\", \"server@example.com\", \"test@example.com\"]\n\n# --- Server side ---\n# Create a server instance (e.g., with a new key)\nserver_psi = server.CreateWithNewKey(False) # 'False' means not to reveal the server's key\n\n# Create a setup message. The first parameter is the FPR (False Positive Rate),\n# the second is the number of elements in the server's set.\nsetup_message = server_psi.CreateSetupMessage(0.001, len(server_inputs), server_inputs)\n\n# --- Client side ---\n# Create a client instance\nclient_psi = client.CreateWithNewKey(False) # 'False' means not to reveal the client's key\n\n# Create a request message from the client's inputs\nrequest = client_psi.CreateRequest(client_inputs)\n\n# --- Server side (handling request) ---\n# Server handles the client's request\nresponse = server_psi.HandleRequest(request)\n\n# --- Client side (getting intersection size) ---\n# Client processes the server's response to get the intersection size.\n# Note: openmined-psi only provides the intersection *size* for privacy reasons,\n# not the actual elements themselves.\nintersection_size = client_psi.GetIntersectionSize(response)\n\nprint(f\"Intersection size: {intersection_size}\") # Expected: 2 (client@example.com, test@example.com)","lang":"python","description":"This example demonstrates how two parties (client and server) can compute the size of their set intersection using `openmined-psi` without revealing their full sets. The output will be the size of the intersection.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}