The Commutative Cipher Setup
- Alice and Bob agree on a 2048-bit safe-prime $p$, where $(p-1)/2$ is also a prime.
- Both parties have an encryption exponent $e$ in the range $(1, p-1)$ with $gcd(e, p-1) = 1$. And a decryption exponent $d$ chosen such that $d * e ≡ 1\bmod (p-1)$. Alice has $(e_A, d_A)$ and Bob has $(e_B, d_B)$ as their private key pairs.
Note: I've also discovered that @fgrieu has proposed two variants of Pohlig-Hellman adressing some of the problems of modular exponentiation. Please assume the the key generation is done according to their explanation in both. variant 1, variant 2
We expect, this commutative cipher setup should be secure enough to use.
The Protocol
Alice has a message $m$ and wants to perform an oblivious PRF with Bob for this message.
The steps are as follows:
Alice seeds a PRG with $m$ and generates a 2048 (or 2047) bit random output $r$
a. For the properties $r$ satisfies, please check the PH variant by @fgrieu
Alice calculates the following encrypted random sequence with modular exponentiation, $E_A(r) = r^{e_A} \bmod p$ and sends the result to Bob.
Bob calculates $E_B(E_A(r)) = (E_A(r))^{e_B}\bmod p = E_{A,B}(r)$ and sends the result $E_{A,B}(r)$ back to Alice
Finally Alice calculates $D_A(E_{A,B}(r))=(E_{A,B}(r))^{d_A}\bmod p = E_B(r)$.
This should be the same value, where Bob:
- Seeds the same PRG with the message $m$ to get $r$ (The same sequence Alice got from her PRG)
- And calculate $E_B(r) = r^{e_B}\bmod p$
I believe this protocol should be satisfying the requirements of an Oblivious PRF. I'm assuming, given a random input, we can use modular exponentiation as a PRF. Using the commutative nature of modular exponentiation, I believe we can achieve an Oblivious PRF. However I'm not sure if that's true, and I don't know how to prove this.
Once Alice and Bob have achieved an Oblivious PRF, My final goal for this OPRF is to use it for a Private Set Intersection protocol. Based on the answer of @Mikero in the question: How can Alice enable Bob to look-up values in a private map
Do you see any vulnerabilities here whether it might leak the keys of either parties or the message of Alice? Do you see any problems with my assumptions and utilization of modular exponentiation, if there are any points potentially insecure and should be avoided or fixed?