I'm confused about the definition of an interactive zero-knowledge proof (the simulator-transcript-thingy).
Assume the following setup:
- $P$ and $V$ do a Diffie-Hellman key exchange to generate the shared secret S. They then both compute the hash $H(S)$.
- $P$ computes $\sigma = sig(sk, H(S))$ and sends $\sigma$ to $V$.
- $V$ checks whether $ver(pk, H(S), \sigma) = 1$ and iff it is, assumes $P$ to have proven its identity.
For simplicity, let's assume the base to be $2$.
$sig$ is defined in such a way that its output has $k$ bit and
$∀σ∈\{0,1\}^k, sk∈\{0,1\}^n : (∃S∈\{0,1\}^ℓ : sig(sk, H(S)) = σ)$
where $n$ is the length of the private key and $ℓ$ is the length of the secret created via Diffie-Hellman.
We actually need to require that
$∀σ∈\{0,1\}^k, sk∈\{0,1\}^n, a∈ℤ_q, S∈ℤ_q : (∃b∈ℤ_q : sig(sk, S \mod p) = σ, S = g^{a\cdot b}))$
where $g$ is the primitive root of Diffie-Hellman, $p$ is prime, and $q$ is the order of the group $<g>$;. I merely wrote the formula above so it's easy enough for everyone to understand. The jump from the weaker definition above to the one described by the second formula doesn't seem too big.
As with all signatures, an attacker who knows many $sig(sk, M)$ for different $M$ but the same $s$k can learn about $sk$.
This protocol therefore is obviously not zero-knowledge. However, it seems to fit the definition as I can't think of any argument as to why for any PPT attacker $A$ knowing only about $pk$ communicating with $P$, it's not possible to find a PPT $S$ only knowing about $pk$ which simulates the transcript between $A$ and $P$.
Furthermore, I don't see how the transcript contains information about $sk$ (which after all is what the zero-knowledge definition is about). What I think I have done (and am btw pretty sure I didn't do as the definition of zero-knowledge was created by smart people, so I'm quite aware that I made a mistake somewhere (and I want to know where)) is to give $V$ information about $sk$ without there being information about $sk$ in the transcript.
One could even just let $P$ send $pk \oplus H(S)$ to $V$, giving the secret to $V$ without anyone who can only look at the transcript being able to tell whether the entity {creating; participating in the creating of} the transcript knows the secret ($pk$ which can be regarded as a password, no signature function required).