15
Classical Monoalphabetic Ciphers Day 2

Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Embed Size (px)

Citation preview

Page 1: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Classical Monoalphabetic Ciphers

Day 2

Page 2: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Keyword cipher• Select a keyword, if the keyword has

any repeated letters, drop all but the first occurrence.

• Write the keyword below the alphabet and fill in the rest of the space with the remaining letters of the alphabet in their standard order.

• VBA Code• Modification: Allow the keyword to start

anywhere along the alphabet.

Page 3: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Keyword: cryptanalysis• Dictionary attach using a computer.• Every letter of a language has a

personality of its own.• Determine the personality of each

character in the ciphertext and try to match them with the known personalities of corresponding plain text.

• This attach was used as early as the 9th century, by Arab scientist and philosopher al-Kindi.

Page 4: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Frequency analysis• Assignment:– Download “Frequency_Analysis.xls”

from the SMA website.– Find a 200-500 word section of

common English writing. Copy and format it in Word.

– Copy it.– Use it in the Excel spreadsheet to do

a single, double, and triple letter frequency count.

Page 5: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Compile class data

Page 6: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Frequency analysis• “r” forms digrams with more different

letters more often than any other letter.• The three vowles, “a”, “I”, and “o”

avoid each other, except for “io”.• “ea” is the most frequent digram

involving vowels.• Eight percent of the letters that procede

“n” are vowels.• “h” frequently appears before “e” and

almost never after it.

Page 7: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Frequency analysis• Be willing to give up on an assumption

and try something else if it appears that you are on the wrong path.

Page 8: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Affine cipher• Each letter is assigned a number. “a” =

0, “b” = 1, “c” = 2, …• The key to an affine cipher is a pair of

numbers (a, b).• The greatest common divisor (GCD) of

a and 26 must be 1.• Let p be the number of the plaintext

letter and c the number of the ciphertext letter.

• c = (a p + b) mod 26• p = (a-1(c – b)) mod 26

Page 9: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Affine: example• a = 3, b = 7• Find the equations for encryption and

decryption.• Encrypt the message “the dog”• Decrypt the message “TIVUJWL”

Note: a a-1 = 1 (mod n)

Page 10: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Affine: cryptanalysis• Is an affine cipher easier or harder to

break then a keyword cipher?• How would we break an affine cipher?

Page 11: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Multiliteral cipher• It replaces each

plaintext letter with a pair of letters.

• Choose a 5 letter keyword with no repeating letters.

• “i” and “j” occupy the same cell.

a b c d e

f g h i k

l m n o p

q r s t u

v w x y z

Page 12: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Multiliteral: cryptanalysis

• Is an multiliteral cipher easier or harder to break then a keyword cipher?

• How would we break an multiliteral cipher?

Page 13: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Monoalphabetic cipher history• The Argentis worked for the Pope

during the late 1500 and early 1600s.– Probably first to use keyword– Numbers were used instead of

letters• Used by the South during the Civil War.

Page 14: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Monoalphabetic cipher history• Middle Ages – nomenclator– Monoalphabetic and some

substitutions for words or phrases– Mary, Queen of Scots

Page 15: Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write

Review