Alice and Bob how to know whose number is bigger without giving away their own's

Definiteness: Suppose Alice has number $i$ and Bob has number $j$ and $1\leq i,j \leq 9$. We need a protocol for them to decide whether $i < j$ in the end(aside from their own values) Solution: Let $M$ be the set of all $N$-bit nonnegative integers Let $Q_N$ be the set of all one-one and onto function from $M$ to $M$ Alice generates a public key from $Q_N$, called $E_a$, and the inverse function of $E_a$ is $D_a$ Bob picks a random value $x \in M$, compute $k = E_a(x)$, then send $k - j$ to Alice Alice computes $y_u=D_a(k - j + u)$ for $u = 1,2,\dots,9$ Alice generates a random prime $p$ of $N/2$-bit, and computes $z_u=y_u(\mod p)$ for all $u$....

January 14, 2022 · 1 min · mobilephone724