Sitemap
Press enter or click to view image in full size
Photo by Ben White on Unsplash

Member-only story

Encrypted Searches Using Crypto Pairing, Rust and MIRACL

3 min readNov 28, 2021

--

We give away too much information. Let’s say I have to search to see if a given post code is on a database, but I want to keep the search and search term secret. In this case we will implement the following [paper]:

Press enter or click to view image in full size

With crypto pairing we have two elliptic curves: G1 and G2, and then map onto a third curve: Gt. The pairing of the points on G1 (P) and G2 (Q) is defined as a pairing function, and where we determine e (Q,P). For the points of P and Q, this has special mappings of:

e (sQ,rP)=e (rQ,sP)=e (rsQ,P)=e (Q,rsP)=e (sQ,P)r=e (Q,P)rs

and:

e (R+Q,P)=e (R,Pe (Q,P)

First we have two curves (G1 and G2) and initially we define a large prime number (q). First Alice — who wants to perform the search — selects a point on the G2 curve (P), and generates a using a random number (s):

sk=s

Alice then creates public key with:

Ps=sP

Next Bob creates a random value (r) and creates:

Pr=rP

--

--

Prof Bill Buchanan OBE FRSE
Prof Bill Buchanan OBE FRSE

Written by Prof Bill Buchanan OBE FRSE

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.