{"id":13400164,"url":"https://github.com/nucypher/nufhe","last_synced_at":"2025-03-14T04:32:44.070Z","repository":{"id":46108958,"uuid":"128600765","full_name":"nucypher/nufhe","owner":"nucypher","description":"NuCypher fully homomorphic encryption (NuFHE) library implemented in Python","archived":true,"fork":false,"pushed_at":"2022-06-21T21:29:13.000Z","size":455,"stargazers_count":441,"open_issues_count":25,"forks_count":53,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-10-13T11:58:02.949Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nufhe.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nucypher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-08T05:17:17.000Z","updated_at":"2024-10-07T21:08:59.000Z","dependencies_parsed_at":"2022-08-20T08:11:06.439Z","dependency_job_id":null,"html_url":"https://github.com/nucypher/nufhe","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2Fnufhe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2Fnufhe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2Fnufhe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2Fnufhe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nucypher","download_url":"https://codeload.github.com/nucypher/nufhe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243526891,"owners_count":20305110,"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":[],"created_at":"2024-07-30T19:00:49.157Z","updated_at":"2025-03-14T04:32:39.047Z","avatar_url":"https://github.com/nucypher.png","language":"Python","funding_links":[],"categories":["Roadmap","Libraries","Python"],"sub_categories":["[Sunscreen](https://sunscreen.tech/)"],"readme":"# A GPU implementation of fully homomorphic encryption on torus\n\nThis library implements the fully homomorphic encryption algorithm from [`TFHE`](https://github.com/tfhe/tfhe) using CUDA and OpenCL. Unlike `TFHE`, where FFT is used internally to speed up polynomial multiplication, `nufhe` can use either FFT or purely integer NTT (DFT-like transform on a finite field). The latter is based on the arithmetic operations and NTT scheme from [`cuFHE`](https://github.com/vernamlab/cuFHE). Refer to the [project documentation](https://nufhe.readthedocs.io/en/latest/) for more details.\n\n\n## Usage example\n```python\n    import random\n    import nufhe\n\n    size = 32\n    bits1 = [random.choice([False, True]) for i in range(size)]\n    bits2 = [random.choice([False, True]) for i in range(size)]\n    reference = [not (b1 and b2) for b1, b2 in zip(bits1, bits2)]\n\n    ctx = nufhe.Context()\n    secret_key, cloud_key = ctx.make_key_pair()\n\n    ciphertext1 = ctx.encrypt(secret_key, bits1)\n    ciphertext2 = ctx.encrypt(secret_key, bits2)\n\n    vm = ctx.make_virtual_machine(cloud_key)\n    result = vm.gate_nand(ciphertext1, ciphertext2)\n    result_bits = ctx.decrypt(secret_key, result)\n\n    assert all(result_bits == reference)\n```\n\n## Performance\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"2\"\u003e\u003cb\u003ePlatform\u003c/b\u003e\u003c/td\u003e\n    \u003ctd rowspan=\"2\"\u003e\u003cb\u003eLibrary\u003c/b\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\u003cb\u003ePerformance (ms/bit)\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eBinary Gate\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eMUX Gate\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"3\"\u003e\u003cb\u003eSingle Core/Single GPU - FFT\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eTFHE (CPU)\u003c/td\u003e\n    \u003ctd\u003e13\u003c/td\u003e\n    \u003ctd\u003e26\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003enuFHE\u003c/td\u003e\n    \u003ctd\u003e0.13\u003c/td\u003e\n    \u003ctd\u003e0.22\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eSpeedup\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003e100.9\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003e117.7\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"3\"\u003e\u003cb\u003eSingle Core/Single GPU - NTT\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003ecuFHE\u003c/td\u003e\n    \u003ctd\u003e0.35\u003c/td\u003e\n    \u003ctd\u003eN/A\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003enuFHE\u003c/td\u003e\n    \u003ctd\u003e0.35\u003c/td\u003e\n    \u003ctd\u003e0.67\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eSpeedup\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003e1.0\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003e-\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnucypher%2Fnufhe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnucypher%2Fnufhe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnucypher%2Fnufhe/lists"}