{"id":17447864,"url":"https://github.com/pmuens/tfhe-py","last_synced_at":"2025-04-24T03:13:17.940Z","repository":{"id":174387593,"uuid":"651086538","full_name":"pmuens/tfhe-py","owner":"pmuens","description":"Python implementation of the Fully Homomorphic Encryption Scheme TFHE","archived":false,"fork":false,"pushed_at":"2023-06-19T08:08:12.000Z","size":85,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T03:13:14.085Z","etag":null,"topics":["cryptography","fully-homomorphic-encryption","homomorphic-encryption","tfhe"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmuens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-08T13:12:23.000Z","updated_at":"2025-04-22T15:14:03.000Z","dependencies_parsed_at":"2023-07-08T12:15:45.033Z","dependency_job_id":null,"html_url":"https://github.com/pmuens/tfhe-py","commit_stats":null,"previous_names":["pmuens/tfhe-py"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmuens%2Ftfhe-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmuens%2Ftfhe-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmuens%2Ftfhe-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmuens%2Ftfhe-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmuens","download_url":"https://codeload.github.com/pmuens/tfhe-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552075,"owners_count":21449165,"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","fully-homomorphic-encryption","homomorphic-encryption","tfhe"],"created_at":"2024-10-17T19:56:15.018Z","updated_at":"2025-04-24T03:13:17.922Z","avatar_url":"https://github.com/pmuens.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TFHE-py\n\nPython implementation of the [Fully Homomorphic Encryption (FHE)](https://en.wikipedia.org/wiki/Homomorphic_encryption#Fully_homomorphic_encryption) scheme [TFHE: Fast Fully Homomorphic Encryption over the Torus](https://eprint.iacr.org/2018/421.pdf).\n\nYou can see example usages in the [Jupyter Notebook](./main.ipynb) and the [tests](./tests/) directory.\n\nThe starting point of this implementation was the code written by [NuCypher](https://www.nucypher.com) for their [NuFHE](https://github.com/nucypher/nufhe) library. More specifically the code in commit [17f3b62](https://github.com/nucypher/nufhe/commit/17f3b6200425a42b84ff844928550e9add684280) was used which itself seems to be a port of their Julia version [nucypher/TFHE.jl](https://github.com/nucypher/TFHE.jl) which looks like a port (see [this commit](https://github.com/nucypher/TFHE.jl/commit/bf33742310a369c6da133593cbbefd75374bbefb)) of the original [tfhe/tfhe](https://github.com/tfhe/tfhe) codebase that's written in C / C++.\n\n## Setup\n\n1. `git clone \u003curl\u003e`\n2. `asdf install`\n3. `pipenv install -e .`\n4. `pipenv shell`\n5. `python tests/e2e_half_adder_test.py`\n6. `pipenv run test`\n7. `pipenv run coverage`\n8. `pipenv scripts`\n\n_Optional_: Update the properties marked with `TODO:` in the [`.vscode/settings.json`](./.vscode/settings.json) file. To get the correct paths run `which \u003cpackage\u003e` within a Pipenv shell.\n\n## Useful Commands\n\n```sh\nasdf install\n\npipenv install -e .\npipenv install [-d] \u003cname\u003e[~=\u003cversion\u003e]\npipenv shell\npipenv scripts\npipenv run \u003ccommand\u003e\n\npython \u003cpath\u003e\n\nflake8 \u003cpath\u003e\n\npylint \u003cpath\u003e --recursive true\n\nmypy \u003cpath\u003e\n\npytest [-s] [-v] [-k \u003cpattern\u003e] [\u003cpath\u003e]\n\ncoverage html\ncoverage report -m\n\npy-spy record -o profile.svg --pid \u003cpid\u003e\npy-spy record -o profile.svg -- python \u003cpath\u003e\npy-spy top -- python \u003cpath\u003e\n```\n\n## Useful Resources\n\n### (T)FHE\n\n- [tfhe/tfhe](https://github.com/tfhe/tfhe)\n- [nucypher/nufhe](https://github.com/nucypher/nufhe)\n- [zama-ai/tfhe-rs](https://github.com/zama-ai/tfhe-rs)\n- [nucypher/TFHE.jl](https://github.com/nucypher/TFHE.jl)\n- [thedonutfactory/go-tfhe](https://github.com/thedonutfactory/go-tfhe)\n- [thedonutfactory/rs_tfhe](https://github.com/thedonutfactory/rs_tfhe)\n- [virtualsecureplatform/pyFHE](https://github.com/virtualsecureplatform/pyFHE)\n- [openfheorg/openfhe-development](https://github.com/openfheorg/openfhe-development)\n- [TFHE: Fast Fully Homomorphic Encryption over the Torus](https://eprint.iacr.org/2018/421)\n- [Guide to Fully Homomorphic Encryption over the [Discretized] Torus](https://eprint.iacr.org/2021/1402)\n- [SoK: Fully Homomorphic Encryption over the [Discretized] Torus](https://tches.iacr.org/index.php/TCHES/article/view/9836)\n- [TFHE Deep Dive - Part I - Ciphertext types](https://www.zama.ai/post/tfhe-deep-dive-part-1)\n- [TFHE Deep Dive - Part II - Encodings and linear leveled operations](https://www.zama.ai/post/tfhe-deep-dive-part-2)\n- [TFHE Deep Dive - Part III - Key switching and leveled multiplications](https://www.zama.ai/post/tfhe-deep-dive-part-3)\n- [TFHE Deep Dive - Part IV - Programmable Bootstrapping](https://www.zama.ai/post/tfhe-deep-dive-part-4)\n- [Introduction to practical FHE and the TFHE scheme - Ilaria Chillotti, Simons Institute 2020](https://www.youtube.com/watch?v=FFox2S4uqEo)\n- [TFHE Deep Dive - Ilaria Chillotti, FHE.org](https://www.youtube.com/watch?v=LZuEr4jpyUw)\n- [003 TFHE Deep Dive (by Ilaria Chillotti)](https://www.youtube.com/watch?v=npoHSR6-oRw)\n- [Part 1 Introduction to FHE and the TFHE scheme - Ilaria Chillotti, ICMS](https://www.youtube.com/watch?v=e_76kZ9j2-M)\n- [Part 2 Introduction to FHE and the TFHE Scheme - Ilaria Chillotti, ICMS](https://www.youtube.com/watch?v=o7_WNbVuZqQ)\n- [Introduction to FHE (Fully Homomorphic Encryption) - Pascal Paillier, FHE.org Meetup](https://www.youtube.com/watch?v=aruz58RarVA)\n\n### Python\n\n- [Real Python](https://realpython.com)\n- [Python Cheatsheet](https://www.pythoncheatsheet.org)\n- [Learn X in Y minutes](https://learnxinyminutes.com/docs/python)\n- [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)\n- [gto76/python-cheatsheet](https://github.com/gto76/python-cheatsheet)\n- [Writing Python like it's Rust](https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-its-rust.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmuens%2Ftfhe-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmuens%2Ftfhe-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmuens%2Ftfhe-py/lists"}