Return to Video

36C3 - Cryptography demystified

  • 0:00 - 0:21
    36C3 preroll music
  • 0:21 - 0:24
    Herald: Now for the next talk, he has
    worked for six years in the field of
  • 0:24 - 0:36
    cryptography for the uni Karlsruhe - Oots.
    Applause
  • 0:36 - 0:44
    Oots: OK, so thanks for the introduction
    and welcome to my talk. As our Herald just
  • 0:44 - 0:48
    said, I've been working in the area of
    cryptography for the better part of the
  • 0:48 - 0:54
    last six years. And I noticed that many
    people today have kind of a mental image
  • 0:54 - 0:59
    of what cryptography is and what
    encryption is. But sometimes this mental
  • 0:59 - 1:05
    image does not really coincide with what
    is actually going on. So I wanted to give
  • 1:05 - 1:11
    an introductory talk to cryptography that
    is available to a broad audience. So to an
  • 1:11 - 1:16
    audience that does not have any prior
    exposure to cryptography and maybe even to
  • 1:16 - 1:25
    an audience that does not have a
    background in maths or computer science.
  • 1:25 - 1:32
    So as I said before, this talk is
    specifically aimed at a non-technical
  • 1:32 - 1:39
    audience, even though it's 36C3. We
    probably have a fairly technical audience.
  • 1:39 - 1:44
    And this is a foundation's talk. So I
    will not be speaking about fancy research
  • 1:44 - 1:54
    or cutting edge results. I will be talking
    about the plain basics. Okay. So apart
  • 1:54 - 2:01
    from working in cryptography, I enjoy
    doing applied cryptography, number theory
  • 2:01 - 2:08
    and pwning, so exploiting all kinds of
    memory, corruption, bugs and programs.
  • 2:08 - 2:13
    Okay. This is a picture of my parents'
    cat. Just because every talk should have
  • 2:13 - 2:25
    pictures of cats in them. And this is –
    applause Thanks. So this is my checklist
  • 2:25 - 2:30
    for this talk. The first item I think we
    already did that. And so for the remainder
  • 2:30 - 2:33
    of the talk,
    I want to explain what encryption
  • 2:33 - 2:39
    is, what it does and what it does not do.
  • 2:39 - 2:46
    I want to explain authentication, which is
    some ... which fixes a problem that
  • 2:46 - 2:50
    encryption does not solve. I want to
    explain certificates because they help a
  • 2:50 - 2:56
    lot with both encryption and
    authentication. And in the end, I want to
  • 2:56 - 3:02
    explain a little how the things that I'm
    going to introduce work together and can
  • 3:02 - 3:10
    be combined to build more useful things.
    Okay. So let's start with the first point
  • 3:10 - 3:16
    here. I would like to explain encryption.
    So encryption is basically a solution to a
  • 3:16 - 3:22
    problem. So let's talk about the problem
    we have before we get to the solution. The
  • 3:22 - 3:29
    problem here is or one of the classical
    problems is that two parties want to
  • 3:29 - 3:35
    communicate. So we cryptographers commonly
    call them Alice and Bob and Alice wants to
  • 3:35 - 3:41
    send a message to Bob. So in this case,
    it's just a very stupid message. Just a
  • 3:41 - 3:50
    simple hello. But cryptography has been
    used in diplomacy and military for
  • 3:50 - 3:59
    hundreds of years. So imagine that this
    message is something more critical. And
  • 3:59 - 4:05
    the problem we want to solve is that there
    might be an eavesdropper who is wanting to
  • 4:05 - 4:10
    listen in on the connection and read the
    message, read the content that is being
  • 4:10 - 4:20
    sent from Alice to Bob. And what some
    people think how cryptography works is
  • 4:20 - 4:24
    something like the following, which is
    kind of close to the real thing, but not
  • 4:24 - 4:34
    really, is that Alice applies some kind of
    encryption procedure to her plain text
  • 4:34 - 4:40
    message to produce some random
    unintelligible gibberish, which we call
  • 4:40 - 4:46
    the cipher text. And then Alice sends the
    cipher text to Bob. And Bob has the
  • 4:46 - 4:51
    decryption procedure, knows how to
    decrypt. So to invert the encryption
  • 4:51 - 4:59
    procedure and recover the plain text
    message. And now the point that some
  • 4:59 - 5:08
    people get wrong is some people think that
    the knowledge how to decrypt is actually
  • 5:08 - 5:18
    secret. But that is not true today. So in
    1883, a person named Auguste Kerckhoffs
  • 5:18 - 5:26
    formulated a couple of principles that
    ciphers used for military applications
  • 5:26 - 5:32
    should adhere to, and one of these. And
    one of these requirements became well-
  • 5:32 - 5:40
    known as Kerckhoffs principle and it
    reads "A cipher should not require secrecy
  • 5:40 - 5:47
    and it should not be a problem if the
    cipher falls into enemy hands". So
  • 5:47 - 5:52
    rephrasing this a little, the cipher that
    you are using should be secure
  • 5:52 - 5:59
    enough that you can even tell your enemy
    or the attacker how the encryption process
  • 5:59 - 6:05
    is working and how the decryption process
    is working without harming the security of
  • 6:05 - 6:13
    the encryption. Or to rephrase this yet
    another time, if the cipher you are using
  • 6:13 - 6:17
    is so insecure that you cannot tell anyone
    how it works, then maybe you shouldn't be
  • 6:17 - 6:26
    using it in the first place. So let's get
    back to this image. So now, if the
  • 6:26 - 6:33
    attacker knows how to decrypt the message,
    then obviously this very simple scheme
  • 6:33 - 6:40
    does not yield anything useful. And so
    what people did is people introduced key
  • 6:40 - 6:46
    to this image. So now the
    encryption procedure and the decryption
  • 6:46 - 6:56
    procedure use a key which goes into the
    computation that is going on. So Alice
  • 6:56 - 7:02
    does some kind of computation based on the
    message and the key to produce the cipher
  • 7:02 - 7:08
    text. And Bob, who has the same key, can
    invert this encryption operation and
  • 7:08 - 7:13
    recover the plain text. However, as long
    as the key is only known to Alice and Bob,
  • 7:13 - 7:21
    but not to the attacker, the attacker
    cannot use the decryption procedure. So
  • 7:21 - 7:29
    one general word here. I will not go into
    the details of how these boxes operate.
  • 7:29 - 7:36
    So within these boxes, which represent
    computations, there is some math or
  • 7:36 - 7:41
    computer science going on. And I would
    like to not explain how these things
  • 7:41 - 7:51
    operate internally in order to keep this
    talk available to a broad audience. OK, so
  • 7:51 - 7:58
    a problem that we have here is that Alice
    and Bob have to agree on the key in
  • 7:58 - 8:08
    advance. So Alice cannot simply send over
    the key to Bob, because if she did, then
  • 8:08 - 8:14
    the attacker who is eavesdropping on the
    connection learns the key as well as the
  • 8:14 - 8:27
    message, and then the attacker could just
    decrypt the same as Bob. OK, so this does
  • 8:27 - 8:34
    not work. This is a terrible attempt. So
    for quite some years, actually, until the
  • 8:34 - 8:41
    70s and 80s of the last century, people
    were only using this scheme. And this is
  • 8:41 - 8:47
    what we call symmetric encryption because
    we could just flip the image around and
  • 8:47 - 8:52
    Bob could be sending a message to Alice
    instead because encryption and decryption
  • 8:52 - 8:59
    uses the same key. And if there is
    symmetric encryption, you can guess there
  • 8:59 - 9:04
    is something else which is called
    asymmetric encryption and there is ... for
  • 9:04 - 9:09
    asymmetric encryption, there is a pair
    of keys. One of them is used for
  • 9:09 - 9:15
    encryption and one of them is used for
    decryption. And now if we have an
  • 9:15 - 9:20
    asymmetric encryption scheme, we can do
    something like the following. So Bob
  • 9:20 - 9:25
    generates a pair of these keys, one for
    encryption and one for decryption. And he
  • 9:25 - 9:30
    keeps the decryption key to himself. This
    is why the decryption key is called the
  • 9:30 - 9:36
    secret key. However, Bob can publish the
    encryption key for everyone to see. So,
  • 9:36 - 9:42
    for example, it could be put in a kind of
    public registry like a phonebook or
  • 9:42 - 9:51
    whatever. And now Bob can send his public
    key to Alice and an eavesdropper who is
  • 9:51 - 9:56
    listening in on the connection will learn
    the public key, but that's not a problem
  • 9:56 - 10:03
    because the key is public anyway. And now
    after we have done this, Alice can use
  • 10:03 - 10:10
    Bob's encryption key to encrypt her
    message and send that over to Bob. And now
  • 10:10 - 10:15
    Bob can decrypt the message with his
    secret decryption key. However, the
  • 10:15 - 10:22
    eavesdropper here cannot simply decrypt
    the message because even though the
  • 10:22 - 10:27
    eavesdropper has the encryption key, it
    does not have the decryption key and thus
  • 10:27 - 10:36
    the eavesdropper cannot decrypt. Okay,
    however, this solution is still kind of
  • 10:36 - 10:42
    risky. There is still a problem with this
    and it is we still have to make sure the
  • 10:42 - 10:50
    keys are distributed in advance. Okay, so
    if we used this simple scheme where Bob is
  • 10:50 - 10:54
    sending his public key to Alice, then
    there is a problem. If the attacker is not
  • 10:54 - 10:59
    simply passively eavesdropping on the
    connection, but is willing to actively
  • 10:59 - 11:05
    interfere with the connection. So, for
    example, the eavesdropper might intercept
  • 11:05 - 11:11
    the public key that Bob is sending to
    Alice and replace it with his or her own
  • 11:11 - 11:19
    public key. And then Alice would think
    that the key she received belongs to Bob
  • 11:19 - 11:24
    and use this key to encrypt her message to
    Bob, and then suddenly the attacker can
  • 11:24 - 11:34
    read the message again. So at this point,
    let's summarize about encryption, so
  • 11:34 - 11:42
    encryption conceals the content of data.
    And this is pretty much what it does and
  • 11:42 - 11:49
    pretty much the only thing that it does.
    In particular, it does not conceal the
  • 11:49 - 11:53
    fact that there is communication going on.
    So an eavesdropper who is listening in on
  • 11:53 - 11:59
    the connection obviously can see Alice
    sending a message to Bob. And thus the
  • 11:59 - 12:04
    eavesdropper knows there is communication
    going on between Alice and Bob and this
  • 12:04 - 12:12
    alone could be quite dangerous for Alice
    and Bob. So imagine if Alice was working
  • 12:12 - 12:20
    for an intelligence agency and Bob was a
    journalist and the attacker sees Alice
  • 12:20 - 12:26
    sending lots of documents to Bob, then
    this might be a strong indication that
  • 12:26 - 12:37
    Alice is a whistleblower and Alice could
    be put into jail. So something more
  • 12:37 - 12:41
    that is not concealed by encryption
    is the amount of data that is being
  • 12:41 - 12:49
    exchanged. So if Alice is sending just a
    very short message to Bob then the
  • 12:49 - 12:57
    eavesdropper can guess that the message
    that is being transferred is not a 20 GB
  • 12:57 - 13:03
    file or something. So all this kind of
    metadata is something that encryption does
  • 13:03 - 13:10
    not conceal. And there is a couple of more
    problems with encryption. One of them is
  • 13:10 - 13:16
    that the attacker might change the
    message. Protecting from changes to the
  • 13:16 - 13:23
    message is not the job of encryption.
    Another problem is that keys must be
  • 13:23 - 13:29
    exchanged in advance, which I already
    talked about. And there's more problems.
  • 13:29 - 13:37
    So, for example, an attacker might simply
    record a message when it is sent. And
  • 13:37 - 13:44
    later, just replay this message to Bob. Or
    an attacker might go ahead and block a
  • 13:44 - 13:49
    message altogether. So intercept the
    message and throw it into the trash to
  • 13:49 - 14:00
    make sure it never arrives at Bob's site.
    Okay, and the first problem here, an
  • 14:00 - 14:06
    attacker might change the message which
    actually leads me to the second part of my
  • 14:06 - 14:13
    talk, which is authentication. So on my
    talk checklist, let's mark encryption as
  • 14:13 - 14:20
    done. Okay, so now what is authentication?
    Authentication enables the detection of
  • 14:20 - 14:29
    changes to data. It does not prevent
    changes from happening. It only enables
  • 14:29 - 14:40
    the recipient to detect the changes after
    they have happened. OK. So, for example,
  • 14:40 - 14:47
    or one example where something like
    authentication was needed is when Alice,
  • 14:47 - 14:52
    um, when Bob was sending his public key to
    Alice, but this is by far not the only
  • 14:52 - 14:58
    scenario where authentication is needed.
    So imagine if Alice is running a
  • 14:58 - 15:03
    charitable organization. So, for example,
    she's saving refugees from drowning in the
  • 15:03 - 15:10
    Mediterranean Sea. And Bob wants to donate
    to Alice to help her do that. Then Alice
  • 15:10 - 15:18
    has to send her bank account number to Bob
    so that Bob can make the donation. And
  • 15:18 - 15:25
    notice that in this scenario, the message
    that Alice is sending to Bob, her bank
  • 15:25 - 15:30
    account number, is nothing that is secret.
    It does not have to be encrypted because
  • 15:30 - 15:36
    this information is public knowledge.
    However, we do want to make sure that the
  • 15:36 - 15:47
    message that arrives at Bob is indeed the
    correct bank account number. So to prevent
  • 15:47 - 15:54
    something like this from happening where a
    criminal might intercept the message and
  • 15:54 - 15:59
    replace the bank account number so Bob
    would send his money to the criminal's
  • 15:59 - 16:09
    bank account instead of Alice's. And one
    way to realize authentication is, again,
  • 16:09 - 16:15
    by having a pair of keys, one of them is
    used for authentication and one of them is
  • 16:15 - 16:22
    used for verification. So checking if a
    message has been changed or not. And the
  • 16:22 - 16:26
    authentication key must be kept secret.
    Thus it is called the secret key, whereas
  • 16:26 - 16:36
    the verification key can be made public
    and it is called the public key. And now
  • 16:36 - 16:44
    if you have a setup like this, then Alice
    can go ahead and take the message that she
  • 16:44 - 16:53
    wants to send to Bob and apply some
    computation to it together with the secret
  • 16:53 - 16:58
    key, the authentication key to produce
    something that we call a signature or a
  • 16:58 - 17:06
    digital signature. And then Alice sends
    this signature over to Bob along with her
  • 17:06 - 17:13
    bank account number. And Bob will take the
    signature that he receives and the bank
  • 17:13 - 17:22
    account number he receives and apply some
    kind of computation to them to... and this
  • 17:22 - 17:30
    computation will determine if the bank
    account number has been changed or is in
  • 17:30 - 17:38
    fact original. So if the attacker changes
    the bank account number, then Bob will be
  • 17:38 - 17:43
    able to detect this change by checking the
    signature. And this holds even if the
  • 17:43 - 17:47
    attacker does not only change the bank
    account number, but also the signature.
  • 17:47 - 17:54
    Okay? So these things are designed in a
    way which hopefully makes it impossible
  • 17:54 - 18:00
    for any attacker to come up with a valid
    signature for anything else than the
  • 18:00 - 18:11
    original message. OK. So the only thing
    that Bob will ...the only way that Bob
  • 18:11 - 18:18
    will accept the signature is if the
    attacker does not, in fact, change the
  • 18:18 - 18:25
    bank account number. And in this case, it
    is safe for Bob to transfer the money. OK,
  • 18:25 - 18:35
    but here. OK. So here is a different
    solution to this problem. And it's
  • 18:35 - 18:41
    actually pretty much the same, except that
    now we have just a single key which is
  • 18:41 - 18:49
    used for both authentication and
    verification. And in this case, things
  • 18:49 - 18:54
    simply have a different name. They work in
    exactly the same way, except that the
  • 18:54 - 19:01
    signature is called a message
    authentication code or a MAC for short.
  • 19:01 - 19:10
    OK. But in both of these scenarios,
    whether we have two distinct keys or just
  • 19:10 - 19:20
    one key, we still have the problem of key
    distribution. OK. So imagine if in the
  • 19:20 - 19:27
    segment a scenario with two keys, Alice
    was sending her public key to Bob, then we
  • 19:27 - 19:32
    would have the same attack as before,
    namely the attacker could just go ahead
  • 19:32 - 19:40
    and change the key that Alice is sending
    to Bob and exchange it for his own key.
  • 19:40 - 19:48
    And so if the attacker is sending his own
    public key, his only… his own verification
  • 19:48 - 19:54
    key to Bob, then obviously the attacker
    can create a valid signature for his
  • 19:54 - 20:04
    forged bank account number.
    And Bob would accept this. OK, so again,
  • 20:04 - 20:09
    we have this problem of key distribution,
    which is that the verification key must be
  • 20:09 - 20:21
    known to Bob in advance. OK. And this
    leads me to my next... the next section of
  • 20:21 - 20:30
    my talk. So let's mark authentication as
    done and go on with certificates. So a
  • 20:30 - 20:36
    certificate is a document that confirms
    that a specific public key belongs to a
  • 20:36 - 20:45
    specific entity, for example a person or
    an organization. And if we want to use
  • 20:45 - 20:51
    certificates, let's just go back to the
    sender scenario we had before. So Alice
  • 20:51 - 20:57
    wants to send her bank account number,
    her public key and a signature for her
  • 20:57 - 21:04
    bank account number to Bob and an attacker
    might change the public key and the bank
  • 21:04 - 21:10
    account number and the signature. And now
    if we add certificates into this, we need
  • 21:10 - 21:16
    to add something that we call a
    certificate authority. And this is a
  • 21:16 - 21:25
    trusted third party, which will create
    certificates which confirm the association
  • 21:25 - 21:33
    between a person and a public key. So
    before Alice is sending a message to Bob,
  • 21:33 - 21:38
    she will walk up to the certificate
    authority and say "Hey certificate
  • 21:38 - 21:43
    authority. This is my public key. I'm
    Alice. Please give me a certificate."
  • 21:43 - 21:50
    And then the certification authority will
    check that Alice is indeed Alice and that
  • 21:50 - 22:00
    Alice indeed owns this public key. And if
    Alice passes these checks, then the
  • 22:00 - 22:07
    certification authority will create a
    certificate and hand that to Alice, and
  • 22:07 - 22:13
    the certificate is just a document which
    says that the certification authority has
  • 22:13 - 22:21
    verified that the silvery key here on the
    slides belongs to Alice. And now once
  • 22:21 - 22:31
    Alice has the certificate, she can just
    send her public key to Bob together with a
  • 22:31 - 22:38
    certificate. And then Bob, if he knows the
    certificate authority's public key can
  • 22:38 - 22:44
    check that the certificate is indeed
    correct. So it was indeed created by the
  • 22:44 - 22:50
    certificate authority. And if he trusts
    the certificate authority, he will know
  • 22:50 - 22:56
    that the silvery key is, in fact, Alice's.
    And then afterwards, Bob will be convinced
  • 22:56 - 23:03
    that the silvery key is Alice's and he can
    check the message that Alice is sending to
  • 23:03 - 23:21
    Bob and make sure it has not been changed.
    OK. So we're not completely free from the
  • 23:21 - 23:30
    key distribution problem yet, however,
    because still Bob has to know the public
  • 23:30 - 23:35
    key of the certification authority in
    advance. Okay. So Bob does not need to
  • 23:35 - 23:40
    know Alice's public key in advance, but he
    needs to know the public key of the
  • 23:40 - 23:47
    certification authority in advance. And in
    practice, there's not just a single
  • 23:47 - 23:52
    certification authority, but there's a
    whole bunch of them and certification
  • 23:52 - 24:00
    authorities can even create certificates
    for other certification authorities and so
  • 24:00 - 24:07
    on. So now Bob does not have to know all
    the public keys of everyone he's
  • 24:07 - 24:16
    communicating with, but he only has to
    know the public keys of a couple of
  • 24:16 - 24:26
    certification authorities. Okay, so let's
    summarize about certificates. So as I said
  • 24:26 - 24:32
    before, certificates confirm that a
    specific public key belongs to a specific
  • 24:32 - 24:38
    entity like a person or an organization.
    But we're still not completely free from
  • 24:38 - 24:44
    the key distribution problem because
    people have to know the certificate
  • 24:44 - 24:51
    authority's public keys. And another
    problem here is that this scheme gives an
  • 24:51 - 24:57
    enormous amount of power to a
    certification authority. So if an attacker
  • 24:57 - 25:06
    can compromise a certification authority,
    then he could force the certification
  • 25:06 - 25:15
    authority to create fake certificates,
    connecting fake keys to real identities.
  • 25:15 - 25:23
    OK so he could create a fake certificate,
    which says that the certification
  • 25:23 - 25:32
    authority has checked that the attackers
    public key belongs to Alice. And fixing
  • 25:32 - 25:38
    this problem about the certification
    authorities' power is something that
  • 25:38 - 25:47
    cryptographers are still working on. So
    that's still a problem today. And in fact,
  • 25:47 - 25:50
    this problem is not just theoretical.
    There is a number of incidents that have
  • 25:50 - 25:56
    happened with certification authorities.
    So one famous example is the "Diginotar"
  • 25:56 - 26:05
    case where in fact a certification
    authority named Diginotar was hacked and
  • 26:05 - 26:12
    the attackers created a fake certificate
    for a google.com domain or one of the
  • 26:12 - 26:18
    other Google domains. I don't exactly
    remember. And then these certificates
  • 26:18 - 26:24
    showed up being used in Iran. OK, so this
    is not just a theoretical problem. This
  • 26:24 - 26:35
    has, in fact, happened before. OK, so this
    concludes what I wanted to say about
  • 26:35 - 26:44
    certificates. So let's move on and see how
    these things can be put together to build
  • 26:44 - 26:52
    more complex but also more useful tools.
    So one of the tools I want to introduce is
  • 26:52 - 26:57
    called authenticated encryption and it's
    basically a combination of encryption and
  • 26:57 - 27:03
    authentication. So for some reason, people
    use this phrase mostly in the symmetric
  • 27:03 - 27:09
    case where there is one key for encryption
    and decryption and one key for
  • 27:09 - 27:17
    authentication and for verification.
    But you could pretty much recreate the
  • 27:17 - 27:25
    same scheme in an asymmetric fashion.
    And that is also being done in practice.
  • 27:25 - 27:30
    In this case, people just don't call it
    authenticated encryption. So one way to
  • 27:30 - 27:37
    build authenticated encryption is so if
    Alice wants to send a message to Bob, then
  • 27:37 - 27:42
    she will encrypt the message using the
    encryption key and send the cipher text
  • 27:42 - 27:51
    over to Bob. And then she will use a copy
    of the cipher text and compute a message
  • 27:51 - 28:00
    authentication code from it using the
    second key that she has. And then, Bob, as
  • 28:00 - 28:07
    Alice is going to send over that message
    authentication code to Bob, too. And now
  • 28:07 - 28:17
    Bob can decrypt the message using the key
    he has. And additionally Bob can check if
  • 28:17 - 28:24
    this message has been changed or whether
    it is original by using the verification
  • 28:24 - 28:32
    procedure. OK, so again, this kind of
    authentication does not prevent changes
  • 28:32 - 28:40
    from happening. But Bob can check whether
    a change has happened. And in fact, this
  • 28:40 - 28:46
    kind of authenticated encryption can
    actually boost the security of the
  • 28:46 - 28:56
    encryption scheme. OK, so another thing I
    wanted to talk about is called hybrid
  • 28:56 - 29:02
    encryption. And this is the combination of
    symmetric encryption and asymmetric
  • 29:02 - 29:10
    encryption. And the reason why this is
    interesting is that asymmetric encryption
  • 29:10 - 29:17
    is usually quite slow compared to
    symmetric encryption. So if you wanted to
  • 29:17 - 29:24
    send a very long message to Bob and you
    only had a public key encryption scheme,
  • 29:24 - 29:29
    so an asymmetric encryption scheme,
    then it would take a very long time to
  • 29:29 - 29:37
    encrypt the message and to decrypt the
    message. So however, you can combine
  • 29:37 - 29:41
    asymmetric encryption and symmetric
    encryption in a way that makes the
  • 29:41 - 29:47
    encryption process faster, and the way you
    do this is so if Alice wants to send a
  • 29:47 - 29:54
    message to Bob, Alice first generates a
    new key for the symmetric encryption
  • 29:54 - 30:03
    scheme. And Alice will encrypt her message
    with this key and send the cipher text
  • 30:03 - 30:09
    over to Bob. And afterwards, Alice will
    take the symmetric key that she has just
  • 30:09 - 30:17
    generated and encrypt this key with Bob's
    public key, and then that is sent over to
  • 30:17 - 30:26
    Bob as well. And now Bob can decrypt the
    symmetric key using his secret decryption
  • 30:26 - 30:33
    key - the kind of golden one here on the
    slides - to recover the symmetric key. And
  • 30:33 - 30:42
    afterwards, Bob can use the freshly
    recovered symmetric key to decrypt the
  • 30:42 - 30:49
    actual message. However, an eavesdropper
    listening in on the connection cannot
  • 30:49 - 30:54
    decrypt the message because it does not
    have the symmetric key and it cannot
  • 30:54 - 31:06
    decrypt the symmetric key because it does
    not have Bob's secret decryption key. OK.
  • 31:06 - 31:14
    So you can continue to build on these kind
    of things and what you end up with is
  • 31:14 - 31:20
    something called transport layer security
    or TLS for short. And transport layer
  • 31:20 - 31:26
    security is a network protocol that
    combines much of the things that I've
  • 31:26 - 31:32
    introduced so far. So it combines
    encryption either symmetric or hybrid and
  • 31:32 - 31:38
    it combines it with authentication. So
    MACs and signatures and certificates and
  • 31:38 - 31:48
    all the other things. And it adds in a
    couple of more things to detect replays of
  • 31:48 - 31:54
    messages. So if an attacker was to simply
    replay a message recorded earlier, this is
  • 31:54 - 32:01
    something that TLS can detect. And TLS
    can also detect if a message has been
  • 32:01 - 32:12
    suppressed by the attacker. So within a
    connection. So what TLS does is it kind of
  • 32:12 - 32:22
    establishes a secure connection between
    two entities. So say Alice and Bob over an
  • 32:22 - 32:35
    insecure network which is controlled by
    the attacker. And one application where
  • 32:35 - 32:41
    TLS is commonly used is for sending
    e-mails. So, for example, when you're
  • 32:41 - 32:47
    sending an email from, say, Alice wants to
    send an email to Bob, then the e-mail is
  • 32:47 - 32:52
    usually not sent directly. But Alice sends
    the message to her own email server and
  • 32:52 - 32:58
    then Alice's e-mail server will forward
    this email to Bob's e-mail server. And
  • 32:58 - 33:05
    when Bob goes online and checks his
    e-mails, the e-mail will be downloaded to
  • 33:05 - 33:11
    his device like his phone or desktop
    computer or whatever device Bob is using.
  • 33:11 - 33:20
    And while Alice can make sure that when
    she's uploading her message, her e-mail to
  • 33:20 - 33:26
    her own server, that this connection is
    secure just by encrypting the message. So
  • 33:26 - 33:33
    essentially using TLS and all the things
    that involves like encrypting the message
  • 33:33 - 33:43
    and authenticating the message and so on.
    However, Alice cannot check if her own
  • 33:43 - 33:49
    e-mail server also uses a secure
    connection to forward this e-mail to Bob's
  • 33:49 - 34:03
    server. OK. So let us take a more detailed
    look here. So each of these green locks
  • 34:03 - 34:14
    signifies a secure connection. This means
    that when a message is sent then or each
  • 34:14 - 34:19
    time a message is sent over a secure
    connection, there is some encryption and
  • 34:19 - 34:24
    authentication going on on the sender side
    and some decryption and verification going
  • 34:24 - 34:30
    on on the receiving side. OK, so if Alice
    wants to send an e-mail to Bob, then Alice
  • 34:30 - 34:36
    will build up a secure connection and send
    the email over it. And this will involve
  • 34:36 - 34:39
    encrypting the e-mail and authenticating
    the e-mail. And Alice's server will
  • 34:39 - 34:45
    decrypt the e-mail and verify that this
    has not been changed. And then Alice's
  • 34:45 - 34:49
    server will forward the e-mail to Bob's
    server, which involves, again, encrypting
  • 34:49 - 34:56
    it and authenticating it. And Bob's server
    will decrypt and verify it. And then
  • 34:56 - 35:04
    again, the same process repeats when the
    e-mail is sent or is downloaded by Bob
  • 35:04 - 35:13
    from his server. However, in this case so
    even though the message is encrypted every
  • 35:13 - 35:19
    time it is sent over a network, it is
    known in plain text by Alice's server and
  • 35:19 - 35:23
    Bob's server. Right. Because Alice is
    sending the message. So she is encrypting
  • 35:23 - 35:28
    it and Alice's server is decrypting it. So
    Alice's server can read the message in
  • 35:28 - 35:34
    plain text. And the same goes for Bob's
    server. And this is what we call transport
  • 35:34 - 35:44
    encryption because the e-mail is encrypted
    every time it is being sent over network.
  • 35:44 - 35:52
    And a concept opposed to this is what we
    call end to end encryption, where Alice,
  • 35:52 - 35:59
    before sending the message, Alice encrypts
    it, but not with a key that is known to
  • 35:59 - 36:05
    her server, but directly with Bob's public
    key. And she might even sign it with her
  • 36:05 - 36:12
    own secret authentication key. And then
    Alice sends this already encrypted
  • 36:12 - 36:18
    message over a secure channel to her own
    server, which involves encrypting the
  • 36:18 - 36:25
    message again and authenticating it again,
    and then Alice's server will decrypt the
  • 36:25 - 36:34
    message and verify that it has not been
    changed, however, the server cannot remove
  • 36:34 - 36:38
    the second layer of encryption, right? So
    the e-mail is encrypted two times. One
  • 36:38 - 36:47
    time was with Bob's key and a second time
    so that the server can decrypt it. And now
  • 36:47 - 36:51
    the server can remove the second
    encryption. But the first one is still
  • 36:51 - 36:59
    there. So, Alice's server cannot read
    the e-mail. And then the process repeats,
  • 36:59 - 37:05
    the already encrypted message is encrypted
    a second time and decrypted again at Bob's
  • 37:05 - 37:10
    server and then it is when it is
    downloaded by Bob it is encrypted again
  • 37:10 - 37:18
    and decrypted again. And then finally,
    Bob, who has the secret key, the secret
  • 37:18 - 37:24
    decryption key can remove the inner layer
    of encryption. And so Bob can read the
  • 37:24 - 37:32
    message. However, the servers in between
    cannot read the message just because it is
  • 37:32 - 37:45
    still encrypted with Bob's public key. OK,
    so with that, I would like to wrap up.
  • 37:45 - 37:52
    Sorry. So I would like to wrap up. So
    here's a couple of take home messages. So
  • 37:52 - 37:57
    the first one is encryption conceals the
    content of data. And that's pretty much
  • 37:57 - 38:03
    all it does. It does not conceal the
    metadata and it does not prevent the
  • 38:03 - 38:08
    message that is being sent from being
    changed. That is the job of
  • 38:08 - 38:16
    authentication. Authentication enables the
    detection of changes to data and both for
  • 38:16 - 38:22
    encryption and for authentication. You
    need to have pre-shared keys or are maybe
  • 38:22 - 38:32
    not really pre-shared keys, but key
    distribution has to happen beforehand. And
  • 38:32 - 38:38
    one way to make this problem of key
    distribution simpler is with certificates.
  • 38:38 - 38:47
    So certificates confirm that a specific
    public key is owned by a specific entity.
  • 38:47 - 38:51
    And if you have all these things,
    encryption and authentication and
  • 38:51 - 38:58
    certificates, you can build a network
    protocol which takes care of securely
  • 38:58 - 39:03
    transmitting a message from one place to
    another. And you can apply that to get
  • 39:03 - 39:10
    transport encryption. But transport
    encryption is inferior to end to end
  • 39:10 - 39:14
    encryption in the sense that with
    transport encryption, all the
  • 39:14 - 39:21
    intermediaries can still read the e-mail
    or the message being sent. However, with
  • 39:21 - 39:29
    end to end encryption, they cannot. And
    with that, I'd like to close and that I
  • 39:29 - 39:35
    will be happy to answer your questions if
    there are any questions which you cannot
  • 39:35 - 39:41
    ask today you can send me an email at this
    email address on the slides. I will try to
  • 39:41 - 39:45
    keep that email address open for one or
    two years.
  • 39:45 - 39:55
    applause
  • 39:55 - 40:01
    Herald: Thank you for your talk. And now
    we would come to the question part, if you
  • 40:01 - 40:08
    have any question, you can come up to
    microphones in the middle of the rows. Are
  • 40:08 - 40:21
    there any questions from the Internet? We
    have plenty of time. If anyone comes up.
  • 40:21 - 40:28
    With a question, you're invited. We have a
    question on microphone two, please.
  • 40:28 - 40:33
    Mic 2: Thanks for your good talk, and I
    would like to know how can you change a
  • 40:33 - 40:40
    message that was properly decrypted
    without the other receiving part noticing
  • 40:40 - 40:46
    that the decryption doesn't work anymore?
    Oots: That depends on the encryption
  • 40:46 - 40:52
    scheme that you're using. But for quite a
    number of encryption schemes, changing the
  • 40:52 - 40:58
    message is actually quite simple. So there
    is a really large number of encryption
  • 40:58 - 41:07
    schemes which just work by changing a
    couple of bits. Okay. So the message is
  • 41:07 - 41:15
    made up of bits and your encryption scheme
    gives you a way to determine which of the
  • 41:15 - 41:22
    bits to change and which not to change. So
    when you were encrypting, you use the
  • 41:22 - 41:26
    encryption scheme to figure out which bits
    must be flipped. So change from zero to
  • 41:26 - 41:35
    one or from one to zero and you just apply
    this bit change to the message that is
  • 41:35 - 41:46
    being sent and then the receiver can just
    undo this change to recover that original
  • 41:46 - 41:53
    message, whereas an attacker who does not
    know which bits have been flipped cannot.
  • 41:53 - 42:01
    However. So still the attacker can just
    flip a couple of the bits, and in this
  • 42:01 - 42:11
    case, so say the bit has been flipped by
    Alice and it is being flipped another time
  • 42:11 - 42:17
    by the attacker. So the bit is at its
    original value again. And then Bob, who
  • 42:17 - 42:22
    knows how to decrypt, will flip in another
    time. So it's changed again. And thus the
  • 42:22 - 42:28
    message has been changed. And there's a
    couple of things you can do with this kind
  • 42:28 - 42:35
    of with this kind of changes to the
    messages so that the decryption simply
  • 42:35 - 42:40
    does not fail. It just maybe outputs the
    wrong message.
  • 42:40 - 42:44
    Herald: OK. Next question from microphone
    six, please.
  • 42:44 - 42:51
    Mic 6: You stated that encryption does not
    cover metadata. Are there any thoughts
  • 42:51 - 42:53
    about that?
    Oots: Any thoughts?
  • 42:53 - 43:00
    Mic 6: Yeah. Any solution for maybe
    encrypting metadata? I don't know.
  • 43:00 - 43:12
    Oots: So much of this is pretty hard to
    come by. So, I mean, for emails, there is
  • 43:12 - 43:19
    the idea of also encrypting the subject,
    which is usually not encrypted, however.
  • 43:19 - 43:27
    So if you want to hide the length of the
    message, what you can do is simply pad the
  • 43:27 - 43:33
    message. So just end random garbage at the
    end of it to kind of hide how long it is.
  • 43:33 - 43:41
    Exactly. So the attacker will still have
    an upper bound on your message length, but
  • 43:41 - 43:46
    it does not, so it knows that the message
    you're sending is that most as long as the
  • 43:46 - 43:54
    cipher texts you're sending. But it
    doesn't know maybe it's shorter. So if you
  • 43:54 - 43:59
    want to hide your identity while
    communicating, you should be going for
  • 43:59 - 44:05
    something like Tor where you're not
    connecting directly to the person you want
  • 44:05 - 44:10
    to communicate with, but via a couple of
    intermediaries in a way that none of the
  • 44:10 - 44:16
    intermediaries know both you and the final
    recipient.
  • 44:16 - 44:18
    Mic 6: Thank you
  • 44:18 - 44:21
    Herald: Okay, then I believe we had a
    question from the Internet.
  • 44:21 - 44:26
    Internet: Yes, uh, the Internet is asking,
    can you say anything about the additional
  • 44:26 - 44:32
    power consumption of the encryption layers
    on a global scale?
  • 44:32 - 44:42
    Oots: Sadly, I think I can not. So I do
    not exactly know how much power
  • 44:42 - 44:51
    consumption is caused by the encryption,
    however. So in terms of computation, at
  • 44:51 - 44:59
    least, symmetric encryption is quite cheap
    in the sense that it takes a couple of
  • 44:59 - 45:06
    processor cycles to decrypt. I don't
    know. Sixteen blocks or something. So you
  • 45:06 - 45:12
    can usually decrypt hundreds of megabytes
    per second with a processor. At least with
  • 45:12 - 45:26
    a modern one. So I don't know any numbers,
    but I mean you can guess that if everyone
  • 45:26 - 45:31
    in the first world countries is using
    encryption, then in the sum there is a
  • 45:31 - 45:36
    pretty large amount of energy going into
    it.
  • 45:36 - 45:38
    Herald: Next question. Microphone two,
    please.
  • 45:38 - 45:45
    Mic 2: You mentioned a couple of times
    that an attacker might be able to replay a
  • 45:45 - 45:51
    message. I haven't really understood. If
    I'm an attacker, how does this benefit me
  • 45:51 - 46:02
    that I am able to do that?
    Oots: So imagine if Alice is sending an
  • 46:02 - 46:09
    order to her bank to transfer some money.
    And every time the bank is receiving such
  • 46:09 - 46:15
    an order, it will initiate the bank
    transfer. Then as an attacker, that would
  • 46:15 - 46:22
    be pretty cool to exploit because you once
    eavesdrop on Alice sending such an order
  • 46:22 - 46:29
    to the bank and then later on you can just
    repeat the same order to the bank and more
  • 46:29 - 46:34
    money will be sent. So if you were the
    recipient, that would be pretty cool and
  • 46:34 - 46:38
    you could just deplete Alice's bank
    account.
  • 46:38 - 46:42
    Herald: Then a question from microphone
    three.
  • 46:42 - 46:48
    Mic 3: I was in a talk about elliptic
    curve cryptography, and I'm wondering
  • 46:48 - 46:54
    where it is would we apply now in your
    example or in your process you showed us.
  • 46:54 - 47:10
    Oots: Um, let me maybe just go to another
    slide. Um. So typically encryption is
  • 47:10 - 47:16
    applied or elliptic curves are applied
    within these encryption and decryption
  • 47:16 - 47:20
    boxes. Okay. So there is a lot of
    mathematics going on in these
  • 47:20 - 47:26
    computations, which I did not explain
    because I wanted to keep this talk
  • 47:26 - 47:31
    accessible to a broad audience. But one
    way to realize such an encryption
  • 47:31 - 47:39
    procedure is by using elliptic curves
    within these boxes.
  • 47:39 - 47:45
    Herold: OK. Microphone one, please.
    Mic 1: Another limitation I could think of
  • 47:45 - 47:51
    or how to overcome this is devices like
    IOT devices that have low power and
  • 47:51 - 47:59
    limited processing capability. So how do
    you adapt this complex encryption? The
  • 47:59 - 48:06
    encryption competition for those devices?
    Oots: There is some research going on on
  • 48:06 - 48:14
    encryption schemes that are particularly
    lightweight, so particularly suited for
  • 48:14 - 48:22
    resource constrained devices. But as far
    as I know, pretty much all of them have
  • 48:22 - 48:28
    some weaknesses that came out of them. So
    they security wise, they do not offer the
  • 48:28 - 48:35
    same guarantees as the ones that you use
    if you have the resources for it.
  • 48:35 - 48:40
    Herald: On microphone two, please.
    Mic 2: Yeah. Hi. You mentioned the
  • 48:40 - 48:44
    enormous power that certificate
    authorities have in the picture of
  • 48:44 - 48:49
    certification and authentication. I was
    wondering if there I mean, what are the
  • 48:49 - 48:54
    possible solution or the proposed solution
    at the moment? What is the state of the
  • 48:54 - 49:00
    art on solving that problem?
    Oots: So one solution that is currently
  • 49:00 - 49:06
    being pushed is called certificate
    transparency. And that works by basically
  • 49:06 - 49:12
    creating a public or lots of public log
    files where each certificate that is ever
  • 49:12 - 49:19
    created must be added to the log file. And
    so if you're Google dot com or if you are
  • 49:19 - 49:26
    Google and you see someone entering
    Google's certificate into the log file and
  • 49:26 - 49:31
    you know that you didn't ask for the
    certificate, then you know that there is a
  • 49:31 - 49:36
    fake certificate out there. And so
    whenever you get a certificate, you are
  • 49:36 - 49:41
    expected to check if the certificate is
    actually contained in one of the public
  • 49:41 - 49:50
    log files. Does that answer the question?
    Mic 2: Yes. But how does appending a
  • 49:50 - 49:56
    certificate would work? So, for example,
    making sure the certificate is recognized
  • 49:56 - 50:01
    Alice as legitimate.
    Oots: OK. So the idea is whenever you get
  • 50:01 - 50:07
    a certificate, it will be put in a log
    file and everyone who gets the certificate
  • 50:07 - 50:10
    is expected to check that the log file is
    actually there.
  • 50:10 - 50:15
    Mic 2: So it is the certificate authority
    that also pushes the certificate to the
  • 50:15 - 50:18
    log?
    Oots: That's how it's expected to work.
  • 50:18 - 50:20
    Yes.
    Mic 2: OK. Thank you.
  • 50:20 - 50:23
    Oots: You're welcome.
    Herold: Then we have one more question
  • 50:23 - 50:28
    from the Internet.
    Internet: The Internet wants to know can
  • 50:28 - 50:35
    we or where can we get an authentication
    for a PGP key and how to apply it on a key
  • 50:35 - 50:39
    afterwards. Is there a possibility
    somehow?
  • 50:39 - 50:48
    Oots: I guess that depends. So with PGP,
    the common model is that there is not a or
  • 50:48 - 50:57
    there is not a central certification
    authority or a bunch of them, but so you
  • 50:57 - 51:02
    have kind of a social graph of people who
    know each other and exchange e-mails. And
  • 51:02 - 51:10
    each of these e-mails, each of these users
    should authenticate the public keys of
  • 51:10 - 51:16
    their peers. OK? So when you want to
    communicate with someone who you do not
  • 51:16 - 51:22
    already know, but who's maybe a friend of
    a friend of yours, then hopefully your
  • 51:22 - 51:32
    friend will have authenticated the public
    key of his friend. And if you trust your
  • 51:32 - 51:41
    friend, you can then check that your
    friend, in fact, has created a kind of a
  • 51:41 - 51:50
    certificate for his friend.
    Herald: Are there more questions from the
  • 51:50 - 51:57
    Internet? One more? Yes, please.
    Internet: I don't know if it's a question
  • 51:57 - 52:03
    regarding your talk, really, but someone
    wants to know. Would you recommend
  • 52:03 - 52:15
    startTLS and SSL/TLS in e-mail?
    Oots: So as far as I'm concerned, I would
  • 52:15 - 52:23
    always opt for using encryption on the
    outermost layer. So first, building a
  • 52:23 - 52:31
    secure connection to your email server and
    then doing SMTP or whatever over that
  • 52:31 - 52:38
    connection. So I think directly
    establishing the connection in a secure
  • 52:38 - 52:47
    manner is as is a better way to do it than
    with startTLS.
  • 52:47 - 52:51
    Herold: I believe that what is it, was it
    for questions? Please have a last round of
  • 52:51 - 52:53
    applause for Oots!
  • 52:53 - 52:58
    applause
  • 52:58 - 53:13
    36c3 postroll music
  • 53:13 - 53:25
    Subtitles created by c3subtitles.de
    in the year 2020. Join, and help us!
Title:
36C3 - Cryptography demystified
Description:

more » « less
Video Language:
English
Duration:
53:25

English subtitles

Revisions