cryptokit icon indicating copy to clipboard operation
cryptokit copied to clipboard

Feature Request: Add Paillier Encryption

Open Athishpranav2003 opened this issue 1 year ago • 4 comments

Extend support for Homomorphic Encryption Algorithm - Paillier Encryption. This could be useful since this scheme is widely used in E-voting related work.

Athishpranav2003 avatar Aug 20 '24 18:08 Athishpranav2003

@xavierleroy I am raising this issue and willing to work on it as well once you confirm. Incase if this feature is not appropriate please let me know asap

Athishpranav2003 avatar Aug 20 '24 18:08 Athishpranav2003

Thanks for pointing Paillier encryption out, I didn't know about it. For reference: https://en.wikipedia.org/wiki/Paillier_cryptosystem

As you noticed, Cryptokit is very poor in the public-key cryptography department, in part because it doesn't implement elliptic curves. Paillier is just modular arithmetic, and would add new capabilities (homomorphic encryption), so I'm in favor of having it in Cryptokit eventually.

Feel free to try to implement it and to submit a pull request.

xavierleroy avatar Aug 25 '24 08:08 xavierleroy

@xavierleroy thanks for the reply. I have already added an implementation in mirage-crypto so I guess adding it here won't be a problem

Athishpranav2003 avatar Aug 25 '24 10:08 Athishpranav2003

https://github.com/Athishpranav2003/mirage-crypto

I added the implementation and tested it here. Will go ahead and add it to cryptokit as well

Athishpranav2003 avatar Aug 25 '24 10:08 Athishpranav2003