--- id: lightphe version: "0.0.25" license: unclear license_treatment: permissive maintenance: active --- # lightphe — A Lightweight Partially Homomorphic Encryption Library for Python License: permissive · Maintenance: active · Downloads: 149.0K/mo ## 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 above — verify before relying. LightPHE provides a Python library implementing partially and somewhat homomorphic encryption schemes including RSA, ElGamal, Paillier, and elliptic curve variants, allowing encrypted data to be computed on without decryption. 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 pip install lightphe uv add lightphe poetry add lightphe ## Installing lightphe 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 149.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags homomorphic encryption python, partially homomorphic encryption library, encrypt and compute without decryption, paillier rsa elgamal python, elliptic curve encryption schemes, lightweight cryptographic library, additive multiplicative homomorphic, homomorphic-encryption, cryptography, privacy-preserving [View on SkillFed](https://skillfed.io/packages/lightphe) · [View on PyPI](https://pypi.org/project/lightphe/)