XTraceAI/cuhepy
GPU-accelerated homomorphic encryption in Python: Paillier and BFV, with encrypted nearest-neighbour search. Experimental research code.
What it solves
cuhepy provides GPU-accelerated homomorphic encryption (HE) for Python, allowing computations to be performed on encrypted data without needing to decrypt it first. It specifically addresses the efficiency gaps in HE by providing both Paillier and BFV schemes, each with different performance trade-offs between client-side and evaluator-side compute costs.
How it works
The project implements two primary encryption schemes:
- Paillier: Supports homomorphic addition. It includes a CUDA-accelerated backend for faster processing and an $\alpha$-subgroup variant for optimized lookup operations.
- BFV (Brakerski-Fan-Vercauteren): A leveled scheme supporting addition, multiplication, and rotation. It uses SIMD batching and offers a C++ RNS/NTT backend for performance.
These primitives are used to build cuhepy.hamming, an application for encrypted k-nearest-neighbour search. In this scenario, an evaluator can rank encrypted vectors by Hamming distance without ever seeing the raw vectors, the query, or the final distances.
Who it’s for
Researchers and developers interested in privacy-preserving computation and homomorphic encryption. Because it is experimental research code and not audited, it is intended for study and measurement rather than protecting real-world production data.
Highlights
- Dual-Scheme Support: Offers both Paillier and BFV to allow users to choose based on whether they want to minimize client or evaluator compute overhead.
- GPU Acceleration: Optional CUDA backends for Paillier to speed up encrypted operations.
- C++ Optimizations: High-performance C++ RNS/NTT backends for the BFV scheme.
- Integrated Application: Includes a working example of encrypted k-nearest-neighbour search using Hamming distance.
- Security Research: Transparently publishes known attacks and vulnerabilities within the repository to aid study.
Related
- Project
- Project
- Project
- Project