This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Intro to Cryptography
Lesson 1: Classic Crypto
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Learning Outcomes
Upon completion of this lesson, students will be able to:
• Describe historical ciphers such as: shift, substitution, Vigenere, enigma
machines and others.
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Basic Terms for this Lesson
• Encrypt – Encode a message
• Decrypt – Decode a message
• Plaintext – The message
• Ciphertext – The encoded message (called a “cipher”)
• Symmetric – Encode and decode a message using the same secret
• Substitution cipher – Substitute one character for another
• Polyalphabetic cipher – Substitute one character for another, but
uses multiple substitution alphabets in one cipher
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Caesar Cipher
• Simply substitute one letter for another
• Goes back to Egyptian times but contributed to Julius Caesar
• Caesar Cipher – substitute letters +3 (c is for Caesar)
• A becomes D
• B becomes E
• C becomes F
• ….
• Z becomes C
Plaintext: cybersecurity is fun
Ciphertext: fbehuvhfxulwb lv ixq
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Substitution Cipher Variations
• Substitute a different offset, +1,+2,+4, +24…
• Atbash – Wrap the Alphabet (or +25)
Plaintext: If you think you can do a thing or think you can’t
do a thing, you are right.
Ciphertext: ???
• ROT13 is +13 (Originally used to encrypt word documents!)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Fun way to do substitution ciphers
Build a Caesar Cipher Wheel!
When the inner A aligns with the outer A, this is called position 0. The key
indicates how many letters to shift each letter. For example, +4 means to
rotate the inner wheel counter clockwise such that the inner E aligns to the
outer A.
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Some More Ciphers to Try….
Ciphertext: lwfhj mtuujw nsajsyji htgtq
Plaintext: ???
Ciphertext: wlmgurmwuzfogurmwzivnvwb
Plaintext: ????
• What are some techniques to discover the cipher?
• Why can’t we use these ciphers to secure our personal
information?
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
One Way to Break the Substitution Cipher:
Frequency Analysis
• In a long enough English text, the letters are distributed
approximately as shown in this graph:
“English letter frequency (alphabetic)” by Nandhp. Public Domain.
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Polybius Square
• Ancient Greek – Invented by Scholar Polybius
• Convert symbols ( letters into numbers) using an easily created and
memorized grid (Row, Column). M= 32
• Be able to hold up a set of torches in two hands, or knock on a prison
wall
Ciphertext:
52231144 5215 4423243325 5215
121513343215
Plaintext: ???
1 2 3 4 5
1 A B C D E
2 F G H I/J K
3 L M N O P
4 Q R S T U
5 V W X Y Z
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Vigenère Cipher
• A shift cipher where every
character is shifted differently
based on a code word (key)
• In this example, the key is PIE.
Then use the ciphertext
generated from the character
before.
• Row = Key, Column =Plaintext,
Middle = Ciphertext
Plaintext: V I G E N E R E
Key: P I E P I E P I
Ciphertext: K Q K T V I G M
Image From https://commons.wikimedia.org/wiki/File:Vigenere-square.png
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Alberti Cipher Disk
• Created by Italian Leon Battista
Alberti (1404)
• Both parties agree on a priming
key (inner circle) – Lets use k
• Every time you see a capital
letter, you switch to use that as
the priming key
Ft&yxaepQmmepe&vmsGgimhva
ahmyiAakz
Alberti was a true renaissance
man
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
Enigma Machine
• Used in Nazi Germany to
communicate during WWII
• Required a daily code book and
the machine to encrypt/decrypt
each day.
• But it is a polyalphabetic cipher,
although very complex!
Image by Alessandro Nassiri
CC BY-SA 4.0
This document is licensed with a Creative Commons Attribution 4.0 International License ©2017
In Conclusion
• There are many other historical
ciphers to explore:
• Playfair
• Bacon
• Pigpen
• Navajo Code Talkers
• Rail Fence
• Alan Turing
• Read “The Gold Bug” by Edgar
Allan Poe
• Read “The Code Book” by Simon
Singh
• Although fun and may have
worked in their day, they are
easily cracked today:
• Letter Frequency Analysis
• Word length
• Letter patterns
• Finding a crib (a word you know is
being used)

Lesson-1-Classic-Crypto.pptx

  • 1.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Intro to Cryptography Lesson 1: Classic Crypto
  • 2.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Learning Outcomes Upon completion of this lesson, students will be able to: • Describe historical ciphers such as: shift, substitution, Vigenere, enigma machines and others.
  • 3.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Basic Terms for this Lesson • Encrypt – Encode a message • Decrypt – Decode a message • Plaintext – The message • Ciphertext – The encoded message (called a “cipher”) • Symmetric – Encode and decode a message using the same secret • Substitution cipher – Substitute one character for another • Polyalphabetic cipher – Substitute one character for another, but uses multiple substitution alphabets in one cipher
  • 4.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Caesar Cipher • Simply substitute one letter for another • Goes back to Egyptian times but contributed to Julius Caesar • Caesar Cipher – substitute letters +3 (c is for Caesar) • A becomes D • B becomes E • C becomes F • …. • Z becomes C Plaintext: cybersecurity is fun Ciphertext: fbehuvhfxulwb lv ixq
  • 5.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Substitution Cipher Variations • Substitute a different offset, +1,+2,+4, +24… • Atbash – Wrap the Alphabet (or +25) Plaintext: If you think you can do a thing or think you can’t do a thing, you are right. Ciphertext: ??? • ROT13 is +13 (Originally used to encrypt word documents!) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
  • 6.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Fun way to do substitution ciphers Build a Caesar Cipher Wheel! When the inner A aligns with the outer A, this is called position 0. The key indicates how many letters to shift each letter. For example, +4 means to rotate the inner wheel counter clockwise such that the inner E aligns to the outer A.
  • 7.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Some More Ciphers to Try…. Ciphertext: lwfhj mtuujw nsajsyji htgtq Plaintext: ??? Ciphertext: wlmgurmwuzfogurmwzivnvwb Plaintext: ???? • What are some techniques to discover the cipher? • Why can’t we use these ciphers to secure our personal information?
  • 8.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 One Way to Break the Substitution Cipher: Frequency Analysis • In a long enough English text, the letters are distributed approximately as shown in this graph: “English letter frequency (alphabetic)” by Nandhp. Public Domain.
  • 9.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Polybius Square • Ancient Greek – Invented by Scholar Polybius • Convert symbols ( letters into numbers) using an easily created and memorized grid (Row, Column). M= 32 • Be able to hold up a set of torches in two hands, or knock on a prison wall Ciphertext: 52231144 5215 4423243325 5215 121513343215 Plaintext: ??? 1 2 3 4 5 1 A B C D E 2 F G H I/J K 3 L M N O P 4 Q R S T U 5 V W X Y Z
  • 10.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Vigenère Cipher • A shift cipher where every character is shifted differently based on a code word (key) • In this example, the key is PIE. Then use the ciphertext generated from the character before. • Row = Key, Column =Plaintext, Middle = Ciphertext Plaintext: V I G E N E R E Key: P I E P I E P I Ciphertext: K Q K T V I G M Image From https://commons.wikimedia.org/wiki/File:Vigenere-square.png
  • 11.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Alberti Cipher Disk • Created by Italian Leon Battista Alberti (1404) • Both parties agree on a priming key (inner circle) – Lets use k • Every time you see a capital letter, you switch to use that as the priming key Ft&yxaepQmmepe&vmsGgimhva ahmyiAakz Alberti was a true renaissance man
  • 12.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 Enigma Machine • Used in Nazi Germany to communicate during WWII • Required a daily code book and the machine to encrypt/decrypt each day. • But it is a polyalphabetic cipher, although very complex! Image by Alessandro Nassiri CC BY-SA 4.0
  • 13.
    This document islicensed with a Creative Commons Attribution 4.0 International License ©2017 In Conclusion • There are many other historical ciphers to explore: • Playfair • Bacon • Pigpen • Navajo Code Talkers • Rail Fence • Alan Turing • Read “The Gold Bug” by Edgar Allan Poe • Read “The Code Book” by Simon Singh • Although fun and may have worked in their day, they are easily cracked today: • Letter Frequency Analysis • Word length • Letter patterns • Finding a crib (a word you know is being used)

Editor's Notes

  • #2 These slides were made possible by a grant from the NSA Cybersecurity Curriculum (Intro to Cybersecurity Workshop) The slides are 508 compliant. These materials were created by: Seth Hamman, PhD Cedarville University Suzanne Mello-Stark, PhD Rhode Island College
  • #3 History http://pi.math.cornell.edu/~morris/135/timeline.html
  • #5 There are many websites that encode for you.
  • #6 Plaintext: If you think you can do a thing or think you can’t do a thing, you are right. Ciphertext: Ru blf gsrmp blf xzm wl z gsrmt li gsrmp blf xzm'g wl z gsrmt, blf ziv irtsg. (Henry Ford)
  • #8 There are many websites that encrypt/decrypt. Here is one: https://cryptii.com/pipes/caesar-cipher There are many ways to recognize this cyber. 1) Common letters appear more often. 2) If using spaces, little words are noticed. And, the, etc. What are some drawbacks: If you figure out the pattern, you can decrypt everything. It is symmetrical. If you know how to encrypt, you and decrypt and visa versa. A common game found in newspapers. lwfhj mtuujw nsajsyji htgtq Grace Hopper invented cobol Dont find fault find remedy. (Henry Ford) wlmgurmwuzfogurmwzivnvwb
  • #10 Plaintext: What we think we become Buddha
  • #11 https://www.dcode.fr/vigenere-cipher https://sharkysoft.com/vigenere/ https://en.wikipedia.org/wiki/Vigenère_cipher How to Decrypt? Start in the center, with the ciphertext and the code word (agreed upon (secondary channel)
  • #13 https://www.youtube.com/watch?v=G2_Q9FoD-oQ https://www.spymuseum.org/exhibition-experiences/about-the-collection/collection-highlights/enigma-machine/ Full link for image: https://en.wikipedia.org/wiki/Enigma_machine#/media/File:Enigma_(crittografia)_-_Museo_scienza_e_tecnologia_Milano.jpg