Bijective encryption function in Paillier cryptoststem In Paillier cryptoststem many ciphertexts can correspond to the same plaintext. How can I modify the scheme so to make the correspondence between ciphertexts and plaintexts a one to one correspondece? I've already eliminated the randomness from the scheme (i.e. all encryptions are done with the same $r$).

My reason for this is that I want to compute the arithmetic mean of two encrypted numbers by repeatedly subtracting 2 (which I can do no-problem) until I hit 0 which I then need to detect.
How can I modify the scheme so to make the correspondence between ciphertexts and plaintexts a one to one correspondece?


You do realize that this would make encryption insecure, don't you?  After all, someone who knows what an encrypted 1 looks like can subtract 1 until he gets one; this immediately reveals what value the original ciphertext stood for.

If security is not a requirement, might I suggest using the identity function as your encryption mechanism.  It is deterministic, it can be implemented quite efficiently, and for that matter, it is fully homomorphic.