ECKS-PS algorithm: searching in encrypted data; bilinear maps I have found an encryption algorithm named ECKS-PS (published in the paper Efficient conjunctive keyword search on encrypted data storage system) that allows an user to search in encrypted data. All the steps are described here: 



And I have written them a little bit more clear here:



I have tried to find a calculation example of finding two words multiple times:





but I never get a match.

Can anybody tell me what I am doing wrong and/or provide me with an example where you get a match (based on the ECKS-PS algorithm)? I know there may be other algorithms to search in encrypted data but I would like to know how to do it with this algorithm.

EDIT: with some advice from Barack and Gilles

$e(i,j) = 53 ^ {i*j} \mod 59 $

$ g=53 $,
$ \alpha = 7 $,
$ r= 16 $,
$ \theta = 3 $,
$ a_i = 6 $,
$ Hash(W_1) = 53 ^ {23} $,
$ Hash(W_2) = 53 ^ {18} $,

$e(g^{a_i \theta}, g ^r  ) = 53 ^ { 53 ^ {6*3} * 53 ^{16}} \mod 59 = 53 ^ { 53 ^{34}} = 9 $

$e(g^{a_i }, (Hash(W_1) * Hash(W_2))^{\alpha} * g^{\theta * r}  ) = 53^ {{({53 ^ {23} * {53 ^ {18} }}) ^ {7} * 53 ^{16*3} }} \mod 59 = 9 $

$e(g^{\alpha}, Hash(W_1)^{a_i}) = 53 ^ {{53^7}*{{53^{23}}^6}} \mod 59 = 19$
$e(g^{\alpha}, Hash(W_2)^{a_i}) = 53 ^ {{53^7}*{{53^{18}}^6}} \mod 59 = 27$

$\frac 9{19*7} =&gt; $ multiplicative inverse of $ 19*27 \mod 59 = 36$ => $29 \mod 59  \ne 9 \mod 59$
Note I have changed the value of $H(W_2)$ to make intermediate caclulation results unique.
$e(g^i,g^j) =g^{i*j}\mod 59,g=53,\alpha=7,r=16,\theta=3,a_i=6,H(W_1)=53^{23},H(W_2)=53^{19}$

$e(g^{a_i \theta},g^r)=53^{6*3 * 16} \mod 59=53^{27}=41$

$A=(H(W_1)*H(W_2))^\alpha . g^{\theta r}=53^{(23+19)*7+3*16 \mod 29}=53^{23}$

$e(g^{a_i},A) = 53 ^ {6*23} \mod 59 =  28$

$e(g^{\alpha}, H(W_1)^{a_i}) = 53^{7 * 23*6} \mod 59 = 53^9 \mod 59 = 35$

$e(g^{\alpha}, H(W_2)^{a_i}) = 53^{7 * 19*6} \mod 59 = 53^{15} \mod 59 = 17$

$\frac {28}{35*17} \mod 59= 41$ QED