Professional Documents
Culture Documents
04/03/29 1
Definitions
Plaintext
• The message that Alice wants Bob to read
Ciphertext
• The message that Alice sends Bob
Cryptosystem
• The algorithm that Alice uses to turn plaintext
into ciphertext.
Key
• Something Bob and Alice agree on beforehand
that customizes the cryptosystem
04/03/29 2
Cryptosystems
Two basic types:
• Substitution (replace letters)
• Transposition (rearrange letters)
Caeser Cipher
• Shift each letter by the same amount
• Key: how much to shift
Monoalphabetic Substitution
• Replace each letter with some other letter in a one-to-
one manner
• Key: the bottom line of
Plaintext: abcdefghijklmnopqrstuvwxyz
Ciphertext: QWERTYUIOPASDFGHJKLZXCVBNM
04/03/29 3
Caeser Cipher
GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM
YPOT, VIY NJ WZVM JPMNZGQZN, OCVO DA OCZ
WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO
AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT,
'OCDN RVN OCZDM ADIZNO CJPM.‘
Caeser Cipher
• Strengths
Very Fast
Easy to remember
04/03/29 4
Cipher Wheels
04/03/29 5
Caeser Cipher
GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ WZVM
JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO
AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT, 'OCDN RVN OCZDM
ADIZNO CJPM.‘
Caeser Cipher
• Strengths
Very Fast
Easy to remember
• Weaknesses
Formatting gives away the house
Small number of keys: 26 (and one is weak)
Frequency analysis
04/03/29 6
Strengthening Caeser
Fixing the Formatting Weakness
• Strip out punctuation, and put letters in
blocks of the same length.
GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ
WZVM JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON
XJHHJIRZVGOC GVNO AJM V OCJPNVIY TZVMN, HZI RDGG
NODGG NVT, 'OCDN RVN OCZDM ADIZNO CJPM.‘
becomes
GZOP NOCZ MZAJ MZWM VXZJ PMNZ GQZN OJJP MYPO TVIY
NJWZ VMJP MNZG QZNO CVOD AOCZ WMDO DNCZ HKDM ZVIY
DONX JHHJ IRZV GOCG VNOA JMVO CJPN VIYT ZVMN HZIR
DGGN ODGG NVTO CDNR VNOC ZDMA DIZN OCJP M
04/03/29 7
Strengthening Caeser
Key weakness is fixed by monoalphabetic
substitution
• Strengths
403,291,461,126,605,635,584,000,000 keys
Fast
• Weaknesses
How many keys are easy to remember?
Frequency analysis
We saw the frequencies of individual letters, but it is also possible---
and reasonable---to look at pairs of letters, and triples, etc. More
on this in three weeks.
04/03/29 8
Strengthening Caeser
Fixing Frequency analysis
• Many ways to make frequency analysis
harder:
send “e” to 3 letters (do you really need z
and x?)
spell poorly (do you really need all those
silent letters?)
send short messages
04/03/29 9
Vigenère’s Cryptosystem
Let’s encrypt the plaintext
“prince is my favorite musician”
with the keyword “GUITAR”.
Step 1: strip formatting:
“prince ismyfa vorite musici an”
using blocks the same length as our keyword.
Step 2: encrypt the first letter of each block with the
Caeser-cipher that sends “a” to “G”, the second with that
C-c that sends “a” to “U”, the third with that C-c that sends
“a” to “I”, the fourth by sending “a” to “T”, fifth by sending
“a” to “A”, the sixth by sending “a” to “R”.
VLQGCV OMURFR BIZBTV SOABCZ GH
Step 3: reformat into a (possibly) different block length.
VLQG CVOM URFR BIZB TVSO ABCZ GH
04/03/29 10
Vigenère’s Cryptosystem
Strengths
• Infinite number of keywords
• Scrambles frequencies
• Easy to remember key
• Considered unbreakable in Black chambers for
200 years
Weaknesses
• Can perform frequency analysis if we know-or
guess-the length of the keyword
04/03/29 11
Vigenère’s Cryptosystem
History
• Idea of entertwining two keys came
from Leon Battista Alberti around 1465
in Florence
• Developed by
Johannes Trithemius
Giovanni Porta
Blaise de Vigenère
04/03/29 12
The Alpha and the Omega of
Vigenère’s cryptosystem
04/03/29 13
Vigenère’s Cryptosystem
History
• Idea of entertwining two keys came
from Leon Battista Alberti around 1465
in Florence
• Developed by
Johannes Trithemius
Giovanni Porta
Blaise de Vigenère
04/03/29 14
The Vision of Sin
Sit thee down, and have no shame,
Cheek by jowl, and knee by knee:
What car I for any name?
What for order or degree?
04/03/29 15
Babbage to Tennyson
[suggested correction to “otherwise
beautiful” poem]
04/03/29 17
From Lincoln
1863 WOULD RELIEVED
MEADE SINCE HAVE THE
WITHOUT ME WAS WHO THE
SATURDAY HEVY A WAR
FIGHTING CORPS KNOW
PLEASE THE TO OF AND
IMPRESSION TO CAMERON 15
I BE THAT ALL GETTYSBURG
GET RIVER TELL WHO
COMMANDER IN ON LINCOLN
SIGNED OF FOR ONE YOU
FIGHT OVER ONLY BATTLE
SMITH THE MUCH SIMON
WASHINGTON FOR GIVE OF
COUCH THE STRIVEN ENEMY
ANOTHER IF THE WAS
COUNCIL NIGHT
Image from
http://www.picturehistory.com/
04/03/29 18
Rectangular Transposition
Let’s encrypt
“Out of life’s school of war: What does
not destroy me, makes me
stronger.”
with keyword Nietzsche
The lexicographically first letter in
04/03/29 20
Rectangular Transposition
6 5 2 8 9 7 1 4 3
o u t o f l i f e
s s c h o o l o f
w a r w h a t d o
e s n o t d e s t
r o y m e m a k e
s m e s t r o n g
e r q j x z u v r
•Step 3: Write down the columns according to the numbers at the top:
ILTEAOU TCRNYEQ EFOTEGR FODSKNV USASOMR
OSWERSE LOADMRZ OHWOMSJ FOHTETX
04/03/29 21
Rectangular Transposition
Step 4: Break into grams of a
different length:
ILTEAOU TCRNYEQ EFOTEGR FODSKNV USASOMR
OSWERSE LOADMRZ OHWOMSJ FOHTETX
becomes
ILTEA OUTCR NYEQE FOTEG RFODS KNVUS
ASOMR OSWER SELOA DMRZO HWOMS JFOHT ETX
04/03/29 22
Grades
6 out of 7 quizzes (60%)
Computer Homework (20%)
04/03/29 23
Summary
Caeser Sucks
Monoalphabetic substitution is better
Vigenère is good
04/03/29 24