< Return to Video

The Caesar cipher | Journey into cryptography | Computer Science | Khan Academy

  • 0:04 - 0:08
    SPEAKER 1: The first well known
    cipher, a substitution cipher,
  • 0:08 - 0:11
    was used by Julius
    Caesar around 58 BC.
  • 0:11 - 0:14
    It is now referred to
    as the Caesar Cipher.
  • 0:14 - 0:18
    Caesar shifted each letter
    in his military commands
  • 0:18 - 0:20
    in order to make them
    appear meaningless
  • 0:20 - 0:22
    should the enemy intercept it.
  • 0:22 - 0:26
    Imagine Alice and Bob decided
    to communicate using the Caesar
  • 0:26 - 0:30
    Cipher First, they would need
    to agree in advance on a shift
  • 0:30 - 0:32
    to use-- say, three.
  • 0:32 - 0:33
    So to encrypt her
    message, Alice would
  • 0:33 - 0:36
    need to apply a shift
    of three to each letter
  • 0:36 - 0:38
    in her original message.
  • 0:38 - 0:43
    So A becomes D, B becomes
    E, C becomes F, and so on.
  • 0:43 - 0:46
    This unreadable, or
    encrypted message,
  • 0:46 - 0:48
    is then sent to Bob openly.
  • 0:51 - 0:54
    Then Bob simply subtracts
    the shift of three
  • 0:54 - 0:58
    from each letter in order to
    read the original message.
  • 0:58 - 1:00
    Incredibly, this
    basic cipher was
  • 1:00 - 1:04
    used by military leaders for
    hundreds of years after Caesar.
  • 1:04 - 1:07
    JULIUS CAESAR: I
    have fought and won.
  • 1:07 - 1:11
    But I haven't conquered
    over man's spirit,
  • 1:11 - 1:13
    which is indomitable.
  • 1:13 - 1:14
    SPEAKER 1: However,
    a lock is only
  • 1:14 - 1:17
    as strong as its weakest point.
  • 1:17 - 1:19
    A lock breaker may look
    for mechanical flaws.
  • 1:19 - 1:21
    Or failing that,
    extract information
  • 1:21 - 1:25
    in order to narrow down
    the correct combination.
  • 1:25 - 1:30
    The process of lock breaking and
    code breaking are very similar.
  • 1:30 - 1:31
    The weakness of
    the Caesar Cipher
  • 1:31 - 1:35
    was published 800 years later
    by an Arab mathematician
  • 1:35 - 1:36
    named Al-Kindi.
  • 1:36 - 1:39
    He broke the Caesar Cipher
    by using a clue based
  • 1:39 - 1:41
    on an important
    property of the language
  • 1:41 - 1:43
    a message is written in.
  • 1:43 - 1:46
    If you scan text from
    any book and count
  • 1:46 - 1:47
    the frequency of
    each letter, you
  • 1:47 - 1:50
    will find a fairly
    consistent pattern.
  • 1:50 - 1:53
    For example, these are the
    letter frequencies of English.
  • 1:53 - 1:57
    This can be thought of as
    a fingerprint of English.
  • 1:57 - 1:58
    We leave this
    fingerprint when we
  • 1:58 - 2:01
    communicate without
    realizing it.
  • 2:01 - 2:03
    This clue is one of
    the most valuable tools
  • 2:03 - 2:05
    for a codebreaker.
  • 2:05 - 2:08
    To break this
    cipher, they count up
  • 2:08 - 2:11
    the frequencies of each
    letter in the encrypted text
  • 2:11 - 2:14
    and check how far the
    fingerprint has shifted.
  • 2:14 - 2:17
    For example, if H is
    the most popular letter
  • 2:17 - 2:19
    in the encrypted
    message instead of E,
  • 2:19 - 2:22
    then the shift was likely three.
  • 2:22 - 2:24
    So they reverse
    the shift in order
  • 2:24 - 2:26
    to reveal the original message.
  • 2:26 - 2:28
    This is called
    frequency analysis,
  • 2:28 - 2:32
    and it was a blow to the
    security of the Caesar cipher.
Title:
The Caesar cipher | Journey into cryptography | Computer Science | Khan Academy
Description:

Brit explains the Caesar cipher, the first popular substitution cipher, and shows how it was broken with "frequency analysis"

Watch the next lesson: https://www.khanacademy.org/computing/computer-science/cryptography/crypt/v/polyalphabetic-cipher?utm_source=YT&utm_medium=Desc&utm_campaign=computerscience

Missed the previous lesson? https://www.khanacademy.org/computing/computer-science/cryptography/crypt/v/intro-to-cryptography?utm_source=YT&utm_medium=Desc&utm_campaign=computerscience

Computer Science on Khan Academy: Learn select topics from computer science - algorithms (how we solve common problems in computer science and measure the efficiency of our solutions), cryptography (how we protect secret information), and information theory (how we encode and compress information).

About Khan Academy: Khan Academy is a nonprofit with a mission to provide a free, world-class education for anyone, anywhere. We believe learners of all ages should have unlimited access to free educational content they can master at their own pace. We use intelligent software, deep data analytics and intuitive user interfaces to help students and teachers around the world. Our resources cover preschool through early college education, including math, biology, chemistry, physics, economics, finance, history, grammar and more. We offer free personalized SAT test prep in partnership with the test developer, the College Board. Khan Academy has been translated into dozens of languages, and 100 million people use our platform worldwide every year. For more information, visit www.khanacademy.org, join us on Facebook or follow us on Twitter at @khanacademy. And remember, you can learn anything.

For free. For everyone. Forever. #YouCanLearnAnything

Subscribe to Khan Academy’s Computer Science channel: https://www.youtube.com/channel/UC8uHgAVBOy5h1fDsjQghWCw?sub_confirmation=1
Subscribe to Khan Academy: https://www.youtube.com/subscription_center?add_user=khanacademy

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

English subtitles

Revisions Compare revisions