We provide COC schemes for three basic predicates: “equality”, “inequality”, and “greater than”.
3.1 COC for “Equality” Predicate
To determine if x = y, we compute x/y via the multiplicatively homomorphic encryption scheme. If x/y = 1, A and B get the message m; otherwise, they get nothing. The scheme EQ-COC is described in Figure 1.
Theorem 1. The EQ-COC scheme has the correctness property, unconditional sender’s security, and computational receiver’s security if the underlying homo-morphic encryption scheme has semantic security.
Proof. For correctness, if x = y, A and B compute m by
DSK(e) = DSK(EP K(m)⊗ (EP K(x)⊗ EP K(y)−1)r)
= DSK(EP K(m)⊗ (EP K(1)r))
= DSK(EP K(m))
= m.
– System parameters: (p, q, g).
– Message sender S has a message m and a key pair (P KS, SKS).
– Receiver A has a secret x, and receiver B has a secret y, where x, y∈ Gq. – Receiver A and B have a common key pair (P K, SK)
1. A and B send EP KS(EP K(x)) and EP KS(EP K(y)) to S respectively.
2. S decrypts the received messages to get EP K(x) and EP K(y). S computes e = EP K(m)⊗ (EP K(x)⊗ EP K(y)−1)r
and sends it to A and B, where r∈RZq.
3. A and B compute ˆm = DSK(e) and identify whether ˆm is valid.
Fig. 1. COC scheme for “Equality” predicate: EQ-COC
For sender’s security, we show that if x= y, m is unconditionally secure to A and B. Since e = EP K(m)⊗ (EP K(x)⊗ EP K(y)−1)r) = EP K(m· (x/y)r), r∈R
Zq, for any possible m, there is another r∈ Zq such that e = EP K(m·(x/y)r).
As long as x= y, e can be decrypted to any possible message in Gq. This ensures unconditional security of S’s message m.
For receiver’s security, it is easy to see that S gets no information about x and y due to semantic security of the encryption scheme. Since A and B are symmetric, we only prove the security of B against A. We construct a simulator SA for A’s real view
VA(P K, SK, P KS, x) = (P K, SK, P KS, x, EP KS(EP K(x)), EP KS(EP K(y)), e).
The simulator SA on input (P K, SK, P KS, x, ˆm) is as follows, where ˆm (may be a valid message or a random value) is the output of a real execution:
1. Choose a random value y∗∈ Gq. 2. Compute e∗= EP K( ˆm).
3. Output (P K, SK, P KS, x, EP KS(EP K(x)), EP KS(EP K(y∗)), e∗).
By semantic security of the encryption scheme, A cannot distinguish the cipher-texts EP KS(EP K(y∗)) and EP KS(EP K(y)). Furthermore, since e∗ is identically distributed as e, the output of SA is indistinguishable from VA. Therefore, A gets no information about y except those computed from x and ˆm. 2 In the scheme, we assume x, y∈ Gq. If the length of x (or y) is longer than|p|, A and B compare h(x) and h(y), where h is a collision-resistant hash function.
This technique is applied to later schemes whenever necessary.
3.2 COC for “Inequality” Predicate
COC for the “inequality” predicate is more complicated than that for the “equal-ity” predicate. A and B need to send the ciphertexts of their secrets bit by bit.
We use additively homomorphic encryption schemes in this scheme, which is depicted in Figure 2.
– System parameters: n.
– Message sender S has a message m and a key pair (P KS, SKS).
– Receiver A has a secret x, and receiver B has a secret y, where|x| = |y| = n.
– Receiver A and B have a common key pair (P K, SK), where P K = (g, N ).
1. A and B send EP KS(EP K(xi)) and EP KS(EP K(yi)) to S respectively, 1≤ i ≤ n.
2. For each i∈ {1, 2, . . . , n}, S decrypts the received messages to get EP K(xi) and EP K(yi), and computes the following values via homomorphic encryption:
(a) di= xi− yi, di= xi+ yi− 1.
(b) ei= 2ei+1+ di, where en+1= 0.
(c) ci= m + ri(ei− di+ di), where ri∈RZN
3. S sends EP K(c) in a random order to A and B, where c =c1, c2, . . . , cn.
4. A and B decrypt the received messages and identify the correct message if exis-tent.
Fig. 2. COC scheme for “Inequality” predicate: INE-COC
In the scheme, di= xi− yi and di= xi− ¯yi are 0, 1 or -1. If xi= yi, di= 0;
otherwise, di = 0. Let l be the leftmost different bit between x and y, i.e. the largest i such that di = 0. We have ei= 0 if i > l, ei= 0 if i < l, and ei= di if i = l.
If x = y, the message m is embedded into the index i at which xi and yi are distinct. However, we have to avoid leaking information of the number of distinct bits. So S masks m with random values on all indices except the index l.
It leaves only one copy of m in ci’s:
– For i = l, since el = dl and dl= xl− ¯yl = 0, (el− dl+ dl) = 0. Therefore, cl= m.
– For 1≤ i < l, ciwould be a random value because ei−di+di= 2ei+1+di= 0 and ri∈RZN.
– For l < i ≤ n, ci is also a random value because ei = di = 0, di = 0 and ri∈RZN.
Theorem 2. The INE-COC scheme has the correctness property, unconditional sender’s security, and computational receiver’s security if the underlying homo-morphic encryption scheme has semantic security.
Proof. (sketch) Let l be the index of the first different bit of x and y (from the most significant bit). We see that dl= el= xl−yl= 1 or−1, and dl= xj− ¯yj= 0. Therefore, cl = m + rl(el− dl+ dl) = m + rl· 0 = m. Thus, A and B get m from the permutation of the encryptions.
For sender’s security, we see that if x = y, all di’s and ei’s are 0, and all di’s are not 0 (in fact, +1 or−1). Thus, for each index i, ci= m+ri(0±1) = m±ri. Since for any possible ˜m, there exists an ˜ri such that ci= ˜m + ˜ri, m is unconditionally secure to A and B.
For receiver’s security, S gets no information about x and y by the semantic security of the encryption scheme. As in the proof of EQ-COC, for each of A and B, we can construct a simulator such that the adversary cannot distinguish the real view and the simulated view. Therefore the receiver’s security holds.2
– System parameters: (p, q, g).
– Message sender S has a message m and a key pair (P KS, SKS).
– Receiver A has a secret x, and receiver B has a secret y, where x, y∈ Gq,|x| =
|y| = n.
– Receiver A and B have a common key pair (P K, SK)
1. A encodes x as S1x, and sends EP KS(EP K(Sx1[i])) to S, 1≤ i ≤ n.
2. B encodes y as Sy0, and sends EP KS(EP K(Sy0[i])) to S, 1≤ i ≤ n.
3. S decrypts the received messages and computes
ei= EP K(m)⊗ (EP K(S1x[i])⊗ EP K(Sy0[i])−1)ri, where ri∈RGq, 1≤ i ≤ n. S sends ei’s to A and B in a random order.
4. A and B search ˆmi= DSK(ei), 1≤ i ≤ n, to identify the correct m if existent.
Fig. 3. COC scheme for “Greater Than” predicate: GT-COC
3.3 COC for “Greater Than” Predicate
For the “greater than” predicate, we use the encoding methods mentioned in Section 2.4. A encodes x via 1-encoding and B encodes y via 0-encoding. The problem is then reduced to the “equality” problem immediately. When S receives encrypted Sx1 and Sy0, he checks equality for corresponding strings. The scheme is presented in Figure 3. The security argument is the same as the proof of the EQ-COC scheme. This method is more efficient than the GT-COC12scheme (in the next section, by setting m0 as a random number).