Simple Examples ofPair-based Cryptography

Pair-based cryptography can do no wrong just now, and is at the core of many of the current advances in privacy, zero-knowledge proof and…

Simple Examples of Pair-based Cryptography

Pair-based cryptography can do no wrong just now, and is often at the core of many of the current advances in privacy, zero-knowledge proof and multi-party computation. You will find it in signature aggregation — and where we can take many signers and create a single signature from their public keys — and in privacy-preserving methods.

So you might read some fairly complicated research papers and even have a look at the Wikipedia page [here], but you probably still can’t make much sense of them. If this is so, then let’s develop a bit of code that illustrates the core concept of pair-based cryptography (bi-linearity and commutative properties).

With the pairing we have two cyclic groups (G1 and G2), and which are of an order of a prime number (n). A pairing on (G1,G2,GT) defines the function e:GG2→GT, and where g1 is the generator for G1 and g2 is the generator for G2. If we have the points of U1 and U2 on G1 and V1 and V2 on G2, we get the bi-linear mapping of:

e(U1+U2,V1)=e(U1,V1)×e(U2,V1)

e(U1,V1+V2)=e(U1,V1)×e(U1,V2)

If U is a point on G1, and V is a point on G2, we get:

e(aU,bV)=e(U,V)^{ab}

If G1and G2 are the same group, we get a symmetric grouping (G1=G2=G), and the following commutative property will apply:

e(U^a,V^b)=e(U^b,V^a)=e(U,V)^{ab}=e(V,U)^{ab}

The computation of e should be efficient in computation time.

There you go, did you get that? Well, maybe not, so let’s instead turn to a bit of code. In the following we create a pairing and then a generator from the pairing [run code]:

In this case I have created three main tests for e(g^a, g^b) = e(g,g^{ab}), e(g^a,g^b) = e(g^b,g^a), and e(a g, b g) = e(g,g^{ab}). You can try it here.

Here are some applications of pair-based cryptography:

  • Key pairing over BN-curves. Key pairing over BN-curves. This page demonstrates key pairing over BN-curves.
  • Shared key over BN-curves. Shared key over BN-curves. This page demonstrates key generation over three parties with pairing over BN-curves.
  • IBE using elliptic curves. IBE using elliptic curves. This page demonstrates IBE.
  • Boneh–Lynn–Shacham (BLS) signature. BLS. Example of BLS signature.
  • Camenisch-Lysyanskaya Signatures. CL. Example of Camenisch-Lysyanskaya Signatures.