Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support standard Paillier encryption and decryption? #5

Open
Jinstorm opened this issue Nov 25, 2024 · 1 comment
Open

Support standard Paillier encryption and decryption? #5

Jinstorm opened this issue Nov 25, 2024 · 1 comment

Comments

@Jinstorm
Copy link

Jinstorm commented Nov 25, 2024

I noticed that in https://github.com/TNO-MPC/encryption_schemes.paillier/blob/main/src/tno/mpc/encryption_schemes/paillier/paillier.py#L505

image

It used a simplified version of Paillier which sets g=n+1, random value c=1, and discard the higher-order terms.

Does this encryption scheme only match the distributed partial-decryption implementation in https://github.com/TNO-MPC/protocols.distributed_keygen/blob/main/src/tno/mpc/protocols/distributed_keygen/distributed_keygen.py#L287, so that the distributed partial-decryption implementation cannot be used to decrypt ciphertext encrypted by the standard Paillier?

Also, is the proposed distributed Paillier key generation scheme limited to this simplified version or it can be directly used for the standard one?

@Quitlox
Copy link
Contributor

Quitlox commented Jan 14, 2025

In our implementation of standard Paillier, we wait with randomizing ciphertexts until the last moment (when the ciphertexts are actually communicated) (see also https://github.com/TNO-MPC/protocols.distributed_keygen/blob/main/README.md?plain=1#L195). The "higher order term" (i.e. the randomization) is therefore not dropped, but added at a later moment.

As for the choice of $g$, we indeed choose the "simple" variant of the key generation, which is easier and faster in implementation. This however is just a choice of parameters. If one implements a custom key generation which does choose $g$ differently, the decryption routine should still work as long as the parameters are set correctly.

As for the compatibility of the Paillier and Distributed Keygen modules, I am not sure I understand your question. In theory the ciphertexts produced by the Paillier and the DistributedKeygen module are fundamentally the same, but one can only use the decryption routine that matches the format of the secret key one has. In the distributedkeygen version, the secret key is distributed, and thus the decryption routine is very different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants