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

document need for explicit rerandomisation #22

Open
mortendahl opened this issue Jan 18, 2017 · 3 comments
Open

document need for explicit rerandomisation #22

mortendahl opened this issue Jan 18, 2017 · 3 comments

Comments

@mortendahl
Copy link
Contributor

addition and multiplication does not implicitly rerandomise ciphertexts for performance reasons

this behaviour should be very clear from the documentation as it's a potential security concern

@polyfractal
Copy link

Would you mind expanding on this? From my limited playing around with the library, it appears the cyphertext changes differently on each operation. I.e. if I encrypt two values from the same key, perform the same operation on each and print out the cyphertext, they appear different.

Am I misunderstanding?

@mortendahl
Copy link
Contributor Author

Paillier is what's called a probabilistic encryption scheme, meaning every ciphertext is a mix of both the plaintext and a randomness. Hence, two encryptions of the same plaintext will most likely give two different ciphertexts as the randomness will most likely be different. This is good since it provides a stronger level of security, known as semantic security.

This GitHub issue is related to the fact that the library does not currently refresh the randomness automatically after performing homomorphic operations on ciphertexts, but requires an explicit call to rerandomise to do so -- this is for performance reasons since rerandomisation is expensive and it's enough to do so once even if several homomorphic operations are performed. The reason for doing this in the first place is to make sure that a ciphertext produced through homomorphic operations cannot be distinguished from a fresh ciphertext, e.g. Randomise(Encrypt(2) + Encrypt(2)) ~ Encrypt(4), where ~ means indistinguishable.

@polyfractal
Copy link

Thanks for the explanation! Between this and some extra reading I think I'm clearer on how it all works :)

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

No branches or pull requests

2 participants