Given have two public keys $k1$ and $k2$, $E_{k1}(E_{k2}(m_1))$ and $m_2$.
Is it possible to calculate $E_{k1}(E_{k2}(m_1 + m2))$? (or with multiplication instead of addition)
At a first glance, I thought that it is possible:
- Calculate $E_{k2}(m_2)$.
- Calculate $E_{k1}(E_{k2}(m_1))^{E_{k2}(m_2)}$.
- From the power property of Paillier encryption, this should be the same as: $E_{k1}(E_{k2}(m_1)\cdot E_{k2}(m_2))$.
- From the homomorphic property, this is $E_{k1}(E_{k2}(m_1 + m_2))$.
- I thought that decryption of the above expression, first with the corresponding private key of $k_1$ and then with that of $k_2$ should give $m_1 + m_2$.
First of all, if you see any problem in my construction, or if you can see another way to do it - please explain.
I tried to run this procedure using two implementations I found on the Web, but I got wrong results.
What am I doing wrong? Is it possible at all?