< Return to Video

ElGamal Variants With Better Security (11 min)

  • 0:00 - 0:04
    In the last segment, we saw that the
    ElGamal public key encryption system is
  • 0:04 - 0:08
    chosen cipher text secure under a somewhat
    strange assumption. In this segment, we're
  • 0:08 - 0:11
    gonna look at variants of ElGamal that
    have a much better chosen cipher text
  • 0:11 - 0:15
    security analysis. Now, I should say that
    over the past decade, there's been a ton
  • 0:15 - 0:19
    of research on constructing, public key
    encryptions that are chosen cipher text
  • 0:19 - 0:22
    secure. I actually debated for some time
    on how to best present this here. And
  • 0:22 - 0:26
    finally, I decided to kind of show you a
    survey of the main results from the last
  • 0:26 - 0:30
    decades, specifically as they apply to the
    ElGamal system. And then, at the end of
  • 0:30 - 0:34
    the module, I suggest a number of papers
    that you can look at for further reading.
  • 0:34 - 0:38
    So let me start by reminding you how the
    ElGamal encryption system works. I'm sure
  • 0:38 - 0:43
    by now you all remember how ElGamal works,
    but just to be safe, let me remind you
  • 0:43 - 0:48
    that key generation in ElGamal picks a
    random generator, a random exponent from ZN
  • 0:48 - 0:52
    and then the public key is simply the
    generator and this element g to the a,
  • 0:52 - 0:56
    whereas the secret key is simply the
    discrete log of h base g. This value A.
  • 0:56 - 1:01
    Now the way we encrypt is we pick a random
    exponent B from ZN. We compute the hash of
  • 1:01 - 1:06
    G to the B and H to the B. And I'm gonna
    remind you that H to the B is the Diffie
  • 1:06 - 1:10
    Hellman secret, G to the AB. And then we
    actually encrypt a message using a
  • 1:10 - 1:15
    symmetric encryption system with the key K
    that's derived from the hash function. And
  • 1:15 - 1:20
    finally, the output cipher text is G to
    the B, and the symmetric cipher text. The
  • 1:20 - 1:25
    way we decrypt is you know, as we've seen
    before basically, by hashing U and the
  • 1:25 - 1:29
    Diffie Hellman secrets, decrypting the
    symmetric system, and outputting the
  • 1:29 - 1:34
    message M. Now in the last segment we said
    that ElGamal is chosen ciphertext secure under
  • 1:34 - 1:38
    this funny Interactive Diffie-Hellman
    assumption. I am not gonna remind you what
  • 1:38 - 1:42
    the assumption is here but I'll also say
    that this theorem kind of raises two very
  • 1:42 - 1:47
    natural questions. The first question is
    can we prove CCA security of
  • 1:47 - 1:51
    ElGamal just based on the standard
    Computational Diffie-Hellman assumption,
  • 1:51 - 1:55
    namely the G to the A, G to the B, you
    can't compute G to the AB. Can we prove
  • 1:55 - 1:59
    chosen-ciphertext security just based on
    that? And the truth's that there are two
  • 1:59 - 2:03
    ways to do it. The first option is to use
    a group where the computational Diffie
  • 2:03 - 2:07
    Hellman assumption is hard. But is
    provably equivalent to the Interactive
  • 2:07 - 2:11
    Diffie Hellman assumption. And it turns
    out it's actually not that hard to
  • 2:11 - 2:15
    construct such groups. These groups are
    called bilinear groups. And in such
  • 2:15 - 2:20
    groups, we know that the ElGamal system is
    chosen cipher text secure, strictly based
  • 2:20 - 2:24
    under the Computational Diffie Hellman
    assumption, at least in the random oracle
  • 2:24 - 2:29
    model. I'll tell you that these bi-linear
    groups are actually constructed from very
  • 2:29 - 2:34
    special elliptic curves. So there's a bit
    more algebraic structure that enables us
  • 2:34 - 2:38
    to prove this equivalence of IDH and CDH.
    But in general, who knows, maybe you don't
  • 2:38 - 2:43
    want to use elliptic curve groups, maybe
    you want to use ZP star for some reason.
  • 2:43 - 2:48
    So it's a pretty natural question to ask.
    Can we change the ElGamal system such that
  • 2:48 - 2:53
    chosen ciphertext security of ElGamal now can be proven, directly based on CDH, for any group
  • 2:53 - 2:58
    where CDH is hard? [Now with that ??] assuming
    any additional structure about the group,
  • 2:58 - 3:02
    And it turns out the answer is yes. And
    there's kind of an elegant construction
  • 3:02 - 3:07
    called twin ElGamal, so let me show you
    how twin ElGamal works. It's a very simple
  • 3:07 - 3:11
    variation of ElGamal that does the
    following. Again, in key generation, we
  • 3:11 - 3:15
    choose a random generator. But this time,
    we're gonna choose two exponents, A1 and
  • 3:15 - 3:19
    A2 as the secret key. So the secret key is
    gonna consist of these two exponents, A1
  • 3:19 - 3:24
    and A2. You know the public key of course
    is gonna consist of our generator. And
  • 3:24 - 3:28
    then we're gonna release G to the A1 and G
    to the A2. So remember that in regular
  • 3:28 - 3:33
    ElGamal what the public key is simply g
    to the A and that's it. Here we have two
  • 3:33 - 3:37
    exponents A1 and A2 and therefore we, we
    release both G to the A1 and G to the A2.
  • 3:37 - 3:42
    Now the way we encrypt, you'll notice the
    public key here is one element longer than
  • 3:42 - 3:47
    regular ElGamal. The way we encrypt using
    this public key is actually very similar
  • 3:47 - 3:52
    to regular ElGamal. We choose a random B,
    and now what we'll hash is actually not
  • 3:52 - 3:57
    just G to the B and H1 to the B, but,
    in fact, G to the B, H1 to the B, and H2
  • 3:57 - 4:02
    to the B. Okay so we basically hashing
    three elements instead of two elements and
  • 4:02 - 4:07
    then we basically encrypt the message
    using the derived symmetric encryption key
  • 4:07 - 4:11
    and as usual we output g to the b and c as our
    final ciphertext. How do we decrypt?
  • 4:11 - 4:16
    Well, so now the secret key consists of
    these two exponents, A1 and A2. And the
  • 4:16 - 4:21
    cipher text consists of U, and the
    symmetric cipher text C. So let me ask you
  • 4:21 - 4:26
    a puzzle, and see if you can figure out
    how to derive the symmetric encryption key
  • 4:26 - 4:32
    K, just given the secret key and the value
    U. So it's kind of a cute puzzle and I
  • 4:32 - 4:37
    hope everybody worked out, the solution
    which is basically what we can do is we
  • 4:37 - 4:43
    can take U to the power of A1, and that is
    basically G to the B A1 And U to the A2
  • 4:43 - 4:48
    which is G to the B A2. And that basically
    gives us exactly the same values, as H1 to
  • 4:48 - 4:53
    the B and H2 to the B. So this way the
    decryptor arrives at the same symmetric
  • 4:53 - 4:59
    key that the encryptor did. Then he decrypts
    the ciphertext using the symmetric system
  • 4:59 - 5:03
    and finally outputs the message M. So you
    notice this is a very simple modification
  • 5:03 - 5:08
    to regular ElGamal. All we do is we stick
    one more element to the public key. When
  • 5:08 - 5:12
    we do the hashing, we hash one more
    element, as opposed to just two elements.
  • 5:12 - 5:16
    We hash three elements. And similarly, we
    do doing decryption, and nothing else
  • 5:16 - 5:20
    changes. The cipher text is the same
    length as before, and that's it, Now the
  • 5:20 - 5:25
    amazing thing is that this simple
    modification allows us to now prove chosen
  • 5:25 - 5:29
    cipher text security directly based on
    standard Computational Diffie-Hellman
  • 5:29 - 5:33
    assumption, okay? Still we're going to
    need to assume that we have a symmetric
  • 5:33 - 5:37
    encryption system that provides us
    authenticated encryption and that the hash
  • 5:37 - 5:41
    function that we're using is an ideal hash
    function in what we call a random oracle
  • 5:41 - 5:46
    But nevertheless given that, we can
    prove chosen cipher text security strictly
  • 5:46 - 5:50
    based on a Computational Diffie-Hellman
    assumption. So now what's the cost of this?
  • 5:50 - 5:54
    Of course, if you think about this, during
    encryption and decryption, encryption has
  • 5:54 - 5:57
    to do one more exponentiation, and the
    decryption has to do one more
  • 5:57 - 6:02
    exponentiation. So the encryptor now does
    three exponentiations instead of two, and
  • 6:02 - 6:05
    the decryptor does two exponentiations
    instead of one. So the question is now,
  • 6:05 - 6:10
    now it's a philosophical question. Is this
    extra effort worth it? So you do more work
  • 6:10 - 6:14
    during encryption and decryption. And your
    public key is a little bit bigger, but
  • 6:14 - 6:18
    that doesn't really matter. The work
    during encryption and decryption is more
  • 6:18 - 6:22
    significant. And as a result you get
    chosen ciphertext security based on kind
  • 6:22 - 6:27
    of a more natural assumption, namely
    Computational Diffie-Hellman as opposed to
  • 6:27 - 6:30
    these odd-looking Interactive
    Diffie-Hellman assumption. But is it worth
  • 6:30 - 6:35
    it? Kind of the question is are there
    groups where CDH holds but IDH does not
  • 6:35 - 6:39
    hold? If there were such groups, then it
    would definitely be worth it, because
  • 6:39 - 6:43
    those groups, the twin ElGamal would be
    secure, but the regular ElGamal would not
  • 6:43 - 6:48
    be CCA secure. But unfortunately we don't
    know if there is any such group and in
  • 6:48 - 6:51
    fact as far as we know, it's certainly
    possible that any group where CDH holds,
  • 6:51 - 6:55
    IDH also holds. So the answer is, really,
    we don't know whether the extra cost is
  • 6:55 - 7:00
    worth it or not but then nevertheless it's
    a cute result that shows that if you want
  • 7:00 - 7:03
    to achieve chosen ciphertext
    security directly from CDH, you could do
  • 7:03 - 7:08
    it without too many changes to the ElGamal
    system. The next question is whether we
  • 7:08 - 7:12
    can get rid of this assumption that the
    hash function is an ideal hash function
  • 7:12 - 7:17
    mainly that it's a random oracle. And this
    is actually a huge topic. There's a lot of
  • 7:17 - 7:20
    work in this area on how to build
    efficient public key encryption systems
  • 7:20 - 7:25
    that are chosen ciphertext secure without
    random oracles. This is a very active area
  • 7:25 - 7:29
    of research as I said in the past decade
    and even longer. And I'll mention that as
  • 7:29 - 7:33
    it applies to ElGamal, they are basically,
    again two families of constructions. The
  • 7:33 - 7:38
    first construction's a construction that
    uses these special groups called these
  • 7:38 - 7:42
    bilinear groups that I just mentioned
    before. It turns out the extra structure
  • 7:42 - 7:46
    of these bilinear groups allows us to
    build very efficient chosen ciphertext
  • 7:46 - 7:50
    secure systems without referring to random
    oracles and as I said at the end of the
  • 7:50 - 7:54
    module, I point to a number of papers that
    explain how to do that. This is quite an
  • 7:54 - 7:59
    interesting construction. But it will take
    me several hours to kind of explain how it
  • 7:59 - 8:03
    works. The other alternative is actually
    to use groups where a stronger assumption
  • 8:03 - 8:08
    called the Decision Diffie-Hellman assumption
    holds. Again, I am not gonna define this
  • 8:08 - 8:12
    assumption here. I'll just tell you that
    this assumption actually holds in
  • 8:12 - 8:16
    subgroups of ZP star, in particular if we
    look at the prime order of a subgroup of
  • 8:16 - 8:20
    ZP star. The Decision Diffie-Hellman
    assumption seems to hold in those groups
  • 8:20 - 8:24
    and then in those groups we can actually
    build a variant of ElGamal, called the
  • 8:24 - 8:27
    Cramer Shoup system that is chosen
    ciphertext secure and the Decision
  • 8:27 - 8:31
    Diffie-Hellman assumption without random
    oracles. Again, this is a beautiful,
  • 8:31 - 8:35
    beautiful result but again it would take a
    couple of hours to explain and so I'm not
  • 8:35 - 8:38
    gonna do that here. This is probably one
    of these things that I gonna leave to
  • 8:38 - 8:42
    either the advanced topics or to do an
    advanced course so that we'll do it at a
  • 8:42 - 8:46
    later time. But again I points to a paper
    at the end of the module just in case you
  • 8:46 - 8:51
    want to read more about this. So here is a
    list of papers that provides more reading
  • 8:51 - 8:54
    material. So if you wanna read about
    Diffie Hellman assumptions, I guess I
  • 8:54 - 8:58
    wrote a paper about this a long time ago,
    that talks about various assumptions
  • 8:58 - 9:02
    related to, to Diffie Hellman. And in
    particular, studies the Decision Diffie
  • 9:02 - 9:06
    Hellman assumption. And if you wanna learn
    about how to build chosen ciphertext
  • 9:06 - 9:10
    secure system from Decision Diffie-Hellman
    and assumptions like it. There's a very
  • 9:10 - 9:15
    cute paper by Kramer and Shoup back
    from 2002 that shows how to do it. This is
  • 9:15 - 9:19
    again a very highly recommended paper. If
    you want to learn how to build chosen
  • 9:19 - 9:23
    ciphertext security from these
    bilinear groups, then the paper to read is
  • 9:23 - 9:27
    the one, cited here, which actually uses a
    general mechanism called Identity Based
  • 9:27 - 9:31
    Encryption which very surprisingly it
    turns out to actually gives us chosen
  • 9:31 - 9:35
    ciphertext security almost for free.
    So, once we build identity-based
  • 9:35 - 9:38
    encryption chosen ciphertext security falls
    immediately. And that's covered in this
  • 9:38 - 9:42
    paper that I, that I describe her. The
    Twin Diffie-Hellman construction and its
  • 9:42 - 9:46
    proof is described in this paper that I
    reference here And finally, if you kind of
  • 9:46 - 9:50
    want to see a very recent paper. That
    gives a very general framework for
  • 9:50 - 9:54
    building, chosen ciphertext secure systems, using
    what's called extractable hash proofs that
  • 9:54 - 9:59
    is again a nice paper by Hoeteck Wee, that
    was just recently published. I definitely
  • 9:59 - 10:02
    recommend reading it all, all have
    very, very elegant ideas in them. I wish I
  • 10:02 - 10:06
    could cover all of them in the basic
    course but I'm gonna have to leave some of
  • 10:06 - 10:10
    these to the more advanced course or
    perhaps the more advanced topics at the
  • 10:10 - 10:14
    end of this course. Okay, so I'll stop
    here and in the next segment I'm gonna tie
  • 10:14 - 10:19
    ElGamal and RSA encryption
    together so that you see how the two kind
  • 10:19 - 10:21
    of follow from a more general principle.
Title:
ElGamal Variants With Better Security (11 min)
Video Language:
English

English subtitles

Revisions