{"id":18519999,"url":"https://github.com/tf-encrypted/tf-pjc","last_synced_at":"2025-04-09T09:32:33.509Z","repository":{"id":46083792,"uuid":"201293408","full_name":"tf-encrypted/tf-pjc","owner":"tf-encrypted","description":"Bridge between TensorFlow and Google's Private Join and Compute library","archived":false,"fork":false,"pushed_at":"2022-12-27T15:37:08.000Z","size":33,"stargazers_count":16,"open_issues_count":11,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T04:08:04.296Z","etag":null,"topics":["cryptography","homomorphic-encryption","machine-learning","private-intersection-sum","private-set-intersection","secure-computation","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tf-encrypted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-08T16:07:35.000Z","updated_at":"2024-01-14T00:00:14.000Z","dependencies_parsed_at":"2023-01-31T05:30:40.634Z","dependency_job_id":null,"html_url":"https://github.com/tf-encrypted/tf-pjc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Ftf-pjc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Ftf-pjc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Ftf-pjc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Ftf-pjc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tf-encrypted","download_url":"https://codeload.github.com/tf-encrypted/tf-pjc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248012593,"owners_count":21033226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","homomorphic-encryption","machine-learning","private-intersection-sum","private-set-intersection","secure-computation","tensorflow"],"created_at":"2024-11-06T17:18:15.216Z","updated_at":"2025-04-09T09:32:33.221Z","avatar_url":"https://github.com/tf-encrypted.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TF PJC\n\nTF PJC provides a bridge between TensorFlow and Google's [Private Join and Compute](https://github.com/google/private-join-and-compute) library. This allows two parties to privately compute the intersection of two sets and the sum of associated values as described in [IKNP+'19](https://eprint.iacr.org/2019/723).\n\n\u003c!--\n[![PyPI](https://img.shields.io/pypi/v/tf-pjc.svg)](https://pypi.org/project/tf-pjc/) [![CircleCI Badge](https://circleci.com/gh/tf-encrypted/tf-pjc/tree/master.svg?style=svg)](https://circleci.com/gh/tf-encrypted/tf-pjc/tree/master)\n--\u003e\n\n## Usage\n\nThe library may be used as shown in the following example:\n\n```python\nimport tensorflow as tf\nimport tf_pjc\n\n# device strings of the two players involved\nclient_device = \"/job:localhost/task:0/device:CPU:0\"\nserver_device = \"/job:localhost/task:1/device:CPU:0\"\n\n# construct private input of server\nwith tf.device(server_device):\n  server_elements = tf.constant([\"a\", \"b\", \"c\"])\n\n# construct private inputs of client\nwith tf.device(client_device):\n  client_elements = tf.constant([\"a\", \"b\", \"c\", \"d\"])\n  client_values   = tf.constant([100, 200, 400, 800])\n\n# use protocol to securely compute intersection size and sum\nprotocol_instance = tf_pjc.PrivateIntersectionSum(client_device, server_device)\nclient_result_op, server_wait_op = protocol_instance(client_elements, client_values, server_elements)\n\n# print private result (which is local to the client)\nwith tf.device(client_device):\n  intersection_size, intersection_sum = client_result_op\n  print_size_op = tf.print(\"Intersection size: \", intersection_size)\n  print_sum_op = tf.print(\"Intersection sum: \", intersection_sum)\n  print_op = tf.group(print_size_op, print_sum_op)\n\n# run in TensorFlow session\nwith tf.Session() as sess:\n  sess.run([print_op, server_wait_op])\n```\n\nFuture releases will also include the possibility of using TF PJC in conjunction with [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted) as a kernel for `tfe.sets.intersection_sum`.\n\n## Installation\n\nPython 3 packages are available from [PyPI](https://pypi.org/project/tf-pjc/):\n\n```\npip install tf-pjc\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftf-encrypted%2Ftf-pjc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftf-encrypted%2Ftf-pjc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftf-encrypted%2Ftf-pjc/lists"}