lightphe
A Lightweight Partially Homomorphic Encryption Library for Python
Decision gist · record as of 2026-08-14
Yes, if you need a practical homomorphic encryption library for a specific use case (addition, multiplication, or bitwise operations) and want to avoid the performance cost of fully homomorphic encryption. The library is actively maintained, has no known vulnerabilities, low install friction, and permissive licensing. However, verify that the specific algorithm you need is production-ready and suitable for your security requirements before deploying to sensitive workloads.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a pure Python wheel distribution.
- Actively maintained as of 2026-05-13 with recent releases.
- Depends on sympy, tqdm, and lightecc—all standard Python packages with no compiled dependencies.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute LightPHE freely in commercial and private projects with minimal restrictions.
last release 2026-05-12 (94 days) · last repo commit 2026-05-13 · 105 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 148,980 downloads/mo, #11,010 on PyPI
Alternatives
Verify before relying
pip install lightphe
from lightphe import LightPHE
cs = LightPHE(algorithm_name="Paillier")
m1 = 10000
c1 = cs.encrypt(m1)
c2 = cs.encrypt(500)
c3 = c1 + c2 # homomorphic addition
result = cs.decrypt(c3)- Whether the library has undergone formal cryptographic audit or security review
- Performance characteristics and practical key/ciphertext sizes for production workloads
- Whether all algorithms are production-ready or some are experimental
- Actual decryption result values for homomorphic operations in real usage
What it is and what it does
LightPHE is a Python library that implements multiple partially and somewhat homomorphic encryption schemes—cryptographic systems that allow specific operations (addition, multiplication, or bitwise operations) to be performed directly on encrypted data without decryption. It supports algorithms including RSA (multiplicatively homomorphic), Paillier and Damgard-Jurik (additively homomorphic), and elliptic curve variants in Weierstrass, Edwards, and Koblitz forms.
The library is designed as a practical alternative to fully homomorphic encryption when your use case only requires limited operations on encrypted data. It trades off full generality for speed, smaller ciphertexts, smaller keys, and lower memory overhead—making it suitable for memory-constrained environments and cloud offloading scenarios where you encrypt locally, send ciphertexts to an untrusted server for computation, and decrypt results locally.
Use it for
- Encrypt salary data locally, perform raises and bonuses as homomorphic addition in the cloud, decrypt results without revealing plaintext to the server
- Build encrypted analytics pipelines where aggregations happen on ciphertexts without exposing individual records
- Implement secure multi-party computation where parties exchange encrypted values and perform allowed operations without sharing private keys
- Prototype homomorphic encryption workflows before committing to slower fully homomorphic schemes
- Encrypt genomic or medical data and perform statistical operations on encrypted records for privacy-preserving research
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a practical homomorphic encryption library for a specific use case (addition, multiplication, or bitwise operations) and want to avoid the performance cost of fully homomorphic encryption.
The library is actively maintained, has no known vulnerabilities, low install friction, and permissive licensing. However, verify that the specific algorithm you need is production-ready and suitable for your security requirements before deploying to sensitive workloads.
Install
lightphe on PyPI
Before you install
Low install friction with a pure Python wheel distribution. Actively maintained as of 2026-05-13 with recent releases. Depends on sympy, tqdm, and lightecc—all standard Python packages with no compiled dependencies.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute LightPHE freely in commercial and private projects with minimal restrictions.
Quickstart
pip install lightphe
from lightphe import LightPHE
cs = LightPHE(algorithm_name="Paillier")
m1 = 10000
c1 = cs.encrypt(m1)
c2 = cs.encrypt(500)
c3 = c1 + c2 # homomorphic addition
result = cs.decrypt(c3)
Verify before relying
- Whether the library has undergone formal cryptographic audit or security review
- Performance characteristics and practical key/ciphertext sizes for production workloads
- Whether all algorithms are production-ready or some are experimental
- Actual decryption result values for homomorphic operations in real usage
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.5.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagessympytqdmlightecc |
| Maintenance | Actively maintained 94 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,980 / month, #11,010 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: lightphe-0.0.25-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “homomorphic encryption python”
- lightpheLightPHE provides a Python library implementing partially and…
- tensealTenSEAL performs homomorphic encryption operations on tensors,…
- pyragepyrage provides Python bindings to the Rust implementation of age,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Cryptography packages
Certifi provides Mozilla's curated collection of root SSL certificates for Python applications to validate TLS hosts and verify certificate trustworthiness.
cryptography provides cryptographic recipes and low-level primitives for symmetric encryption, message digests, key derivation, and other common cryptographic algorithms in Python.
Pure-Python RSA encryption, decryption, signing, and key generation following PKCS#1 v1.5, with command-line and library interfaces.
pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.
Provides Microsoft Entra ID token-based authentication for Azure SDK clients through a set of TokenCredential implementations that handle OAuth flows and managed identity support.
PyNaCl provides Python bindings to libsodium for digital signatures, secret-key and public-key encryption, hashing, message authentication, and password-based key derivation.
See also lightdsa · lightecc · tenseal · eciespy · gmssl · sslcrypto · py-ecc · PGPy · pycryptodomex · py_arkworks_bls12381