This page is intended to provide a quick and dirty tutorial on the Boneh-Franklin IBE scheme. It assumes you know a few basic facts, including some idea of how the Elgamal scheme works, and what cyclic groups are. If you don’t know those things, this tutorial might help.

For starters, imagine that we have a cyclic group of prime order , with a generator . We’ll also imagine that we have a hash function with the particular property that it can map arbitrary strings to elements of the group , such that you will *not *know the discrete logarithm of the resulting element base .* These are most of the ingredients we need.

### Quick recap of Elgamal

If you’re familiar with Elgamal encryption, you’ll remember that public keys have the form , where the secret key is a random integer . Encrypting a message is done by choosing a random integer and computing:

The two values together represent a ciphertext. To decrypt this ciphertext using the secret key , one simply computes the formula:

(In practice we can’t actually use division, we multiply by the inverse of , but this notation is a little easier to read.)

### An IBE attempt that doesn’t work

If you’re trying to convert Elgamal into an IBE scheme, you might observe that our hash function seems like it could be useful here. Recall that H maps to arbitrary elements of . So if I compute the value:

I’ll end up with a group element , which (because is generated by ) can be represented as for some unknown value .

It’s noteworthy that this hash output () has the same basic structure as our normal Elgamal public key . So the temptation here might be to use as a public key for the Elgamal cryptosystem. And indeed, this would work fine — if all you needed to do was encrypt. Sadly, it would fail badly if you also wanted to decrypt. This is because we’d need to figure out the secret key that corresponds to , and one of two things is true: either (1) the hash function makes that easy to do, in which case *anyone* can do it and the scheme is busted. Or (2) the hash function makes that value hard to find, in which case nobody can decrypt. So decryption does not seem to work in this setting.

So using standard cyclic groups, this idea is kind of a bust.

Another idea would be to conjure up some magical function that could, given two group elements and a master public key , somehow compute the combined value . If we had such a function, we could encrypt under *both* the hash value *and* the public key as follows:

To decrypt this ciphertext, you could use knowledge of and the magical function as follows:

This seems awesome, but it falls apart for two reasons. First, we don’t have a magical function . Moreover, if we *did* have such a function, there would be any easy attack that breaks the whole scheme. (I’ll leave finding it as an exercise for the reader.) In fact, having a function like is equivalent to solving the Diffie-Hellman problem, which Elgamal fundamentally relies on for security. So that’s no good.

### Adding a pairing

In most common cyclic groups we don’t have a function that breaks Diffie-Hellman, which is fortunate for the security of schemes like Elgamal. But we do have something close. Specifically, certain elliptic curve subgroups admit an efficiently computable *bilinear map*. This map looks a lot like our function , but not exactly. Note that it takes in two elements of and outputs an element of a *different* group .* *The critical feature is that there is no way to map back to the original group from the target group .

More importantly, this function preserves the a property called *bilinearity*, which is that for all the following holds:

Notice that the pairing does *not* break the (computational) Diffie-Hellman problem, because the pairing outputs an element of a *different* group that is not (but does have the same order). (The pairing does allow you to break the *decisional* variant of the DH problem, but we’ll ignore that problem for the moment.)

These bilinear maps were actually discovered decades before elliptic curve cryptography was a thing people cared about. However, an efficient algorithm for computing them was only discovered in the 1980s by an NSA scientist named Victor Miller. Miller’s algorithm was actually considered a *very bad thing* for elliptic curve cryptography because it enabled attacks. Thus most NSA- and NIST-standardized curves don’t feature efficiently-computable bilinear maps. But these maps can be very useful if you’re careful.

Let’s go back to our earlier attempt at building an IBE scheme from above. Except this time, we’ll replace the function with a bilinear pairing, and we’ll also encode the plaintext into the target group :

With knowledge of the secret key , decryption can be computed as:

So that’s good. But here’s an even *better* feature. If you know the secret key corresponding to the (master) public key , you can also derive a secondary form of decryption key *that only works for one specific identity. *You compute that key as follows:

If I hand someone this key, they can decrypt the ciphertext above using the same decryption equation from above. Indeed, all I’ve done is change the notation below:

And this is basically the Boneh-Franklin scheme. We set , and use the encryption and decryption algorithms above. Unlike our bad attempt higher up, this scheme actually works. Moreover, it can be shown to be secure under reasonable cryptographic assumptions in the random oracle model.

What I’ve illustrated here is the *basic* “chosen plaintext” version of the scheme. This one is not secure under chosen ciphertext attacks. The Boneh-Franklin paper also incorporates a second version that uses hash functions to solve that problem (and make the scheme a bit more efficient). You can see the paper for details.

### Bonus explainer: short signatures from IBE

One of the coolest things about IBE is that once you have one, you also get a *digital signature scheme* for free. The basic observation here is that you can “turn an IBE scheme around”, and use the master public key as the public key for a signature scheme. To sign a message, you just derive an IBE decryption key for a specific “identity” that corresponds to the message you want to sign.

The generic signature verification algorithm is simple: use the master public key to encrypt a message under the signed message, and try to decrypt it with the given “signature” (decryption key). If decryption works, you have a valid signature!

The neat thing about this is that the “signature” scheme implied by Boneh-Franklin is really efficient: signatures are only one elliptic curve group element, which can be as short as 256 bits. These tiny signatures are called Boneh-Lynn-Shacham signatures, and can be directly proven secure under the Computational Diffie-Hellman problem.

*Notes:*

** *A common way to build this hash function is to hash to a field element that is in the field used for the underlying elliptic curve, and then to solve the elliptic curve equation to find a full EC point that satisfies the curve equation and is in the correct subgroup. Sometimes does not satisfy these checks, in which case you need to repeat the hash function, *e.g., *compute and try again.