< Return to Video

The one-time pad | Journey into cryptography | Computer Science | Khan Academy

  • 0:05 - 0:08
    For over 400 years,
    the problem remained.
  • 0:08 - 0:12
    How could Alice design a cipher
    that hides her fingerprint,
  • 0:12 - 0:15
    thus stopping the
    leak of information?
  • 0:15 - 0:18
    The answer is randomness.
  • 0:18 - 0:21
    Imagine Alice rolled
    a 26 sided die
  • 0:21 - 0:23
    to generate a long
    list of random shifts,
  • 0:23 - 0:27
    and shared this with Bob
    instead of a code word.
  • 0:27 - 0:29
    Now, to encrypt
    her message, Alice
  • 0:29 - 0:32
    uses the list of
    random shifts instead.
  • 0:32 - 0:34
    It is important that
    this list of shifts
  • 0:34 - 0:38
    be as long as the message,
    as to avoid any repetition.
  • 0:38 - 0:41
    Then she sends it to Bob, who
    decrypts the message using
  • 0:41 - 0:44
    the same list of random
    shifts she had given him.
  • 0:47 - 0:49
    Now Eve will have a problem,
    because the resulting
  • 0:49 - 0:53
    encrypted message will have
    two powerful properties.
  • 0:53 - 0:57
    One, the shifts never fall
    into a repetitive pattern.
  • 0:59 - 1:03
    And two, the encrypted message
    will have a uniform frequency
  • 1:03 - 1:04
    distribution.
  • 1:04 - 1:07
    Because there is no frequency
    differential and therefore
  • 1:07 - 1:10
    no leak, it is now
    impossible for Eve
  • 1:10 - 1:11
    to break the encryption.
  • 1:14 - 1:18
    This is the strongest
    possible method of encryption,
  • 1:18 - 1:22
    and it emerged towards the
    end of the 19th century.
  • 1:22 - 1:26
    It is now known as
    the one-time pad.
  • 1:26 - 1:29
    In order to visualize the
    strength of the one-time pad,
  • 1:29 - 1:32
    we must understand the
    combinatorial explosion
  • 1:32 - 1:35
    which takes place.
  • 1:35 - 1:38
    For example, the Caesar
    Cipher shifted every letter
  • 1:38 - 1:43
    by the same shift, which was
    some number between 1 and 26.
  • 1:43 - 1:45
    So if Alice was to
    encrypt her name,
  • 1:45 - 1:49
    it would result in one of
    26 possible encryptions.
  • 1:49 - 1:52
    A small number of possibilities,
    easy to check them all,
  • 1:52 - 1:55
    known as brute force search.
  • 1:55 - 1:58
    Compare this to the one-time
    pad, where each letter would
  • 1:58 - 2:02
    be shifted by a different
    number between 1 and 26.
  • 2:02 - 2:04
    Now think about the number
    of possible encryptions.
  • 2:04 - 2:08
    It's going to be 26 multiplied
    by itself five times, which
  • 2:08 - 2:10
    is almost 12 million.
  • 2:10 - 2:13
    Sometimes it's
    hard to visualize,
  • 2:13 - 2:16
    so imagine she wrote her
    name on a single page,
  • 2:16 - 2:21
    and on top of it stacked
    every possible encryption.
  • 2:21 - 2:25
    How high do you
    think this would be?
  • 2:25 - 2:29
    With almost 12 million
    possible five-letter sequences,
  • 2:29 - 2:32
    this stack of paper
    would be enormous,
  • 2:32 - 2:35
    over one kilometer high.
  • 2:35 - 2:38
    When Alice encrypts her
    name using the one-time pad,
  • 2:38 - 2:42
    it is the same as picking
    one of these pages at random.
  • 2:42 - 2:45
    From the perspective of
    Eve, the code breaker,
  • 2:45 - 2:47
    every five letter
    encrypted word she
  • 2:47 - 2:52
    has is equally likely to
    be any word in this stack.
  • 2:52 - 2:55
    So this is perfect
    secrecy in action.
Title:
The one-time pad | Journey into cryptography | Computer Science | Khan Academy
Description:

more » « less
Video Language:
English
Team:
Khan Academy
Duration:
02:56

English subtitles

Revisions Compare revisions