Imagine if Alice encrypts message to Bob (using public key $P_{bob}$) and then Bob encrypts the same message to Carol (using $P_{carol}$). Is there a way for Bob to prove that:
- $P_{carol}$ was indeed used
- Message is still the same that Alice passed to Bob.
Note1: Both ciphertexts and public keys are visible for everybody who needs to verify this proof. Note2: Public keys and messages are new for every encryption so deterministic encryption is ok, but public key cryptography has to be used
It looks similar to this topic, but there only one public key is used: Is there a public key semantically secure cryptosystem for which one can prove in zero knowledge the equivalence of two plaintexts? (comments from D.W and tylo are very helpful)
Obvious thought that comes to mind is to use commutative encryption, so everybody will be able to check whether $E_{bob}(E_{carol}(M)) == E_{carol}(E_{bob}(M))$ having $E_{carol}(M)$ and $E_{bob}(M)$ and access to $P_{bob}$ and $P_{carol}$. But then only deterministic encryption would work ($E_{bob}$ is encryption using $P_{bob}$).
The other solution that comes to my mind is using ZKP for DH 4-tuple if homomorphic encryption is used (for example El-Gamal - non-interactive proof is described here). So there is a way to prove that ($g$, $h$, $g^r$, $h^r$) is DH 4-tuple (where $h$ is public key, $r$ - random number, $g$ - generator of the group). In our case ciphertexts correspondent to message $M$ are $c_1=(g^{r_1}, M*P_{bob}^{r_1})$ and $c_2=(g^{r_2}, M*P_{carol}^{r_2})$. If to consider that $r_1=r_2=r$ (i.e. Alice also told Bob $r_1$) we can divide $c_1$ to $c_2$ and receive $(\frac{P_{bob}}{P_{carol}})^r$. Since everybody knows $P_{bob}$ and $P_{carol}$, Bob is able to create ZKP that $(g, (\frac{P_{bob}}{P_{carol}})$, $g^r$, $(\frac{P_{bob}}{P_{carol}})^r)$ is DH 4-tuple. In this way he can proof both statements (I believe :) ) Non interactive proof can be made. Having $c_1$ and $c_2$ Bob does:
- selects random $r_3$
- calculates $u=g^{r_3}$ and $v=(\frac{P_{bob}}{P_{carol}})^{r_3 }$
- Calculates hash $d = H(u || v) $
- Calculates $z=d*r+r_3$
- Publishes $(u, v, z)$
Everybody is able to verify the proof $(u, v, z)$ doing:
- Calculating $d = H(u || v)$
- checking that $g^z == (g^r)^d * u$
- $(\frac{P_{bob}}{P_{carol}})^z ==({\frac{c_1}{c_2}})^d * v $
Are there any other methods?