Return to Video

The Data Encryption Standard (22 min)

  • 0:00 - 0:04
    So now that we understand what block
    ciphers are, let's look at a classic
  • 0:04 - 0:08
    example called the Data Encryption
    Standard. So, just a quick reminder. Block
  • 0:08 - 0:12
    ciphers basically map N bits of input to N
    bits of output. And we talked about two
  • 0:12 - 0:17
    canonical examples, triple DES and AES. In
    this segment, we're gonna talk about DES,
  • 0:17 - 0:21
    and we'll talk about triple DES, actually,
    in the next segment. And then I also
  • 0:21 - 0:26
    mentioned before that block ciphers are
    often built by iteration. In particular,
  • 0:26 - 0:31
    we're gonna look at block ciphers that are
    built by a form of iteration where a key K
  • 0:31 - 0:36
    is first expanded into a bunch of round
    keys. And then a round function is applied
  • 0:36 - 0:41
    to the input message, again and again and
    again. And essentially, after all these
  • 0:41 - 0:45
    round functions are applied, we obtain the
    resulting cipher text, okay? And again,
  • 0:45 - 0:49
    what we're gonna look at, how DES, the
    data encryption standard, uses this
  • 0:49 - 0:54
    format. I just wanna be clear that, in
    fact, to specify a block cipher of this
  • 0:54 - 0:58
    type, one needs to specify the key
    expansion mechanism, and one needs to
  • 0:58 - 1:02
    specify the round function. In the segment
    here, I'm gonna focus on the round
  • 1:02 - 1:07
    function, and I'm not gonna talk much
    about key expansion. But I just wanted to
  • 1:07 - 1:11
    mention that, in fact, key expansion is
    also a big part of describing how block
  • 1:11 - 1:16
    cipher works. Okay, so let's talk about
    the history of DES. Essentially, in the
  • 1:16 - 1:21
    early 1970s, IBM realized that their
    customers are demanding some form of
  • 1:21 - 1:26
    encryption. And so they formed a crypto
    group, and the head of that group, was
  • 1:26 - 1:30
    Horst Feistel, who, in the early 70s,
    designed a cipher called Lucifer. Now,
  • 1:30 - 1:36
    it's interesting. In fact Lucifer had a
    number of variations but one of the later
  • 1:36 - 1:41
    variations in fact had a key length that
    was 128 bits and a block length that's
  • 1:41 - 1:46
    also 128 bits. Okay, in 1973 the governor
    realized that it's buying many commercial
  • 1:46 - 1:51
    off-the-shelf computers and so it wanted
    its suppliers to actually have a good grip
  • 1:51 - 1:55
    to algorithm that they could use in
    products sold to the government. So in
  • 1:55 - 2:00
    1973 the National Bureau of Standards as
    it was called at the time put out a
  • 2:00 - 2:05
    request for proposals for a block cipher
    that is going to become a federal
  • 2:05 - 2:09
    standard. And in fact IBM submitted a
    variant of Lucifer. That variant actually
  • 2:09 - 2:14
    went through some modification during the
    standardization process and then finally
  • 2:14 - 2:18
    in 1976, the national bureau standard
    adopted DES as a federal standard. And, in
  • 2:18 - 2:23
    fact, for DES it's interesting that the
    key length was far reduced from Lucifer.
  • 2:23 - 2:28
    It's only 56 bits. And the block length
    was also reduced to 64 bits. And in
  • 2:28 - 2:32
    fact, these decisions, especially the
    decision to reduce the key length, is
  • 2:32 - 2:37
    going to be a key length yield of DES and
    was a source of many complaints over its
  • 2:37 - 2:41
    life. In particular, already back in 1997,
    DES was broken by exhaustive search
  • 2:41 - 2:46
    meaning that a machine was able to search
    through all two to the 56 possible keys to
  • 2:46 - 2:51
    recover a particular challenge key. And in
    fact we're going to talk about exhaustive
  • 2:51 - 2:55
    search quite a bit. It's quite an
    interesting question, and there are
  • 2:55 - 2:59
    various ways to defend against exhaustive
    search. And basically this 1997 experiment
  • 2:59 - 3:04
    kinda spelled the doom of DES. It meant
    that DES is itself, is no longer secure.
  • 3:04 - 3:08
    And as a result, the National Institute of
    Standards, as it became known, issued a
  • 3:08 - 3:13
    request for proposals. For our next
    generation's block cipher standard and in
  • 3:13 - 3:17
    2000 it standardized on a cipher called Rijndael.
    Which became the advanced encryption
  • 3:17 - 3:22
    standard, AES. And we'll talk about AES
    later on. But in this segment, I wanna
  • 3:22 - 3:26
    describe how DES works. Now, DES is a
    cipher, it's an amazingly successful
  • 3:26 - 3:30
    cipher. It's been used in the banking
    industry. In fact, there's a classic
  • 3:30 - 3:35
    network called the Electronic
    Clearinghouse, which banks use to clear
  • 3:35 - 3:39
    checks with one another. And DES is used
    for integrity in those transactions. It's
  • 3:39 - 3:44
    also used in commerce. In fact, it was
    very popular up until recently, as the
  • 3:44 - 3:49
    main encryption mechanism for the web. Of
    course, now, that's been replaced with AES
  • 3:49 - 3:53
    and other ciphers. Overall, it's a
    very successful cipher in terms of
  • 3:53 - 3:57
    deployment. DES also has a very rich
    history of attacks, which we'll talk about
  • 3:57 - 4:02
    in the next segment. Okay, so now, let's
    talking about the construction of DES. So,
  • 4:02 - 4:07
    the core idea behind DES is what's called
    a Feistel network, due to Horst Feistel.
  • 4:07 - 4:11
    And basically, it's a very clever idea for
    building the block cipher out of arbitrary
  • 4:11 - 4:15
    functions, F1 to FD. Okay so imagine we
    have these functions F1 to FD
  • 4:15 - 4:19
    that happens to match n bits to n bits.
    Now these are arbitrary functions,
  • 4:19 - 4:22
    they don't have to be invertible or
    anything. What we want to do is build an
  • 4:22 - 4:27
    invertible function out of those D
    functions and the way we'll do it is by
  • 4:27 - 4:31
    building a new function we'll call capital
    F that maps 2n bits to 2n bits.
  • 4:31 - 4:36
    And the construction is described right
    here. So here we have our inputs. You
  • 4:36 - 4:40
    notice, there are two blocks of n bits.
    In other words, the input is actually
  • 4:40 - 4:45
    2n bits. The R and L stand for right and
    left. Typically, people describe a
  • 4:45 - 4:49
    Feistel network from top to bottom. In
    which case, these n bits really would be
  • 4:49 - 4:52
    right and left. But here it is more
    convenient for me to describe it
  • 4:52 - 4:56
    horizontally. So if we follow the R
    inputs. You realize it basically gets
  • 4:56 - 5:02
    copied into the L output, without any
    change at all. Okay? However, the L
  • 5:02 - 5:07
    inputs, is changed somewhat. What happens
    is, basically, the R inputs is fit into
  • 5:07 - 5:13
    the function F1 and the result is then
    XORed with L0 and that becomes the new R1
  • 5:13 - 5:18
    input. Okay, so this is called one round
    of a Feistel network, and is done using
  • 5:18 - 5:23
    the function F1. Now we do this again with
    another round of the Feistel network
  • 5:23 - 5:26
    with the function F2, and we do it again
    and again and again, 'till we get to the
  • 5:26 - 5:32
    last round, and we do it again with the
    function FD. And finally, the output is
  • 5:32 - 5:38
    R_d L_d. Okay. So, if you like, we can write
    this in symbols. That basically, L_i is
  • 5:38 - 5:43
    simply equal to R_i-1. And R_i,
    let's see, that's the more complicated
  • 5:43 - 5:50
    one. R_i is equal, well, let's just follow
    the lines here. R_i is just equal to F_i
  • 5:50 - 5:59
    applied to, R_i-1 XOR L_i. Okay?
    So this, and this is basically, i goes
  • 5:59 - 6:07
    from, 1 to d. So this is the, equation
    that defines a Feistel network, mapping a
  • 6:07 - 6:10
    2n bit input to 2n bit outputs. So
    here we have the, again, I just copied the
  • 6:10 - 6:15
    picture of the Feistel network. And the
    amazing claim is that, in fact, it doesn't
  • 6:15 - 6:20
    matter which functions you give me. For
    any functions, F1 to FD that you give me,
  • 6:20 - 6:25
    the resulting Feistel network function is,
    in fact, invertible. And the way we're
  • 6:25 - 6:28
    going to prove that is basically we're
    going to construct an inverse, because not
  • 6:28 - 6:31
    only is it invertible, it's efficiently
    invertible. So let's see. So let's look at
  • 6:31 - 6:37
    one round of a Feistel network, so
    here, this is the inputs, R_i L_i, and this
  • 6:37 - 6:42
    is the output R_i+1, L_i+1. And now what I'm
    going to ask you is to invert this.
  • 6:42 - 6:49
    So let's see. So suppose now the input that
    we're given is R_i+1, L_i+1 and we want to
  • 6:49 - 6:55
    compute R_i L_i. So we want to compute the
    round in the reverse direction. So let's
  • 6:55 - 7:00
    see if we can do it. Well, let's look at
    R_i. So, R_i is very easy. Basically, R_i is
  • 7:00 - 7:07
    just equal to L_i+1. So L_i+1 just becomes
    R_i. But now, let me ask you, to write the
  • 7:07 - 7:12
    expression for L_i in terms of R_i+1, and L_i+1.
  • 7:13 - 7:18
    So I hope everybody sees that, basically, L_i+1
    is fed into the function F_i+1.
  • 7:18 - 7:25
    The result is XORed with R_i+1,
    and that gives the L_i input.
  • 7:25 - 7:28
    So this the inverse of one round
    of a Feistel network.
  • 7:28 - 7:33
    And if we draw this as a diagram, let's just
    write the picture for the inverse.
  • 7:33 - 7:39
    So here you notice the input is R_i+1, L_i+1
    and the output is R_i L_i. Right?
  • 7:39 - 7:43
    So we're computing, we're inverting, the
    rounds. So you notice that the inverse of
  • 7:43 - 7:47
    a Feistel round looks pretty much the
    same as the Feistel round in the
  • 7:47 - 7:50
    forward direction. It's literally, you
    know, just for a technical reason, it's
  • 7:50 - 7:54
    kinda the mirror image of one another. But
    it's basically, the same construct. And
  • 7:54 - 7:59
    when we put these inverted rounds back
    together. We essentially get the inverse
  • 7:59 - 8:03
    of the entire Feistel network. So you
    notice we start off with the round number D
  • 8:03 - 8:08
    with the inverse of round number D,
    then we do the inverse of round number D-1
  • 8:08 - 8:11
    and so on and so forth until we
    get to the inverse of the first round. And
  • 8:11 - 8:18
    we get our final outputs which is R_0, L_0,
    like this is the inputs and we manage to
  • 8:18 - 8:23
    invert basically R_d, L_d and get R_0, L_0
    and the interesting thing is that
  • 8:23 - 8:26
    basically these inversion circuits look
    pretty much the same as the encryption
  • 8:26 - 8:31
    circuits and the only difference is that
    the functions are applied in reverse order.
  • 8:31 - 8:36
    Right we started with F_d and ended with
    F_1. Whereas when we were encrypting, we
  • 8:36 - 8:41
    started with F_1 and ended with F_d. So, for
    hardware designers, this is very
  • 8:41 - 8:45
    attractive, because, basically, if you
    wanna save hardware, you realize that your
  • 8:45 - 8:49
    encryption hardware is identical to your
    decryption hardware. So you only have to
  • 8:49 - 8:53
    implement one algorithm, and you get both
    algorithms the same way. The only
  • 8:53 - 8:57
    difference is that the functions are
    applied in reverse order. Okay. So this
  • 8:57 - 9:01
    Feistel mechanism is a general method
    for building invertible functions from
  • 9:01 - 9:06
    arbitrary functions F_1 to F_d and in fact,
    it's used in many different block ciphers.
  • 9:06 - 9:11
    Although, interestingly, it's not actually
    used in AES. So, there are many other
  • 9:11 - 9:15
    block ciphers that use a Feistel
    network. Or, of course, they differ from
  • 9:15 - 9:20
    DES in the functions F_1 to F_d. But AES
    actually uses a completely different type
  • 9:20 - 9:24
    of structure that's actually not a
    Feistel network. We'll see how AES
  • 9:24 - 9:29
    works in a couple of segments. So now that
    we know what Feistel networks are, let
  • 9:29 - 9:33
    me mention an important theorem about the
    theory of Feistel networks that shows
  • 9:33 - 9:38
    why they're a good idea. This theorem is
    due to Luby and Rackoff back in 1985, and it
  • 9:38 - 9:42
    says the following. Suppose I have a
    function that is a secure pseudorandom
  • 9:42 - 9:47
    function, okay. So it's indistinguishable
    from random and happens to act on N bits.
  • 9:47 - 9:53
    So it maps N bits to N bits and uses a
    key K. Then, it turns out, that if you use
  • 9:53 - 9:58
    this function in three rounds of a Feistel
    network. What you end up with is a secure
  • 9:58 - 10:03
    pseudo random permutation. In other words,
    what you end up with is an invertible
  • 10:03 - 10:08
    function that is indistinguishable from a
    truly random invertible function. And I
  • 10:08 - 10:11
    hope you remember that the true definition
    of a secure block cipher is that it needs
  • 10:11 - 10:16
    to be a secure pseudo random permutation.
    So what this theorem says, is that if you
  • 10:16 - 10:20
    start with a secure pseudo random
    function, you end up with a secure block
  • 10:20 - 10:24
    cipher. Basically, that's what this is.
    And let me explain in a little bit more
  • 10:24 - 10:29
    detail what's actually going on here. So,
    essentially, the PRF is used in every
  • 10:29 - 10:35
    round of the Feistel network. So, in
    other words, here, what's actually
  • 10:35 - 10:40
    computed is the PRF using one secret key,
    K0. Here, what's computed is the PRF
  • 10:40 - 10:46
    using a different secret key, of course
    applied to R1. And here we have yet
  • 10:46 - 10:52
    another secret key, K1 applied, K2 applied
    to R2. And you notice, this is why,
  • 10:52 - 10:55
    basically this Feistel construction,
    uses keys in K cubed. In other words, it
  • 10:55 - 11:01
    uses three independent keys. So it's very
    important that the keys are actually
  • 11:01 - 11:07
    independent. So really, we need three,
    independent keys. And then we end up with
  • 11:07 - 11:13
    a secure pseudorandom permutation. Okay,
    so that's the theory behind Feistel
  • 11:13 - 11:16
    networks. And now that we understand that,
    we can actually look at the specifics of DES.
  • 11:16 - 11:20
    So DES is basically a sixteen round
    Feistel network, okay. So there are
  • 11:20 - 11:26
    functions F1 to F16 that map 32 bits to
    32 bits, and as a result, the DES itself
  • 11:26 - 11:33
    acts on 64 bit blocks, 2x32. Now the
    sixteen round functions in DES are
  • 11:33 - 11:38
    actually all derived from a single
    function F. Just used with different keys.
  • 11:38 - 11:45
    So in fact, these are the different round
    keys. So K_i is, a round key. And it's
  • 11:45 - 11:53
    basically derived from the key K, derived
    from the 56 bit DES key K. Okay and I'll
  • 11:53 - 11:57
    describe what this function F is in just a
    minute. But basically that, you see that
  • 11:57 - 12:02
    by using sixteen different round keys, we
    get sixteen different round functions. And
  • 12:02 - 12:06
    that gives us the Feistel network. So just
    on a high level how the DES works
  • 12:06 - 12:11
    basically you have a 64 bit input. The
    first thing it does is, this initial
  • 12:11 - 12:15
    permutation that just permutes the 64 bits
    around. Namely it maps bit number one to
  • 12:15 - 12:20
    bit number six. Bit number two to bit
    number seventeen, and so on. This is not
  • 12:20 - 12:25
    for security reasons, this is just
    specified in the standard. Then we go into
  • 12:25 - 12:29
    the sixteen round Feistel network. That
    actually, you now know how it works.
  • 12:29 - 12:34
    Basically uses the function F1 to F16, as
    specified before. And then, basically we
  • 12:34 - 12:39
    have another permutation, it's called the
    final permutation. That's just the inverse
  • 12:39 - 12:43
    of the initial permutation. Again,
    it just permutes bits around, this is not
  • 12:43 - 12:48
    necessary for security reasons. And then
    we finally get, the final outputs. Okay.
  • 12:48 - 12:53
    Now, as we said, there's a key expansion
    step, which I'm not gonna describe. But
  • 12:53 - 13:00
    basically, this 56-bit DES key is expanded
    into these rounds keys. Where each round
  • 13:00 - 13:05
    key, is 48 bits. Okay, so we have sixteen
    48 bit round keys, and they're basically
  • 13:05 - 13:10
    used in the sixteen rounds of DES. And
    then when you want to invert the cipher,
  • 13:10 - 13:15
    all you do is you use these, round keys,
    these sixteen round keys, in reverse
  • 13:15 - 13:20
    order. Okay, so now that we understand the
    DES structure, the only thing that's left
  • 13:20 - 13:25
    to do is specify the function, capital F.
    So let me explain how this function works.
  • 13:25 - 13:30
    So basically, it takes, as inputs, its, 32
    bit value, let's call it X. But in
  • 13:30 - 13:35
    reality, you remember, this is R_0,
    R_1, R-2, R_3, so on and so
  • 13:35 - 13:40
    forth. These are 32 bit values. And then
    it takes, also, a 48 bit round key. So
  • 13:40 - 13:45
    here we have our key K_i, which happens to
    be 48 bits. The first thing it does, is it
  • 13:45 - 13:50
    goes through an expansion box. And this
    expansion box basically take thirty two
  • 13:50 - 13:57
    bits, and maps them into 48 bits. Now, all
    the expansion box does is just replicates
  • 13:57 - 14:04
    some bits, and move other bits around. So,
    for example, bit #1 of X is replicated
  • 14:04 - 14:11
    into positions 2 and 48 in the output.
    Bit #2 of X is positioned in as bit
  • 14:11 - 14:15
    #3 of the output. And so on and so
    forth, just by replicating some of the
  • 14:15 - 14:21
    bits of X, we expand the input into 48
    bits. The next thing we do is we compute
  • 14:21 - 14:24
    an XOR with the round key.
    Sometimes people say that cryptographers
  • 14:24 - 14:30
    only compute XORs. This is an example of
    that, where, well, we just do XORs in this
  • 14:30 - 14:36
    function. And then comes the magic of DES,
    where, actually, these 48 bits are broken
  • 14:36 - 14:43
    into eight groups of six bits. Six, seven,
    eight. And so let me draw, and then what
  • 14:43 - 14:49
    happens is, so yes. Each one of these,
    each one of these wires is, six bits. And
  • 14:49 - 14:54
    then they, they go into what, what are
    called S boxes. And I'll explain S boxes
  • 14:54 - 15:02
    in just a minute. The S boxes are kind of
    the smarts of, DES. And then, the S
  • 15:02 - 15:07
    box is basically a map, six bits to four
    bits. So, the outputs of the S boxes are
  • 15:07 - 15:13
    these four bits. They're collected. This
    gives up 32 bits, right? Eight groups of
  • 15:13 - 15:18
    four bits, gives us 32 bits and then
    finally this is fed into yet another
  • 15:18 - 15:23
    permutation which just maps the bits
    around. So, for example bit number one
  • 15:23 - 15:27
    will go to bit number nine, bit number two
    will go to bit number fifteen and so on.
  • 15:27 - 15:34
    So it just permutes the 32 bits around and
    that's the final 32 bit output of this F function.
  • 15:34 - 15:39
    Okay? So by using different
    round keys, essentially, we get different
  • 15:39 - 15:44
    round functions, and that's how we form
    the sixteen round functions of DES. Now,
  • 15:44 - 15:49
    the only thing that, left to specify are
    these S boxes. So the S boxes, literally,
  • 15:49 - 15:55
    are just functions from six bits to four
    bits. They are just implemented as a look
  • 15:55 - 16:00
    up table. Right? So describing a function
    from six bits to four bits basically
  • 16:00 - 16:05
    amounts to writing the output of the
    function on all two to the six possible inputs.
  • 16:05 - 16:10
    Two to the six is 64. So we just
    have a table that literally contains 64 values.
  • 16:10 - 16:15
    Where each value is four bits. So
    here is an example, this happens to be the
  • 16:15 - 16:19
    fifth S box, and you see that this is a
    table that contains 64 values right?
  • 16:19 - 16:27
    It's four by sixteen. So, 64 values. For
    example, if you wanna look at, the output,
  • 16:27 - 16:35
    that corresponds to 0-1-1-0-1-1. Okay, then
    you look at these two bits. This is 01,
  • 16:35 - 16:42
    and these four bits are 1101, and you see
    that the output is 1001. The four bits
  • 16:42 - 16:47
    output 1001. Okay, so the S boxes are just
    implemented as these tables.
  • 16:47 - 16:52
    Now the question is, how are these S boxes chosen.
    How are these tables actually chosen by
  • 16:52 - 16:56
    the designers of this. So to give you some
    intuitions for that, lets start with a
  • 16:56 - 17:02
    very bad choice for S boxes. So imagine
    the S boxes were linear. What do I mean by
  • 17:02 - 17:07
    that? I mean that imagine that these six
    bit inputs literally were just
  • 17:07 - 17:13
    XORed with one another in different
    ways to produce the four bit outputs.
  • 17:13 - 17:18
    Okay, another way of writing that is that
    we can write the S box as a matrix vector product.
  • 17:18 - 17:23
    So here you have the matrix Ai.
    And the vector, the six bit vector X.
  • 17:23 - 17:28
    And you can see that, if we write this matrix
    vector product, basically, we take the
  • 17:28 - 17:32
    inner product of this vector with the
    input vector. Remember, these are all bits.
  • 17:32 - 17:36
    So the six bits vector inner
    product. Another six bit vector, and we do
  • 17:36 - 17:41
    that modulo two, you realize, basically,
    what we're computing is X2 XOR X3.
  • 17:41 - 17:45
    Right? Because only position two and
    position three have 1's in it.
  • 17:45 - 17:50
    And similarly the next, inner product will
    produce X1 XOR X4 XOR X5 and so on and
  • 17:50 - 17:55
    so forth. Okay. So you can literally see
    that if the S boxes are implemented this
  • 17:55 - 18:00
    way. Then, all they do, is just apply the
    matrix A to the input vector X. Which is
  • 18:00 - 18:05
    why we say, that in this case the S boxes
    are completely linear. Now, I claimed that
  • 18:05 - 18:11
    in fact that if the S boxes were linear, then DES
    would be totally insecure. The reason is,
  • 18:11 - 18:16
    if the S boxes are linear, then all that
    DES does is just compute XOR of various
  • 18:16 - 18:20
    things and permute and shuffle bits
    around. So it's just XORs and bit
  • 18:20 - 18:25
    permutations, which means that as a
    result, all of DES is just a linear
  • 18:25 - 18:31
    function. In other words, there will be a
    Matrix B. Of these dimensions. Basically,
  • 18:31 - 18:36
    it's a matrix B that has width 832.
    Basically what I will do is I will write
  • 18:36 - 18:41
    the 64 bit message plus the sixteen round
    keys as one long vector. Alright, so the
  • 18:41 - 18:46
    message is 64 bits and there are sixteen
    round keys. Each one is 48 and that, if
  • 18:46 - 18:52
    you do the math, it's basically 832. Okay?
    So I write these values, the keys and the
  • 18:52 - 18:57
    message, as one long vector and then there
    will be this matrix that essentially when
  • 18:57 - 19:02
    you compute these matrix vector products.
    Essentially you get the different bits of
  • 19:02 - 19:07
    the ciphertext. So there's 64 of these
    rows and as a result, you get 64 bits of
  • 19:07 - 19:11
    ciphertext. Okay, so this is what it
    means for DES to be linear. So if you
  • 19:11 - 19:15
    think a little bit about this, you realize
    that the S boxes are the only nonlinear
  • 19:15 - 19:19
    part of DES. So if the S boxes were
    linear, then the entire circuit is linear
  • 19:19 - 19:23
    and therefore can be expressed as this
    matrix. Now if that's the case then DES
  • 19:23 - 19:28
    would be terrible as a secure pseudorandom
    permutation. And let me give you a very
  • 19:28 - 19:34
    simple example. Basically if you did the
    XOR of three outputs of DES, well
  • 19:34 - 19:39
    let's think what that means. Basically we
    would be looking at B times, the matrix B
  • 19:39 - 19:44
    that defines DES, times, one vector
    XOR B times another vector,
  • 19:44 - 19:49
    XOR B times a third vector. We
    could take the B out of the parentheses so
  • 19:49 - 19:54
    we'd be basically doing B times this
    vector over here. But of course K XOR K XOR K,
  • 19:54 - 20:00
    this is just K. And so if you
    think about what that means, basically we
  • 20:00 - 20:07
    just got back DES of K at the point M1 XOR M2 XOR M3. But this means that now DES
  • 20:07 - 20:11
    has this horrible relation. That can be
    tested. Right? So, basically, if you
  • 20:11 - 20:16
    XOR the output of three values,
    M1, M2, M3, you'll get the value of
  • 20:16 - 20:20
    DES, at the point M1 XOR M2 XOR M3. Now this
    is not a relation that is going to hold
  • 20:20 - 20:25
    for a random function. A random function
    is not going to satisfy this equality.
  • 20:25 - 20:30
    And so you get a very easy test to tell you
    that DES is not a random function.
  • 20:30 - 20:34
    In fact, maybe you can take that as a small
    exercise. It's not even difficult to see,
  • 20:34 - 20:39
    that given enough input output pairs, you
    can literally recover the entire secret key.
  • 20:39 - 20:45
    Yeah. You just need 832 input output
    pairs, and you'll be able recover the
  • 20:45 - 20:50
    entire secret key. And so if the S boxes
    were linear, DES would be completely
  • 20:50 - 20:56
    insecure. It turns out, actually, even if
    the S boxes were close to being linear. In
  • 20:56 - 21:01
    other words, the S boxes were linear most
    of the time. So maybe for 60 out of the 64
  • 21:01 - 21:06
    inputs, the S boxes were linear. It turns
    out that would also be enough to break
  • 21:06 - 21:11
    DES, and we're gonna see why later on. In
    particular, if you choose the S boxes at
  • 21:11 - 21:15
    random, it turns out they'll tend to be
    somewhat close to linear functions. As a
  • 21:15 - 21:20
    result, you'll be able to totally break
    DES. You'll just be able to recover the
  • 21:20 - 21:24
    key, in basically, very little time. And
    so, the designers of DES actually
  • 21:24 - 21:28
    specified a number of rules they use for
    choosing the S boxes. And it's not
  • 21:28 - 21:32
    surprising, the first rule is that these
    functions are far away from being linear.
  • 21:32 - 21:36
    Okay. So, in other words, there is no
    function that agrees with a large fraction
  • 21:36 - 21:40
    of the outputs of the S box. And then
    there are all these other rules, for
  • 21:40 - 21:44
    example, there are exactly four to one
    maps, right? So, every output has exactly
  • 21:44 - 21:48
    four pre-images and so on and so forth. So
    we understand now why they chose the S
  • 21:48 - 21:53
    boxes they way they did and in fact its
    all done to defeat certain attacks on DES.
  • 21:53 - 21:57
    Okay. So that's the end of the
    description of DES, and in the next few
  • 21:57 - 22:00
    segments we are going to look at the
    security of DES.
Title:
The Data Encryption Standard (22 min)
Video Language:
English

English subtitles

Revisions