Photo by Glen Carrie on Unsplash

Encrypted Word Searches Using Golang and Kryptology

--

We give away too much information. Let’s say I want to search a database for a customer’s name. For this I would probably have to expose the names in plaintext, and which leaves it open for a data breach. An improved method is to encrypt search terms and then match a search term to these. In this case, we will implement the following [paper]:

First, we have two curves (G1 and G2) and initially, we define a large prime number (q). First, a trust server selects a point on the G2 curve (P), and generates a using a random number (s):

Alice creates a public key with:

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

Trent hashes the word to search (M) to the G2 curve:

And creates the pairing of:

If Bob wants to search for W2, he matches to:

and where:

Here’s an outline of crypto pairing:

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

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