{"id":27026889,"url":"https://github.com/serengil/lightphe","last_synced_at":"2025-04-04T23:16:17.841Z","repository":{"id":208060933,"uuid":"711214934","full_name":"serengil/LightPHE","owner":"serengil","description":"A Lightweight Partially Homomorphic Encryption Library for Python","archived":false,"fork":false,"pushed_at":"2024-01-26T17:44:45.000Z","size":152,"stargazers_count":28,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-03T02:04:08.492Z","etag":null,"topics":["benaloh","cryptography","cyber-security","cybersecurity","damgard-jurik","elgamal","elliptic-curve","encryption","goldwasser-micali","homomorphic","homomorphic-encryption","homomorphism","naccache-stern","okamoto-uchiyama","paillier","partially-homomorphic","phe","public-key-cryptography","python","rsa"],"latest_commit_sha":null,"homepage":"https://bit.ly/46vWz9w","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serengil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"serengil","patreon":"serengil?repo=lightphe"}},"created_at":"2023-10-28T14:57:59.000Z","updated_at":"2024-05-29T21:25:16.924Z","dependencies_parsed_at":"2024-05-29T21:25:05.980Z","dependency_job_id":null,"html_url":"https://github.com/serengil/LightPHE","commit_stats":null,"previous_names":["serengil/lightphe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightPHE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightPHE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightPHE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightPHE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serengil","download_url":"https://codeload.github.com/serengil/LightPHE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261594,"owners_count":20910108,"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":["benaloh","cryptography","cyber-security","cybersecurity","damgard-jurik","elgamal","elliptic-curve","encryption","goldwasser-micali","homomorphic","homomorphic-encryption","homomorphism","naccache-stern","okamoto-uchiyama","paillier","partially-homomorphic","phe","public-key-cryptography","python","rsa"],"created_at":"2025-04-04T23:16:17.307Z","updated_at":"2025-04-04T23:16:17.834Z","avatar_url":"https://github.com/serengil.png","language":"Python","funding_links":["https://github.com/sponsors/serengil","https://patreon.com/serengil?repo=lightphe","https://www.patreon.com/serengil?repo=lightphe","https://buymeacoffee.com/serengil"],"categories":[],"sub_categories":[],"readme":"# LightPHE\n\n\u003cdiv align=\"center\"\u003e\n\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/lightphe?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=downloads)](https://pepy.tech/project/lightphe)\n[![Stars](https://img.shields.io/github/stars/serengil/LightPHE?color=yellow\u0026style=flat\u0026label=%E2%AD%90%20stars)](https://github.com/serengil/LightPHE/stargazers)\n[![Tests](https://github.com/serengil/LightPHE/actions/workflows/tests.yml/badge.svg)](https://github.com/serengil/LightPHE/actions/workflows/tests.yml)\n[![License](http://img.shields.io/:license-MIT-green.svg?style=flat)](https://github.com/serengil/LightPHE/blob/master/LICENSE)\n[![arXiv](https://img.shields.io/badge/arXiv-2408.05219-b31b1b.svg?logo=arXiv)](https://arxiv.org/abs/2408.05219)\n\n[![Blog](https://img.shields.io/:blog-sefiks.com-blue.svg?style=flat\u0026logo=wordpress)](https://sefiks.com)\n[![YouTube](https://img.shields.io/:youtube-@sefiks-red.svg?style=flat\u0026logo=youtube)](https://www.youtube.com/@sefiks?sub_confirmation=1)\n[![Twitter](https://img.shields.io/:follow-@serengil-blue.svg?style=flat\u0026logo=x)](https://twitter.com/intent/user?screen_name=serengil)\n\n[![Patreon](https://img.shields.io/:become-patron-f96854.svg?style=flat\u0026logo=patreon)](https://www.patreon.com/serengil?repo=lightphe)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/serengil?logo=GitHub\u0026color=lightgray)](https://github.com/sponsors/serengil)\n[![Buy Me a Coffee](https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee)](https://buymeacoffee.com/serengil)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/serengil/LightPHE/master/icons/phi.png\" width=\"200\" height=\"240\"\u003e\u003c/p\u003e\n\nLightPHE is a lightweight partially homomorphic encryption library for python. It is a hybrid homomoprhic encryption library wrapping many schemes such as [`RSA`](https://sefiks.com/2023/03/06/a-step-by-step-partially-homomorphic-encryption-example-with-rsa-in-python/), [`ElGamal`](https://sefiks.com/2023/03/27/a-step-by-step-partially-homomorphic-encryption-example-with-elgamal-in-python/), [`Exponential ElGamal`](https://sefiks.com/2023/03/27/a-step-by-step-partially-homomorphic-encryption-example-with-elgamal-in-python/), [`Elliptic Curve ElGamal`](https://sefiks.com/2018/08/21/elliptic-curve-elgamal-encryption/) ([`Weierstrass`](https://sefiks.com/2016/03/13/the-math-behind-elliptic-curve-cryptography/), [`Koblitz`](sefiks.com/2016/03/13/the-math-behind-elliptic-curves-over-binary-field/) and [`Edwards`](https://sefiks.com/2018/12/19/a-gentle-introduction-to-edwards-curves/) forms), [`Paillier`](https://sefiks.com/2023/04/03/a-step-by-step-partially-homomorphic-encryption-example-with-paillier-in-python/), [`Damgard-Jurik`](https://sefiks.com/2023/10/20/a-step-by-step-partially-homomorphic-encryption-example-with-damgard-jurik-in-python/), [`Okamoto–Uchiyama`](https://sefiks.com/2023/10/20/a-step-by-step-partially-homomorphic-encryption-example-with-okamoto-uchiyama-in-python/), [`Benaloh`](https://sefiks.com/2023/10/06/a-step-by-step-partially-homomorphic-encryption-example-with-benaloh-in-python-from-scratch/), [`Naccache–Stern`](https://sefiks.com/2023/10/26/a-step-by-step-partially-homomorphic-encryption-example-with-naccache-stern-in-python/), [`Goldwasser–Micali`](https://sefiks.com/2023/10/27/a-step-by-step-partially-homomorphic-encryption-example-with-goldwasser-micali-in-python/).\n\n# Partially vs Fully Homomorphic Encryption\n\nEven though fully homomorphic encryption (FHE) has become available in recent times, but when considering the trade-offs, LightPHE emerges as a more efficient and practical choice. If your specific task doesn't demand the full homomorphic capabilities, opting for partial homomorphism with LightPHE is the logical decision.\n\n- 🏎️ Notably faster\n- 💻 Demands fewer computational resources\n- 📏 Generating much smaller ciphertexts\n- 🔑 Distributing much smaller keys\n- 🧠 Well-suited for memory-constrained environments\n- ⚖️ Strikes a favorable balance for practical use cases\n\n# Installation [![PyPI](https://img.shields.io/pypi/v/lightphe.svg)](https://pypi.org/project/lightphe/)\n\nThe easiest way to install the LightPHE package is to install it from python package index (PyPI).\n\n```shell\npip install lightphe\n```\n\nThen you will be able to import the library and use its functionalities.\n\n```python\nfrom lightphe import LightPHE\n```\n\n# Summary of Homomorphic Features of Different Cryptosystems in LightPHE\n\nIn summary, LightPHE is covering following algorithms and these are partially homomorphic with respect to the operations mentioned in the following table.\n\n| Algorithm | Multiplicatively\u003cbr\u003eHomomorphic | Additively\u003cbr\u003eHomomorphic | Multiplication with a Plain Constant | Exclusively\u003cbr\u003eHomomorphic | Regeneration\u003cbr\u003eof Ciphertext |\n| --- | --- | --- | --- | --- | --- |\n| RSA | ✅ | ❌ | ❌ | ❌ | ❌ |\n| ElGamal | ✅ | ❌ | ❌ | ❌ | ✅ |\n| Exponential ElGamal | ❌ | ✅ | ✅ | ❌ | ✅ |\n| Elliptic Curve ElGamal | ❌ | ✅ | ✅ | ❌ | ❌ |\n| Paillier | ❌ | ✅ | ✅ | ❌ | ✅ |\n| Damgard-Jurik | ❌ | ✅ | ✅ | ❌ | ✅ |\n| Benaloh | ❌ | ✅ | ✅ | ❌ | ✅ |\n| Naccache-Stern | ❌ | ✅ | ✅ | ❌ | ✅ |\n| Okamoto-Uchiyama | ❌ | ✅ | ✅ | ❌ | ✅ |\n| Goldwasser-Micali | ❌ | ❌ | ❌ | ✅ | ❌ |\n\n# Building cryptosystem\n\nOnce you imported the library, then you can build a cryptosystem for several algorithms. This basically generates private and public key pair.\n\n```python\nalgorithms = [\n  \"RSA\",\n  \"ElGamal\",\n  \"Exponential-ElGamal\",\n  \"Paillier\",\n  \"Damgard-Jurik\",\n  \"Okamoto-Uchiyama\",\n  \"Benaloh\",\n  \"Naccache-Stern\",\n  \"Goldwasser-Micali\",\n  \"EllipticCurve-ElGamal\"\n]\n\nphe = LightPHE(algorithm_name = algorithms[0])\n```\n\n# Encryption \u0026 Decryption\n\nOnce you built your cryptosystem, you will be able to encrypt and decrypt messages with the built cryptosystem.\n\n```python\n# define plaintext\nm = 17\n\n# calculate ciphertext\nc = phe.encrypt(m)\n\n# proof of work\nassert phe.decrypt(c) == m\n```\n\n# Homomorphic Operations\n\nOnce you have the ciphertext, you will be able to perform homomorphic operations on encrypted data without holding private key. For instance, Paillier is homomorphic with respect to the addition. In other words, decryption of the addition of two ciphertexts is equivalent to addition of plaintexts.\n\n### On-Prem Encryption\n\nThis code snippet illustrates how to generate a random public-private key pair using the Paillier and encrypt a plaintext pair. The resulting ciphertext pair, c1 and c2, along with the public key, is then sent from the on-premises environment to the cloud.\n\n```python\ndef on_premise() -\u003e Tuple[int, int, dict]:\n    \"\"\"\n    Executes on-premise operations: initializes a cryptosystem by generating \n    a random public-private key pair, then encrypts two plaintext values.\n\n    Returns:\n       result (tuple): A tuple containing:\n       - c1 (int): The first ciphertext\n       - c2 (int): The second ciphertext\n       - public_key (dict): The public key for the cryptosystem\n    \"\"\"\n    # generate a random private-public key pair\n    phe = LightPHE(algorithm_name = \"Paillier\")\n\n    # define plaintexts\n    m1 = 10000 # base salary in usd\n    m2 = 500 # wage increase in usd\n\n    # calculate ciphertexts\n    c1 = phe.encrypt(m1).value\n    c2 = phe.encrypt(m2).value\n\n    return (c1, c2, phe.cs.public_key)\n```\n\n### Homomorphic Operations on Cloud\n\nThis code snippet demonstrates how to perform homomorphic addition on the cloud side without using the private key. However, the cloud is unable to decrypt c3 itself, even though it is the one that calculated it.\n\n```python\ndef cloud(c1: int, c2: int, public_key: dict) -\u003e int:\n    \"\"\"\n    Performs cloud-side operations: reconstructs a cryptosystem using the \n    provided public key and executes a homomorphic addition on two ciphertexts.\n\n    Args:\n       c1 (int): The first ciphertext\n       c2 (int): The second ciphertext\n       public_key (dict): The public key of an existing cryptosystem\n    Retunrs:\n       c3 (int): The resulting ciphertext after homomorphic addition\n    \"\"\"\n    # restore cryptosystem with just the public key\n    phe = LightPHE(algorithm_name = \"Paillier\", keys = public_key)\n\n    # cast c1 and c2 to ciphertext objects\n    c1 = phe.create_ciphertext_obj(c1)\n    c2 = phe.create_ciphertext_obj(c2)\n\n    # confirm that cloud cannot decrypt c1\n    with pytest.raises(ValueError, match=\"You must have private key\"):\n      phe.decrypt(c1)\n\n    # confirm that cloud cannot decrypt c2\n    with pytest.raises(ValueError, match=\"You must have private key\"):\n      phe.decrypt(c2)\n\n    # perform homomorphic addition\n    c3 = c1 + c2\n\n    # confirm that cloud cannot decrypt c3\n    with pytest.raises(ValueError, match=\"You must have private key\"):\n      phe.decrypt(c3)\n    \n    return c3.value\n```\n\n### On-Prem Decryption And Proof of Work\n\nThis code snippet demonstrates the proof of work. Even though c3 was calculated in the cloud by adding c1 and c2, on-premises can validate that its decryption must be equal to the addition of plaintexts m1 and m2.\n\n```python\n# proof of work - private key required\nassert phe.decrypt(c3) == m1 + m2\n```\n\nIn this homomorphic pipeline, the cloud's computational power was utilized to calculate c3, but it can only be decrypted by the on-premises side. Additionally, while we performed the encryption on the on-premises side, this is not strictly necessary; only the public key is required for encryption. Therefore, encryption can also be performed on the non-premises side. This approach is particularly convenient when collecting data from multiple edge devices and storing all of it in the cloud simultaneously.\n\n### Scalar Multiplication\n\nBesides, Paillier is supporting multiplying ciphertexts by a known plain constant. This code snippet demonstrates how to perform scalar multiplication on encrypted data using Paillier homomorphic encryption with the LightPHE library.\n\n```python\n# increasing something 5%\nk = 1.05\n\n# scalar multiplication - cloud (private key is not required)\nc4 = k * c1\n\n# proof of work on-prem - private key is required\nassert phe.decrypt(c4) == k * m1\n```\n\n### Ciphertext Regeneration\n\nSimilar to the most of additively homomorphic algorithms, Paillier lets you to regenerate ciphertext while you are not breaking its plaintext restoration. You may consider to do this re-generation many times to have stronger ciphertexts.\n\n```python\nc1_prime = phe.regenerate_ciphertext(c1)\nassert c1_prime.value != c1.value\nassert phe.decrypt(c1_prime) == m1\nassert phe.decrypt(c1) == m1\n```\n\n### Unsupported Operations\n\nFinally, if you try to perform an operation that algorithm does not support, then an exception will be thrown. For instance, Paillier is not homomorphic with respect to the multiplication or xor. To put it simply, you cannot multiply two ciphertexts. If you enforce this calculation, you will have an exception.\n\n```python\n# pailier is not multiplicatively homomorphic\nwith pytest.raises(ValueError, match=\"Paillier is not homomorphic with respect to the multiplication\"):\n  c1 * c2\n\n# pailier is not exclusively homomorphic\nwith pytest.raises(ValueError, match=\"Paillier is not homomorphic with respect to the exclusive or\"):\n  c1 ^ c2\n```\n\nHowever, if you tried to multiply ciphertexts with RSA, or xor ciphertexts with Goldwasser-Micali, these will be succeeded because those cryptosystems support those homomorphic operations.\n\n### Elliptic Curve Cryptography\n\nECC is a powerful public-key cryptosystem based on the algebraic structure of elliptic curves over finite fields. The library supports 3 elliptic curve forms (weierstrass, edwards and koblitz) and 100+ standard elliptic curve configurations.\n\nIn LightPHE, the [Elliptic Curve ElGamal](https://sefiks.com/2018/08/21/elliptic-curve-elgamal-encryption/) scheme is implemented, offering a secure and efficient homomorphic encryption option.\n\n```python\nphe = LightPHE(\n    algorithm_name=\"EllipticCurve-ElGamal\",\n    form=\"edwards\", # or weierstrass, koblitz\n)\n```\n\nOne of the crucial factors that define the security level of an elliptic curve cryptosystem is the order of the curve. The order of a curve is the number of points on the curve, and it directly influences the strength of the encryption. A higher order typically corresponds to a stronger cryptosystem, making it more resistant to cryptographic attacks.\n\nEach curve in LightPHE has a specific order, which is carefully chosen to balance performance and security. By selecting an elliptic curve with a larger order, you increase the security of your cryptographic system, but this may come with a trade-off in computational efficiency. Therefore, choosing the appropriate curve order is a crucial decision based on your application’s security and performance requirements.\n\nSee [`curves`](https://github.com/serengil/LightECC#supported-curves) page for a list of all supported forms, curves and their details.\n\n### Vector Embeddings and Tensors\n\nLightPHE supports homomorphic encryption on vector embeddings and tensors. This is useful in privacy-preserving machine learning, secure aggregation, and confidential data processing.\n\n```python\n# build a cryptosystem\ncs = LightPHE(algorithm_name=\"Paillier\")\n\n# define plain embedding\ntensor = [1.005, 2.05, 3.005, 4.005, -5.05, 6, 7.003, 7.002]\n\n# encrypt vector embedding\nencrypted_tensors = cs.encrypt(tensor)\n\n# restore embedding\ndecrypted_tensors = cs.decrypt(encrypted_tensors)\n\n# proof of work\nassert all(abs(original - decrypted) \u003c 1e-2 for original, decrypted in zip(tensor, decrypted_tensors))\n```\n\nEncrypted embeddings retain their homomorphic properties, enabling secure computations on encrypted data without decryption. For example, two embeddings encrypted using a multiplicatively homomorphic algorithm can be multiplied element-wise.\n\n```python\n# build a multiplicatively homomorphic cryptosystem (e.g. RSA)\ncs = LightPHE(\"RSA\")\n\n# define plain embeddings\nt1 = [1.005, 2.05, -3.5, 3.1, -4]\nt2 = [5, 6.2, -7.002, -7.1, 8.02]\n\n# encrypt embeddings\nc1, c2 = cs.encrypt(t1), cs.encrypt(t2)\n\n# perform element-wise homomorphic multiplication\nc3 = c1 * c2\n\n# proof of work\nassert np.allclose(cs.decrypt(c3), [a * b for a, b in zip(t1, t2)], rtol=1e-2)\n```\n\nSimilarly, two embeddings encrypted with an additively homomorphic algorithm can be added. Additionally, an encrypted embedding can be multiplied by a constant or a plain embedding.\n\n```python\n# build an additively homomorphic cryptosystem (e.g. Paillier)\ncs = LightPHE(\"Paillier\")\n\n# define plain embeddings\nt1 = [1.005, 2.05, 3.6, 4, 4.02, 3.5]\nt2 = [5, 6.2, 7.5, 8.02, 8.02, 4.5]\nt3 = [1.03, 2.04, 3.05, 7.02, 2.01, 1.06]\n\n# encrypt embeddings\nc1, c2 = cs.encrypt(t1), cs.encrypt(t2)\n\n# perform addition of two encrypted embeddings\nc4 = c1 + c2\n\n# perform scalar multiplication on an embedding\nc5 = 3 * c1\n\n# perform element-wise multiplication between an encrypted embedding and plain embedding\nc6 = c1 * t3  # Encrypted-plaintext multiplication\n\n# proof of work\nassert np.allclose(cs.decrypt(c4), [a + b for a, b in zip(t1, t2)], rtol=1e-2)\nassert np.allclose(cs.decrypt(c5), [a * 3 for a in t1], rtol=1e-2)\nassert np.allclose(cs.decrypt(c6), [a * b for a, b in zip(t1, t3)], rtol=1e-2)\n```\n\n### Vector Similarity Search with PHE\n\nMany machine learning models rely on a two-tower architecture, including facial recognition, reverse image search, recommendation engines, large language models, and more. In this setup, user and item inputs are separately mapped to vector embeddings.\n\nFor example, suppose all facial embeddings in your database are encrypted on-prem in advance. When verifying an identity, the attempted facial embedding is generated on an edge device or in the cloud. You can compute the encrypted similarity by performing a dot product between the encrypted vector and the plain vector, ensuring secure comparison without decrypting sensitive data. Only additively homomorphic cryptosystems offer encrypted similarity calculation.\n\n```python\n# define a plain vectors for source and target\nalpha = [7.1, 5.2, 5.3, 2.4, 3.5, 4.6]  # On-prem vector (user tower)\nbeta = [5.6, 3.7, 2.8, 4, 0, 5.9]  # Cloud vector (item tower)\nexpected_similarity = sum(x * y for x, y in zip(alpha, beta))\n\n# build an additively homomorphic cryptosystem (e.g. Paillier) on-prem\ncs = LightPHE(algorithm_name = \"Paillier\", precision = 19)\n\n# export keys\ncs.export_keys(\"secret.txt\")\ncs.export_keys(\"public.txt\", public=True)\n\n# encrypt source embedding\nencrypted_alpha = cs.encrypt(alpha)\n\n# remove cryptosystem and plain alpha not to be leaked in cloud\ndel cs, alpha\n\n# restore the cryptosystem in cloud with only public key\ncloud_cs = LightPHE(algorithm_name = \"Paillier\", precision = 19, key_file = \"public.txt\")\n\n# dot product of encrypted and plain embedding pair\nencrypted_cosine_similarity = encrypted_alpha @ beta\n\n# computed by the cloud but cloud cannot decrypt it\nwith pytest.raises(ValueError, match=\"must have private key\"):\n    cloud_cs.decrypt(encrypted_cosine_similarity)\n\n# restore the cryptosystem on-prem with secret key\ncs = LightPHE(algorithm_name = \"Paillier\", precision = 19, key_file = \"secret.txt\")\n\n# decrypt similarity (on prem)\ncalculated_similarity = cs.decrypt(encrypted_cosine_similarity)[0]\n\n# proof of work\nassert abs(calculated_similarity - expected_similarity) \u003c 1e-2\n```\n\n# Contributing\n\nAll PRs are more than welcome! If you are planning to contribute a large patch, please create an issue first to get any upfront questions or design decisions out of the way first.\n\nYou should be able run `make test` and `make lint` commands successfully before committing. Once a PR is created, GitHub test workflow will be run automatically and unit test results will be available in [GitHub actions](https://github.com/serengil/LightPHE/actions/workflows/tests.yml) before approval.\n\n# Support\n\nThere are many ways to support a project - starring⭐️ the GitHub repo is just one 🙏\n\nYou can also support this work on [Patreon](https://www.patreon.com/serengil?repo=lightphe), [GitHub Sponsors](https://github.com/sponsors/serengil) or [Buy Me a Coffee](https://buymeacoffee.com/serengil).\n\n\u003ca href=\"https://www.patreon.com/serengil?repo=lightphe\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/serengil/LightPHE/master/icons/patreon.png\" width=\"30%\" height=\"30%\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://buymeacoffee.com/serengil\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/serengil/LightPHE/master/icons/bmc-button.png\" width=\"25%\" height=\"25%\"\u003e\n\u003c/a\u003e\n\nAlso, your company's logo will be shown on README on GitHub if you become sponsor in gold, silver or bronze tiers.\n\n# Citation\n\nPlease cite LightPHE in your publications if it helps your research. Here is its BibTex entry:\n\n```BibTeX\n@article{serengil2024lightphe,\n  title={LightPHE: Integrating Partially Homomorphic Encryption into Python with Extensive Cloud Environment Evaluations},\n  author={Serengil, Sefik Ilkin and Ozpinar, Alper},\n  journal={arXiv preprint arXiv:2408.05219},\n  note={doi: 10.48550/arXiv.2408.05219. [Online]. Available: \\url{https://arxiv.org/abs/2408.05219}},\n  year={2025}\n}\n```\n\n```BibTeX\n@article{serengil2025vectorsimilarity,\n  title={Encrypted Vector Similarity Computations Using Partially Homomorphic Encryption: Applications and Performance Analysis},\n  author={Serengil, Sefik and Ozpinar, Alper},\n  journal={arXiv preprint arXiv:2503.05850},\n  note={doi: 10.48550/arXiv.2503.05850. [Online]. Available: \\url{https://arxiv.org/abs/2503.05850}},\n  year={2025}\n}\n```\n\nAlso, if you use LightPHE in your projects, please add `lightphe` in the `requirements.txt`.\n\n# License\n\nLightPHE is licensed under the MIT License - see [`LICENSE`](https://github.com/serengil/LightPHE/blob/master/LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserengil%2Flightphe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserengil%2Flightphe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserengil%2Flightphe/lists"}