Paillier Encryption with Homomorphic Addition & "Scalar" Multiplication Support
Provide a Paillier public-key encryption module, supporting encryption & decryption of non-negative integers, in the range [0, n) (where n is the public key's modulus: n = p*q for p, q prime).
Support Paillier homomorphic operations: homomorphic addition and homomorphic "scalar" multiplication.
Re-blinding (obfuscation) of ciphertexts should also be supported, which can be used to ensure indistinguishability of Paillier ciphertexts following homomorphic operations (esp. useful when used in secure multi-party computation (MPC) protocols).
Homomorphic Addition:
Homomorphic addition should be supported, involving two Paillier ciphertexts, the effect of which is a new Paillier ciphertext encrypting the sum of the provided ciphertexts' associated plaintexts.
Enc_pk(p1) * Enc_pk(p2) = Enc_pk(p1 + p2),
where pk is a Paillier public key, p1 & p2 are plaintext values (non-negative integers in the range: [1, n) ), and n is the public key's modulus.
Specifically: Dec_sk( Enc_pk(p1) * Enc_pk(p2) mod n^2 ) = p1 + p2 mod n,
where pk is a Paillier public key and sk is the associated private key.
Homomorphic "Scalar" Multiplication:
Homomorphic "scalar" multiplication should be supported, involving a Paillier ciphertext and a plaintext "scalar" (non-negative integer), the effect of which is a new Paillier ciphertext encrypting the product of the provided ciphertext's associated plaintext and the given "scalar" multiplier.
Enc_pk(p)^k = Enc_pk(k * p),
where pk is a Paillier public key, p is a plaintext value (non-negative integer in the range: [1, n) ), k is a plaintext "scalar" multiplier (also in: [1, n) ), and n is the public key's modulus.
Specifically: Dec_sk( Enc_pk(p)^k mod n^2 ) = k * p mod n,
where pk is a Paillier public key and sk is the associated private key.
Homomorphic Addition (of a "Scalar"):
Additionally, homomorphic addition with a plaintext "scalar" (non-negative integer) should be provided, the effect of which is a new Paillier ciphertext encrypting the sum of the provided ciphertext's associated plaintext and the given "scalar".
Enc_pk(p) * g^k = Enc_pk(p + k),
where pk is a Paillier public key, g is the public generator, p is a plaintext value (non-negative integer in the range: [1, n) ), k is a plaintext "scalar" value (also in: [1, n) ), and n is the public key's modulus.
Specifically: Dec_sk( Enc_pk(p) * g^k mod n^2 ) = p + k mod n,
where pk is a Paillier public key and sk is the associated private key.
Paillier Encryption with Homomorphic Addition & "Scalar" Multiplication Support
Provide a Paillier public-key encryption module, supporting encryption & decryption of non-negative integers, in the range
[0, n)
(wheren
is the public key's modulus:n = p*q
forp
,q
prime).Homomorphic Addition: Homomorphic addition should be supported, involving two Paillier ciphertexts, the effect of which is a new Paillier ciphertext encrypting the sum of the provided ciphertexts' associated plaintexts.
Enc_pk(p1) * Enc_pk(p2) = Enc_pk(p1 + p2)
,pk
is a Paillier public key,p1
&p2
are plaintext values (non-negative integers in the range: [1, n) ), andn
is the public key's modulus.Dec_sk( Enc_pk(p1) * Enc_pk(p2) mod n^2 ) = p1 + p2 mod n
,pk
is a Paillier public key andsk
is the associated private key.Homomorphic "Scalar" Multiplication: Homomorphic "scalar" multiplication should be supported, involving a Paillier ciphertext and a plaintext "scalar" (non-negative integer), the effect of which is a new Paillier ciphertext encrypting the product of the provided ciphertext's associated plaintext and the given "scalar" multiplier.
Enc_pk(p)^k = Enc_pk(k * p)
,pk
is a Paillier public key,p
is a plaintext value (non-negative integer in the range: [1, n) ),k
is a plaintext "scalar" multiplier (also in: [1, n) ), andn
is the public key's modulus.Dec_sk( Enc_pk(p)^k mod n^2 ) = k * p mod n
,pk
is a Paillier public key andsk
is the associated private key.Homomorphic Addition (of a "Scalar"): Additionally, homomorphic addition with a plaintext "scalar" (non-negative integer) should be provided, the effect of which is a new Paillier ciphertext encrypting the sum of the provided ciphertext's associated plaintext and the given "scalar".
Enc_pk(p) * g^k = Enc_pk(p + k)
,pk
is a Paillier public key,g
is the public generator,p
is a plaintext value (non-negative integer in the range: [1, n) ),k
is a plaintext "scalar" value (also in: [1, n) ), andn
is the public key's modulus.Dec_sk( Enc_pk(p) * g^k mod n^2 ) = p + k mod n
,pk
is a Paillier public key andsk
is the associated private key.