Professional Documents
Culture Documents
Computer
and
Network
Security
Amr El Mougy
Alaa Gohar
Lecture (2)
Cryptographic Tools
Early History
Egypt (Old Kingdom), ca. 1900BC. Use of non-standard
hieroglyphs (probably not a serious attempt at secret
communication)
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Breaking the Monoalphabetic Cipher
Human languages are redundant, eg “secrty s awsm"
letters are not equally commonly used
In English E is by far the most common letter
followed by T,R,N,I,O,A,S
Other letters like
Z,J,K,Q,X are fairly
rare
Have tables of single,
double & triple letter
frequencies for
various languages
Breaking the Monoalphabetic Cipher
Key concept - monoalphabetic substitution ciphers do not change
relative letter frequencies
Discovered by Arabian scientists in 9th century
Calculate letter frequencies for ciphertext
Compare counts/plots against known values
If Caesar cipher look for common peaks/troughs
peaks at: A-E-I triple, NO pair, RST triple
troughs at: JK, X-Z
For monoalphabetic must identify each letter
tables of common double/triple letters help
Breaking the Monoalphabetic Cipher
Given ciphertext:
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Count relative letter frequencies
Key
Breaking the Vigenère Cipher
Have multiple ciphertext letters for each plaintext letter
Hence letter frequencies are obscured, but not totally lost
Start with letter frequencies
see if look like monoalphabetic or not
If not, then need to determine number of alphabets, since then can attach each
Kasiski method developed by Babbage/Kasiski is a way of breaking Vigenere
Repetitions in ciphertext give clues to period, so find same plaintext an exact
period apart which results in the same ciphertext
Of course, could also be random fluke
eg repeated “VTW” in previous example suggests size of 3 or 9
Then attack each monoalphabetic cipher individually using same techniques as
before
One-time Pad
A random key as long as the message is used to encrypt and decrypt a single message
The key is then discarded, never to be used again
The output bears no statistical relationship to the plaintext
Given any plaintext of equal length to the ciphertext, there is a key that produces that
plaintext. Therefore, if you did an exhaustive search of all possible keys, you would end
up with many legible plaintexts, with no way of knowing which was the intended
plaintext
ciphertext: ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS
key: pxlmvmsydofuyrvzwc tnlebnecvgdupahfzzlmnyih
plaintext: mr mustard with the candlestick in the hall
ciphertext: ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS
key: mfugpmiydgaxgoufhklllmhsqdqogtewbqfgyovuhwt
plaintext: miss scarlet with the knife in the library