Motivation
Consider the following variant of Diffie-Hellman key exchange protocol for two parties:
- Assume Alice and Bob share $\mathbb{G}$ of order $q$ generated by $g$
- Alice samples $a$ uniformly from $\mathbb{Z}^q$, and sends $h := g^a$ to Bob
- Bob samples $b$ uniformly from $\mathbb{Z}^q$, and sends $h^b = g^{ab}$ to Alice
- The shared key is $g^b$
Alice can calculate $g^b$ by raising $h^b$ that he received from Bob by $a^{-1}$ so he will get: $(h^b)^{a^{-1}} = (g^{ab})^{a^{-1}} = g^b$
My question is how to prove that the above protocol is secure (assuming DDH assumption holds?
I tried to prove it by reduction:
upon receiving $(\mathbb{G},q,g,g_1=g^x,g_2=g^y,g_3)$ run the above protocol s.t. Alex sends $g_1$ to Bob, then Bob returns $g_3$, and both will agree on key $g_2$. i.e. we simulate the case where: $a=x$ and $b=y$.
In case $g_3=g^{xy}$, then $(Transcript, Key) = (g^x,g^{xy},g^y)$
In case $g_3=g^z$ for $z$ sampled uniformly from $\mathbb{Z}^q$, then: $(Transcript, Key) = (g^x,g^z,g^y)$
The problem with my solution is that the difference between the two cases is in the distribution of $Transcript$ while $Key$ is the same, and this is different from what required in the definition.
In another try, I simulated the protocol s.t. Alice sends $g_1$, Bob sends $g_2$ and they agree on $g_3$, i.e. simulate the case: $a=x$ and $b=x^{-1}y$, but this will not work because the key the agree on will be $g^y\neq g^b=g^{x^{-1}y}$
Edit: General case
We have $A_1,...,A_T$ parties (where $T$ is polynomial) and $B$. the protocol is:
each $A_i$ sample some $a_i$ uniformly and send $h_i := g^{a_i}$ to $B$
upon receiving $h_1,...,h_T$, $B$ samples $b$ uniformly and sends $h_i^b$ to $A_i$
The key is $g^b$.
Any idea of how to prove the general protocol's security?