r/cryptography • • 21d ago

Homomorphic Encryption for (almost) every tech stack!

Homomorphic encryption is a cryptographic technique that enables direct computation on encrypted data without ever decrypting it first—keeping sensitive data secure even during processing.

lightphe is a comprehensive homomorphic encryption library supporting an unmatched variety of encryption schemes:

• Multiplicatively Homomorphic: RSA, ElGamal.
• Additively Homomorphic: Paillier, Damgard-Jurik, Exponential ElGamal, Elliptic Curve ElGamal, Benaloh, Naccache-Stern, Okamoto-Uchiyama.
• Logical / Bitwise: Goldwasser-Micali (XOR), Sander-Young-Yung (AND).
• Somewhat Homomorphic: Boneh-Goh-Nissim (Unlimited Additions and Only One Multiplication)

To make these powerful cryptographic algorithms easily accessible across modern software architectures, lightphe offers full multi-language support with native implementations in:

🐍 Python: https://github.com/serengil/LightPHE
🐹 Go: https://github.com/serengil/lightphe-go
☕ Java: https://github.com/serengil/lightphe4j
🟨 TypeScript: https://github.com/serengil/lightphe-ts

13 Upvotes

6 comments sorted by

3

u/gnahraf 21d ago

Thank you for sharing this. I'm an application programmer, not a cryptographer, but I've been musing over if/how HE may be applied in the setting of an otherwise private, append-only ledger where you periodically reveal a total of some integral column-value w/o revealing the individual values (eg for regulatory purposes).

The issue in my application is commitment: I need a way to record an HE encoded value before the subsequent values are known (values from future ledger rows). Is such a thing even possible? (My gut says not; the HE encoded values are interdependent, but I have to ask)

2

u/Natanael_L 20d ago

You can in theory, there's HE with ZKP attached, you make a regular commitment of plaintext and then prove the HE payload match it, then prove the HE operations are legit as according to the protocol

The harder problem is who can reveal the calculation because somebody must have the key. You can do it easy if you're proving on your own behalf with the blockchain as a ledger, in other settings you need some threshold HE with some consortium thing for the consensus with rekeying and all

1

u/gnahraf 20d ago

The harder problem is who can reveal the calculation because somebody must have the key.

The setting is a private ledger. The only thing made public about its contents is an opaque chain of commitment hashes (one per row). That is, the only thing made public about the ledger is how many rows are in its commitment chain. The ledger owner is the one who is doing all the revealing; they'd also own the key for the HE proof they periodically generate and share with relevant parties. If possible, I want to avoid consensus-based mechanisms for proving things entirely.

1

u/Natanael_L 20d ago

Then you can do plain transparency logs instead of blockchain, and ZKP over your commitments. You have to commit to your secret RNG seed too for the FHE payload. The rest is "just" regular cryptographic engineering (relatively speaking)

1

u/gnahraf 20d ago

👍 (..🤞)