{"id":19909106,"url":"https://github.com/dyne/lua-paillier","last_synced_at":"2026-03-10T18:31:55.214Z","repository":{"id":141086389,"uuid":"245841038","full_name":"dyne/lua-paillier","owner":"dyne","description":"Lua module for the Paillier cryptographic scheme","archived":false,"fork":false,"pushed_at":"2023-02-24T23:11:22.000Z","size":12313,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-03T02:38:48.125Z","etag":null,"topics":["c","crypto","lua","paillier"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dyne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-03-08T15:40:38.000Z","updated_at":"2023-02-24T22:18:52.000Z","dependencies_parsed_at":"2023-04-01T09:35:48.106Z","dependency_job_id":null,"html_url":"https://github.com/dyne/lua-paillier","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"850a23eeb048d2304932b815376d051da98e2d9a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dyne/lua-paillier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Flua-paillier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Flua-paillier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Flua-paillier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Flua-paillier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyne","download_url":"https://codeload.github.com/dyne/lua-paillier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Flua-paillier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30347399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c","crypto","lua","paillier"],"created_at":"2024-11-12T21:14:22.939Z","updated_at":"2026-03-10T18:31:55.162Z","avatar_url":"https://github.com/dyne.png","language":"C","readme":"# Lua Paillier\n\n[![Run Tests](https://github.com/dyne/lua-paillier/actions/workflows/test.yml/badge.svg)](https://github.com/dyne/lua-paillier/actions/workflows/test.yml)\n\nLua Paillier is a portable cryptographic module to execute homomorphic computations based on the [Paillier cryptosystem](https://en.wikipedia.org/wiki/Paillier_cryptosystem).\n\nThis Lua module works only on 64-bit systems.\n\n[![software by Dyne.org](https://files.dyne.org/software_by_dyne.png)](http://www.dyne.org)\n\n# Usage\n\nBuild:\n\n```\nluarocks build paillier-scm-1.rockspec\n```\n\nTest:\n```\nmake check\n```\n\nLaunch:\n```\nlua -l paillier\n```\n\n## Use:\nHomomorphic Properties of Paillier Cryptosystem:\n* The product of two ciphers decrypts to the sum of the plain text\n* The product of a cipher with a non-cipher raising g will decrypt to their sum\n* A Cipher raised to a non-cipher decrypts to their product\n* Any cipher raised to an integer k will decrypt to the product of the deciphered and k\n\nAddition proof:\n```\npk, sp, sq = paillier.keygen()\nleft = 1024\nright = 256\nresult = left + right\ncl = paillier.encrypt(pk, left)\ncr = paillier.encrypt(pk, right)\ncres = paillier.add(pk, cl, cr)\nplain = paillier.decrypt(sp, sq, cres)\n```\nThe hex values of `plain` and `result` are the same.\n\nMultiplication proof:\n```\npk, sp, sq = paillier.keygen()\nleft = 1000\nright = 255 -- ff\nresult = left * right\ncl = paillier.encrypt(pk, left)\ncres = paillier.mult(pk, cl, addzero('ff',256*2)) -- zero padded hex\nplain = paillier.decrypt(sp, sq, cres)\n```\nAgain the hex values of `plain` and `result` are the same.\n\n\n# Credits\n\nLua Paillier is Copyright (C) 2020-2023 by the Dyne.org foundation\n\nDesigned, written and maintained by Denis \"Jaromil\" Roio.\n\nMore contact information is on [Zenroom.org](https://zenroom.org)\n\nThis software Includes the cryptographic library Milagro released\nunder the Apache License, Version 2.0\n- Copyright (C) 2016 MIRACL UK Ltd\n- Copyright (C) 2019 The Apache Software Foundation\n\nSpecial thanks to Thomas Fuerstner.\n\n## Licensing\n\nLua Paillier is free software distributed under the terms of the\nMIT license reproduced here. Lua Multi Party may be used for any\npurpose, including commercial purposes, at absolutely no cost.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Support\n\nEnterprise level support contracts are available upon request, as\nwell customisations and license exceptions: you are welcome to get\nin touch with us at https://zenroom.org\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Flua-paillier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyne%2Flua-paillier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Flua-paillier/lists"}