Saturday, October 3, 2015

Secure and Efficient Protocols for Iris Identification


Today large amount of biometric data is being collected by all the countries like USA, UAE, UK, India, etc for the authentication process of their citizens and foreigners entering their country.  Though these data are extremely efficient in authentication, but it has some problems. The data must be securely stored without any leakage as this biometric data of a person can be easily used to replicate him for authentication and thus imposter that person to perform malicious deeds. So the computation, for authentication, on the biometric data requires the data to remain private and reveal only the outcome of the computation.

Feature Vector:

The biometric data we are going to work on is collected in the form of a feature vector X from the iris of a person. Iris code, X is an m-bit string, where each X  gives information about some particular feature.

X = X1 X2 X3 X4 …. Xm

But not all Xi have correct data as there is always some amount of noise which gets captured during the feature extraction from the iris. So we have another vector M(X) of m bits which says

M(X) = M(X1)M(X2) M( X3) M( X4)  ….M(Xm )
M(Xi) = 0, Xi is noise and should not be considered for computation
M(Xi) = 1, Xi is correctly captured and should be considered for computation

So we use only those Xi for which M(Xi) is 1. Now for authentication we need to match two biometric data X and Y and check whether they have a threshold amount of matching or not.

Hamming Distance:

Definition:

The hamming distance of two vectors X and Y can be computed as follows:

HD(X, Y) = (∑mi=1 (Xi  Yi ))/m

Modification:

But here since the X and Y vectors have some unreliable bits we skip them by multiplying the term by both M(Xi) and M(Yi).  D(X, Y) is the distance between the two vectors and M(X, Y) is the number of bits on which the computation is done. So our HD(X, Y) becomes:

HD(X, Y) = (∑mi=1 (Xi  Yi )M(Xi)M(Yi))/( ∑mi=1(M(Xi)M(Yi))
                 = D(X, Y)/ M(X ,Y)

Our HD(X, Y) must be lesser than a threshold value T in order to authenticate the person, as this T value will define the maximum number of reliable bits the two feature vectors can differ in. If the two feature vectors have a HD more than T then they are considered to be from different persons.

HD(X, Y) = D(X, Y)/ M(X ,Y) ≤ T

Additive Homomorphic Encryption:
We need additive homomorphic encryption for this scheme. In additive homomorphic scheme, if a1 = Enc(m1) and  a2 = Enc(m2)  then a1.a2 = Enc(m1+ m2).

Main  Protocol:

Y is the feature vector that has been captured previously and stored in the database and X is the feature vector that has been captured to authenticate the person later. When the person comes for authentication, X is presented to the authenticator and he tries to find an Y from his database which has HD(X, Y) ≤ T. If he finds such a Y then the person is authenticated else the authentication fails. Here the authenticator is the server and the person who wants to be authenticated is the client. Client C does not share its Xi value and server S does not share its Yi. Using the protocol, C and S securely compute whether the feature vector X has a threshold matching with any of the Y’s or not. The vector X and Y may be misaligned. So the Y vector is shifted 2c+1 times, for j= -c to c. This can be seen in the protocol. We use the following computations in our protocol. 

Xi  Yi = (1- Xi)Yi  (1-Yi)Xi
D(X, Y) = ∑mi=1 ((1- Xi)Yi  (1-Yi)Xi )M(Xi)M(Yi)
M(X, Y) = mi=1(M(Xi)M(Yi) 

The main protocol is as follows:

Input: C has biometric X, M(X) and key pair (pk, sk); S has a database D composed of Y, M(Y ) biometrics.

Output: C learns what records in D resulted in match with X if any, i.e., it learns a bit as a result of comparison of X with each Y  D.

Protocol:
  1. For each i = 1, . . ., m, C computes encryptions <ai1, ai2> = <Enc(XiM(Xi)), Enc((1− Xi)M(Xi))> and sends them to S.
  2. For each i = 1, . . ., m, S computes encryption of M(Xi) by setting ai3 = ai1 · ai2 = Enc(XiM(Xi)) · Enc((1 − Xi)M(Xi)) = Enc(M(Xi)).
  3. For each record Y in the database, S and C perform the following steps in parallel:

       a. For each amount of shift j = −c, . . ., 0, . . ., c, S rotates the bits of Y by the appropriate number of positions to obtain Yj and proceeds with all Yj ’s in parallel.

          i. To compute (Xi  Yji )M(Xi)M(Yji) = (Xi(1 − Yji ) + (1 − Xi) Yji )M(Xi)M(Yji) in encrypted form, S computes
bji = a(1− Yji )M(Yji ) i1 · aYji M(Yji)i2
    = Enc(XiM(Xi)(1 − Yji )M(Yji) + (1 − Xi)M(Xi) Yji M(Yji)).

    ii. S adds the values contained in bji’s to obtain bj =  πm i=1 bji = Enc( ∑m i=1(Xi  Yji )M(Xi)M(Yji )) = Enc(||(X  Yj ) ∩ M(X) ∩ M(Y j)||). S then “lifts up” the result, blinds, and randomizes it as cj = (bj ) 2^ℓ · Enc(r jS ), where r jS  {0, 1} log m+ℓ+κ , and sends the resulting cj to C.

          iii. To obtain T(||M(X) ∩ M(Y j)||), S computes dj i = a M(Yji ) i3 = Enc(M(Xi) · M(Y j i )) and dj = ( πm i=1 dji)T = Enc(T(∑m i=1 M(Xi)M(Y j i ))). S blinds and randomizes the result as ej = dj · Enc(t j S ), where tj S   {0, 1} log m+ℓ+κ , and sends ej to C.

          iv. C decrypts the received values and sets r j C = Dec(c j ) and t jC = Dec(e j ).

     b. C and S perform 2c + 1 comparisons and OR of the results of the comparisons using garbled circuit. C enters rjC’s and tjC’s, S enters − rjS ’s and −tjS ’s, and C learns bit b computed as Vcj=−c ((r j C − rj S ) ?< (t j C − t j S )). To achieve this, S creates the garbled circuit and sends it to C. C obtains keys corresponding to its inputs using OT, evaluates the circuit, and S sends to C the key-value mapping for the output gate.


After the protocol C learns a bit whether Y was a matching of X or not and then he conveys the message to S. Since this is a semi honest protocol, C will not manipulate the output bit to get himself authenticated. So both S and C will know whether C was authenticated successfully or not. The Client needs to compute 2m bit encryptions for step 1 in the protocol. These encryptions are expensive, so they can be done offline. Client only needs to know the number of 0s and 1s it needed to encrypt.

Optimizations:

1.   Let p0 and p1 (q0 and q1) denote the fraction of 0’s and 1’s in an iris code (resp., its mask), where p0 + p1 = q0 + q1 = 1. Therefore, to have a sufficient supply of ciphertexts to form tuples <ai1, ai2>, the client needs to precompute (2q0 + q1(p1 + ε) + q1(p0 + ε))m = (1 + q0 + 2q1ε)m encryptions of 0 and (q1(p1 + ε) + q1(p0 + ε))m = q1(1 + 2ε)m encryptions of 1, where ε is used as a cushion since the number of 0’s and 1’s in X might not be exactly p0 and p1, respectively. Then at the time of the protocol the client simply uses the appropriate ciphertexts to form its transmission. Similarly, the server can precomputes  r jS ’s and tjS ’s for all records. He produce 2(2c + 1)|D| encryptions of different random values of length log m + ℓ + κ, where |D| denotes the size of the database D. The server generates one garbled circuit for each record Y in its database (for step 3(b) of the protocol) and communicates the circuits to the client.

2.   S computes bji = a(1− Yji )M(Yji ) i1 · aYji M(Yji)i2 during the protocol but the number of modular multiplications in calculation of  bji can be significantly reduced as follows:

    a.   Yji = (0 or 1)and M(Yji ) = 0: both M(Yji )(Yji ) and M(Yji ) (1-Yji ) are 0 so bji  = Enc(0)
    b.   Yji = 0 and M(Yji ) = 1: M(Yji )(Yji ) = 0 and M(Yji ) (1-Yji ) =1, and so bji = ai1
    c.   Yji = 1 and M(Yji ) = 1: M(Yji )(Yji ) = 1 and M(Yji ) (1-Yji ) =0, and so bji = ai2


3.   To reduce online communication client randomly choose 2m bits - u1 u2.. u2m, encrypt it and send it to the server during the offline phase. So that in the online phase, client just need to send vi=xiui = (xi)(1- ui)  (1-xi)( ui). Then when the protocol begins, the server sets either Enc(xi) = Enc(ui), if vi  =0 or Enc(xi) = Enc(1 − ui) , if vi  =0.



Friday, October 2, 2015

FAST GARBLING OF CIRCUITS UNDER STANDARD ASSUMPTIONS


Yao’s Garbled circuits provide a method to compute circuits based on double decryption where keys for double decryption are the random values assigned to the input of the gates. The output of double decryption is once again a random value assigned to one of the two possible outputs (0, 1) which may be further used as input to next gate. Many optimizations of Yao’s garbled circuits have then come up one of which is free XOR. Free XOR enables the computation of XOR gates for free and it involves no necessity of any cipher text corresponding to output.

Implementation of XOR gate [free XOR]

Lct Wi0 be a random value associated with input i
Wa0, Wb0R{0,1}n  Wc0 = Wa0 Wb0
Choose RR {0,1}n
Wa1= Wa0R, Wb1= Wb0R and  Wc1 = Wc0R

Correctness of “FREE XOR” by example

Let Wc1=Wa0Wb1
Wc1 = Wa0Wb0R
Wc1=Wc0R

Implementation of AND gates (Free - XOR)

We need a hash function to analyse the gates securely. Also we have to assign permutation bits Pa,Pb {0,1} for the inputs (a,b) associated with respect to AND gate.
Wa0 = <Ka0, Pa0> R {0,1} n+1
Wb0 = <Kb0, Pb0>R {0,1} n+1
Wc0 = <Kc0, Pc0> R {0,1} n+1
Choose R R {0,1}n
Wa1 = <Ka0R, Pa01>
Wb1 = <Kb0R, Pb01>
Wc1 = <Kc0R, Pc01>
The corresponding table entries T⊼(i,j)  Permutated over  Pai, Pbj,  i,j{0,1} will be
Tij   = H <Ka0 || Kb0 || g) Wc0
Tij   = H <Ka0 || Kb0 || g) Wc0
Tij   = H <Ka1 || Kb0 || g) Wc0
Tij   = H <Ka1 || Kb1 || g) Wc1
The above four entries pertain to garbled circuit K. The evaluator obtains Wcg(a,b) by   XORing the hash of the input keys given to him with corresponding  tuple in table  obtained by combination of Pai, Pbj .
This hash function is secure under circular secure correlation robustness or related key assumption

Garbled XOR with a single cipher text

The method is built using 4 PRF calls for garbling the circuit. Let the four inputs be Ki0, Ki1, Kj0, Kj1. Note that Ki1=Ki0+l  
Step 1 : Compute  ki0 = FKi(0,i)(g) and  kc1 = FK(1,i) (g)
Step 2 : Compute l=  ki0 ki1
Step 3 : Compute  kjj = FK(j,j)(g) and kj!j =  kjj + l
Step 4 : Compute output Kl0 =  ki0 kj0 and Kl1 = Kl0 ⊕△l
Step 5 : Consider if the input in Ki0 and Kj1. In such a case we cannot compute kj1 as it is function of K0j . This can be solved by providing a cipher text T= FK(!j,j)(g) kj!j . Now given Kj!j it is possible to compute kj!j as well. Not that (!j )is complement of   (j).

Reducing the number of PRF calls to Step 3

The output kj0 can be simply taken as Kj0 and the pseudo random function to compute  kj0 from Kj0 can be skipped. This reduces PRF calls from 4 to 3. Since  kj0= Kj0 , T0 entry of table T will be 0.

Algorithm to Implement XOR gates
1..  Set the output wire permutation bit for the ‘0’: l :=ij
2.  Compute translate keys for wire  i : Compute  ki0 = FKi(0,i)(g) and  kc1 = FK(1,i) (g)
3.  Compute new offset for the output wire l=   ki0 ki1
4 .  Compute translated keys for wire j and the ciphertext for this gate
          a.      If  j =0 , set  kj0 = FK(0,j)(g||0), kj1 = kj0 +l and T= FK(1,j)(g) kj1
           b.      If  j =1 , set  kj1 = FK(1,j)(g||0), kj0 = kj1 +l and T= FK(0,j)(g) kj0
      5.  Compute the keys for output wire l : Kl0 =  ki0 kj0 and Kl1 = Kl0 ⊕△l
      6.  Return (Kl0, Kl1,l,T)

Simple and Fast 4-2 garbled row reduction of non XOR gates

In previous section we removed one row of T representing garbled circuits, by setting one of the keys on the output wire to be actually K0, than using K0 to mask the output key. Here we improve by performing 4-2 reduction on cipher text for non-XOR gates. For case of understanding we explain the evaluation of gate first.
The gate evaluated, receives as input to gate, a table with two entries [T1, T2] and index I {0,1,2,3} and a value of Ki computed from the two garbled values of the input wire.
We compute Kout as follows
If i = 0 then Kout = K0
If i = 1 then   Kout = K1T1
If i = 2 then   Kout = K2T2
If i = 3 then   Kout =  K3T1T2
Let K[Ti] denote the output key with respect to ith row of table T. We have K[T0] = K0 because K0= K0T = K00. An AND gate has two possible outputs. If K0 is one output then we can consider K1K2K3 to be another possible output or vice versa.

Now we need to define K[T1], K[T2]  and K[T3]  and values of  T1, T2 and T3 correspondingly

If K[T1] = K0 then T1 = K0K1
                  else
If K[T1] = K1K2K3 then T1 = K2K3

If K[T2] = K0 then T2 = K0K2
                   else
If K[T2] = K1K2K3 then T2 = K1K3

K[T3] follow from values of T1 and T2 because T3 = T1T2 and K[T3] = K3T1T2
Since the evaluation can always compute T3 given T1 and T2, the table T can be reduced to two rows.

Following is the table for garbled circuit

S
Truth table
T1
T2
K0out
K1out
3
0001
K0 K1
K0 K2
K0
K1 K2 K3
2
0010
K0 K1
K1 K3
K0
K1 K2 K3
1
0100
K2 K3
K0 K2
K0
K1 K2 K3
0
1000
K2 K3
K1 K3
K1K2 K3
K0

Correctness

K[T3] = K3T1T2
               = K3(K1K[T1]) (K2K[T2])
               = K1K2K3 (K[T1])(K[T2])

If  K[T1] = K[T0] = Kor  K1 K2 Kthen  K[T3] is K1 K2 K3
If  K[T1] ≠ K[T0]  then surely K[T1] K[T2]  = K0 K1 K2 Kin which case            

K[T3]=K0