tl;dr: We were given a homework, in which we should discuss, whether encrypting twice in the Naor-Yung scheme is actually necessary. I could prove that it is, by constructing an attacker on a scheme which encrypts only once. However, it seems to me, as if this attack could also work on the original version. This obviously has to be wrong. I would like to know where I am wrong.
We are currently discussing the Naor-Yung scheme in a lecture and were given the following homework:
Consider the CPA-secure PKE $\Pi_1 := (\mathsf{Gen}_1, \mathsf{Enc}_1, \mathsf{Dec}_1)$, the language \begin{align*} \mathcal{L} := \left\{ (\mathsf{ek},c) \mid \exists m,s : \mathsf{Enc}_1(\mathsf{ek},m;s) = c \right\} \in \mathcal{NP} \end{align*} (where $s$ is the random tape) and the NIZK $(\mathsf{V}, \mathsf{P})$ for $\mathcal{L}$.
We define a new PKE $\Pi = (\mathsf{Gen}, \mathsf{Enc}, \mathsf{Dec})$ as follows:
- $\mathsf{Gen}(1^n)$:
- $(\mathsf{dk}', \mathsf{ek}') \leftarrow \mathsf{Gen}_1(1^n)$
- $r \leftarrow \left\{ 0,1 \right\}^{\mathsf{poly}(n)}$
- $\mathsf{ek} := (\mathsf{ek}', r)$
- $\mathsf{dk} := (\mathsf{ek}', \mathsf{dk}', r)$
- return $(\mathsf{ek}, \mathsf{dk})$
- $\mathsf{Enc}(\mathsf{ek}, m)$
- $s \leftarrow \left\{ 0,1 \right\}^{\mathsf{poly}(n)}$
- $c' \leftarrow \mathsf{Enc}_1(\mathsf{ek'}, m; s)$
- $\pi \leftarrow \mathsf{P}(r,(\mathsf{ek}',c'),(m,s))$
- return $c:=(c', \pi)$
- $\mathsf{Dec}(\mathsf{dk}, c)$
- return $\left\{ \begin{array}{ll} \mathsf{Dec}_1(\mathsf{dk}',c') & \textrm{if } \mathsf{V}(r, (\mathsf{ek}',c'), \pi) = 1 \\ \bot & \, \textrm{else} \\ \end{array} \right.$
Is $\Pi$ CCA1-secure?
So basically, the question was, whether encrypting twice (as in Naor-Yung) is actually necessary.
I came up with the following solution:
We take a CPA-secure PKE $\Pi_0 := (\mathsf{Gen}_0, \mathsf{Enc}_0, \mathsf{Dec}_0)$ and define $\Pi_1 := (\mathsf{Gen}_0, \mathsf{Enc}_1, \mathsf{Dec}_1)$ with:
- $\mathsf{Enc}_1(\mathsf{ek}, m)$
- $t \leftarrow \left\{0,1\right\}^n$
- return $(c,t) := (\mathsf{Enc}_0(\mathsf{ek}, m),t)$
- $\mathsf{Dec}(\mathsf{dk}, (c,t))$
- return $\left\{ \begin{array}{ll} \mathsf{dk} & \textrm{if } t = 0^n \\ \mathsf{Dec}_0(\mathsf{dk},c)& \, \textrm{else} \\ \end{array} \right.$
It is obvious, that this construction is also CPA-secure, thus we may use it in $\Pi$.
Using a NIZK $(\mathsf{V}_0, \mathsf{P}_0)$ for the language \begin{align*} \mathcal{L}_0 := \left\{ (\mathsf{ek},c) \mid \exists m,s : \mathsf{Enc}_0(\mathsf{ek},m;s) = c \right\} \in \mathcal{NP} \end{align*} we find a straightforward construction for the NIZK $(\mathsf{V}, \mathsf{P})$ for $\mathcal{L}$. (In short: We can simply omit the random string $t$ and then use $\mathsf{V}_0$, respectively $\mathsf{P}_0$.)
Now the following problem arises: If $\pi$ proves $(\mathsf{ek}, (c,t)) \in \mathcal{L}$, then $\pi$ also proves $(\mathsf{ek}, (c,t')) \in \mathcal{L}$ for any $t' \in \left\{0,1\right\}^n$. This allows a CCA1 attacker to completely break $\Pi$:
- Choose a random message $m$ and compute $((c',t),\pi) \leftarrow \mathsf{Enc}(\mathsf{ek},m)$
- Use the decryption oracle to compute $\mathsf{dk} \leftarrow \mathsf{Dec}(\mathsf{dk},((c',0^n),\pi))$
Hence, $\Pi$ is not CCA1-secure.
Now to my question. It is not part of the homework, but it genuinely interests me: I would argue, that this technique can similarly be applied to the Naor-Yung scheme, because I can not figure out the point at which it would fail. However, it is clear to me, that it must fail of course, since we already proved in the lecture, that the scheme is CCA1-secure.
So, where does my technique fail?
If I would have to guess, I would say, that my construction for $(\mathsf{V}, \mathsf{P})$ maybe is not ZK.
However, I have already tried constructing a reduction from a distinguisher for $(\mathsf{V}_0, \mathsf{P}_0)$ to a distinguisher for $(\mathsf{V}, \mathsf{P})$, to prove that it actually is a ZK and do not see, where I could have made a mistake. (The reduction simply appends random strings to the cipher texts.)