Photo by Ben Mullins on Unsplash

How Does Bob Share A Secret With Alice, Without Ever Communicating With Her Before The Share?

--

The code I am going to demonstrate in this article is [here].

Let’s say that Bob and Alice have never contacted each other, ever. But they have a shared trusted friend called Trent. How do they generate a shared secret (such as an encryption key), without ever communicating beforehand? Well, we can do this with the magic on crypto pairs and the MIRACL pairing library.

In theory

First, let’s keep it simple. Bob needs to send Alice a message and puts it in a box. He now has to create a key for the box. How does he get the key to Alice? Well, he knows that Alice knows Trent, and she trusts Trent. Trent then generates a secret value that only Alice and Bob will know. Let’s call it s. Bob then takes something about Alice’s ID and then takes a hash value of it (Q_A). He takes a hash of his own ID (Q_B) — of which Alice will know whenever he sends the box. Now with the magic of crypto pairing, he uses a special pairing function (e) to give:

e(s x Q_B, Q_A)

and in crypto pairing, this is the same as:

e(Q_B, s x Q_A)

and which will be the key that Alice will generate, and so will be able to open the box.

--

--

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.