< Return to Video

The Internet: Encryption and public keys

  • 0:02 - 0:07
    (energetic music)
  • 0:09 - 0:11
    - Hi. My name is Mia Gil Epner.
  • 0:11 - 0:13
    I'm majoring in Computer
    Science at UC Berkeley
  • 0:13 - 0:15
    and I work for the Department of Defense
  • 0:15 - 0:18
    where I try to keep information safe.
  • 0:19 - 0:22
    The internet is an open and public system.
  • 0:22 - 0:24
    We all send and receive information
  • 0:24 - 0:26
    over shared wires and connections.
  • 0:27 - 0:28
    Even though it's an open system,
  • 0:28 - 0:30
    we still exchange a lot of private data,
  • 0:30 - 0:32
    things like credit card numbers,
  • 0:32 - 0:35
    bank information, passwords, and emails.
  • 0:35 - 0:39
    So how is all this
    private stuff kept secret?
  • 0:39 - 0:41
    Data of any kind can be kept secret
  • 0:41 - 0:42
    through a process known as encryption,
  • 0:42 - 0:44
    descrambling or changing of the message
  • 0:44 - 0:46
    to hide the original text.
  • 0:46 - 0:48
    Now, decryption is the process
  • 0:48 - 0:52
    of unscrambling that
    message to make it readable.
  • 0:52 - 0:53
    This is a simple idea,
  • 0:53 - 0:55
    and people have been
    doing it for centuries.
  • 0:55 - 0:58
    One of the first well-known
    methods of encryption
  • 0:58 - 1:01
    was Caesar's cipher,
    named after Julius Caesar,
  • 1:01 - 1:05
    a Roman general who encrypted
    his military commands
  • 1:05 - 1:07
    to make sure that if a message
    was intercepted by enemies,
  • 1:07 - 1:10
    they wouldn't be able to read it.
  • 1:10 - 1:12
    Caesar's cipher is an algorithm
  • 1:12 - 1:14
    that substitutes each letter
    in the original message
  • 1:14 - 1:17
    with a letter a certain number
    of steps down the alphabet.
  • 1:17 - 1:19
    If the number is something only the sender
  • 1:19 - 1:22
    and receiver know, then
    it's called the key.
  • 1:23 - 1:27
    It allows the reader to
    unlock the secret message.
  • 1:27 - 1:30
    For example, if your
    original message is, "Hello",
  • 1:31 - 1:33
    then, using the Caesar's cipher algorithm
  • 1:33 - 1:37
    with a key of five, the
    encrypted message would be this.
  • 1:37 - 1:38
    (typrwriter keys clacking)
  • 1:38 - 1:40
    (computer chime)
  • 1:40 - 1:41
    To decrypt the message, the recipient
  • 1:41 - 1:46
    would simply use the key
    to reverse the process.
  • 1:46 - 1:48
    But there's a big problem
    with Caesar's cipher.
  • 1:48 - 1:52
    Anybody can easily break or
    crack the encrypted message
  • 1:52 - 1:54
    by trying every possible key.
  • 1:54 - 1:57
    In the English alphabet,
    there are only 26 letters,
  • 1:57 - 2:00
    which means you'd only
    need to try, at most,
  • 2:00 - 2:03
    26 keys to decrypt the message.
  • 2:03 - 2:06
    Now, trying 26 possible
    keys isn't very hard.
  • 2:06 - 2:08
    It would take, at most, an hour to do.
  • 2:08 - 2:10
    So let's make it harder.
  • 2:10 - 2:12
    Instead of shifting every
    letter by the same amount,
  • 2:12 - 2:15
    let's shift each letter
    by a different amount.
  • 2:15 - 2:18
    In this example, a 10 digit key
  • 2:18 - 2:21
    shows how many positions
    each successive letter
  • 2:21 - 2:23
    will be changed to
    encrypt a longer message.
  • 2:23 - 2:26
    (typewriter keys clacking)
  • 2:26 - 2:29
    Guessing this key would be really hard.
  • 2:29 - 2:30
    Using 10 digit encryption,
  • 2:30 - 2:34
    there could be 10 billion
    possible key solutions.
  • 2:34 - 2:37
    Obviously, that's more than
    any human could ever solve.
  • 2:37 - 2:41
    It would take many centuries,
    but an average computer today
  • 2:41 - 2:43
    would take just a few seconds
  • 2:43 - 2:46
    to try all 10 billion possibilities.
  • 2:46 - 2:48
    So in a modern world, where the bad guys
  • 2:48 - 2:51
    are armed with computers
    instead of pencils,
  • 2:51 - 2:54
    how can you encrypt messages so securely
  • 2:54 - 2:56
    that they're too hard to crack?
  • 2:56 - 3:00
    Now, "too hard" means that
    there are too many possibilities
  • 3:00 - 3:03
    to compute in a reasonable amount of time.
  • 3:03 - 3:05
    Today's secure communications
  • 3:05 - 3:08
    are encrypted using 256 bit keys.
  • 3:08 - 3:10
    That means a bad guy's computer
  • 3:10 - 3:11
    that intercepts your message,
  • 3:11 - 3:15
    would need to try this
    many possible options
  • 3:15 - 3:18
    until they discover the
    key and crack the message.
  • 3:18 - 3:18
    (robot bleeps and beeps)
  • 3:18 - 3:20
    (energetic music)
  • 3:20 - 3:23
    Even if you had a hundred
    thousand super computers,
  • 3:23 - 3:25
    and each of them was able to try
  • 3:25 - 3:28
    a million billion keys every second,
  • 3:28 - 3:31
    it would take trillions
    of trillions of trillions
  • 3:31 - 3:33
    of years to try every option,
  • 3:33 - 3:34
    just to crack a single message
  • 3:34 - 3:38
    protected with 256 bit encryption.
  • 3:38 - 3:40
    Of course, computer
    chips get twice as fast,
  • 3:40 - 3:43
    then half the size every year or so.
  • 3:43 - 3:45
    If that pace of exponential
    progress continues,
  • 3:45 - 3:48
    today's impossible
    problems will be solvable
  • 3:48 - 3:51
    just a few hundred years in the future,
  • 3:51 - 3:54
    and 256 bits won't be enough to be safe.
  • 3:54 - 3:56
    In fact, we've already had to
  • 3:56 - 3:57
    increase the standard key length
  • 3:57 - 4:01
    to keep up with the speed of computers.
  • 4:01 - 4:03
    The good news is, using a longer key
  • 4:03 - 4:05
    doesn't make encrypting
    messages much harder,
  • 4:05 - 4:08
    but it exponentially increases
    the number of guesses
  • 4:08 - 4:11
    that it would to crack a cipher.
  • 4:11 - 4:14
    When the sender and the
    receiver share the same key
  • 4:14 - 4:16
    to scramble and unscramble a message,
  • 4:16 - 4:19
    it's called symmetric encryption.
  • 4:19 - 4:22
    With symmetric encryption,
    like Caesar's cipher,
  • 4:22 - 4:25
    the secret key has to be
    agreed on ahead of time
  • 4:25 - 4:28
    by two people in private.
  • 4:28 - 4:29
    That's great for people,
  • 4:29 - 4:31
    but the internet is open and public,
  • 4:31 - 4:33
    so it's impossible for two computers
  • 4:33 - 4:37
    to meet in private to
    agree on a secret key.
  • 4:37 - 4:40
    Instead, computers use asymmetric keys,
  • 4:40 - 4:44
    a public key that can be
    exchanged with anybody
  • 4:44 - 4:47
    and a private key that is not shared.
  • 4:47 - 4:50
    The public key is used to encrypt data
  • 4:50 - 4:52
    and anybody can use it to
    create a secret message,
  • 4:52 - 4:56
    but the secret can only be decrypted
  • 4:56 - 4:59
    by a computer with access
    to the private key.
  • 4:59 - 5:01
    How it works is with some math
  • 5:01 - 5:03
    that we won't get into right now.
  • 5:03 - 5:05
    Think of it this way, imagine
  • 5:05 - 5:06
    that you have a personal mailbox
  • 5:06 - 5:08
    where anybody can deposit mail,
  • 5:08 - 5:10
    but they need a key to do it.
  • 5:10 - 5:12
    Now, you could make many copies
  • 5:12 - 5:14
    of the deposit key, and
    send one to your friend
  • 5:14 - 5:16
    or even just make it publicly available.
  • 5:16 - 5:18
    Your friend, or even a stranger,
  • 5:18 - 5:19
    can use the public key
  • 5:19 - 5:22
    to access your deposit
    slot and drop a message in,
  • 5:22 - 5:26
    but only you can open the
    mailbox with your private key
  • 5:26 - 5:29
    to access all of the secret
    messages you've received.
  • 5:29 - 5:32
    You can send a secure
    message back to your friend
  • 5:32 - 5:35
    by using the public deposit
    key to their mailbox.
  • 5:35 - 5:38
    This way, people can
    exchange secure messages
  • 5:38 - 5:41
    without ever needing to
    agree on a private key.
  • 5:41 - 5:44
    Public key cryptography is the foundation
  • 5:44 - 5:47
    of all secure messaging
    on the open internet
  • 5:47 - 5:51
    including security protocols
    known as SSL and TLS
  • 5:51 - 5:54
    which protect us when
    we're browsing the web.
  • 5:54 - 5:56
    Your computer uses this today.
  • 5:56 - 5:58
    Any time you see the little lock
  • 5:58 - 6:02
    or the letters https in
    your browser's address bar,
  • 6:02 - 6:06
    this means your computer is
    using public key encryption
  • 6:06 - 6:09
    to exchange data securely
    with the website you're on.
  • 6:09 - 6:10
    (energetic music)
  • 6:10 - 6:12
    As more and more people
    get on the internet,
  • 6:12 - 6:15
    more and more private
    data will be transmitted,
  • 6:15 - 6:17
    and the need to secure that data
  • 6:17 - 6:19
    will be even more important.
  • 6:19 - 6:21
    As computers become faster and faster,
  • 6:21 - 6:23
    we'll have to develop new ways
  • 6:23 - 6:26
    to make encryption too hard
    for computers to break.
  • 6:26 - 6:29
    This is what I do with my
    work, and it's always changing.
  • 6:29 - 6:34
    (energetic music)
Title:
The Internet: Encryption and public keys
Description:

more » « less
Video Language:
English
Team:
Khan Academy
Duration:
06:40

English subtitles

Revisions