Top Banner
1 Classical Techniques: Substitution Substitute a character, digit or symbol for each character in the plaintext Discussed: The Caesar cipher Monoalphabetic cipher Playfair cipher Polyalphabetic cipher
15

Classical Techniques: Substitution

Feb 24, 2016

Download

Documents

Duy

Classical Techniques: Substitution. Substitute a character, digit or symbol for each character in the plaintext Discussed: The Caesar cipher Monoalphabetic cipher Playfair cipher Polyalphabetic cipher. Caesar Cipher. 2000 years ago, by Julius Caesar - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Classical Techniques: Substitution

1

Classical Techniques: Substitution Substitute a character, digit or symbol for each

character in the plaintext Discussed:

The Caesar cipher Monoalphabetic cipher Playfair cipher Polyalphabetic cipher

Page 2: Classical Techniques: Substitution

2

Caesar Cipher 2000 years ago, by Julius Caesar A simple substitution cipher, known as Caesar cipher Replace each letter with the letter standing 3 places further

down the alphabetPlain: meet me after the toga partyCipher: PHHW PH DIWHU WKH WRJD SDUWB

No key, just one mapping (translation) 0123456...Plain: abcdefghijklmnopqrstuvwxyz Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC 3456789...

ci=E(3,pi)=(pi+3) mod 26; pi=D(3,ci)=(ci-3) mod 26

Page 3: Classical Techniques: Substitution

3

Generalized Caesar Cipher Can use any shift from 1 to 25, i.e., replace each letter by a

letter a fixed distance awayci=E(k,pi)=(pi+k) mod 26; pi=D(k,ci)=(ci-k) mod 26

Shift cipher Key = kKey letter: the letter a plaintext A maps to

e.g. a key letter of F means A maps to F, B to G, …, Y to D, Z to E

Hence have 26 (25 useful) ciphersKey space = 26

Page 4: Classical Techniques: Substitution

4

Brute-Force Cryptanalysis of Caesar Cipher

Ciphertext only attack Charateristics for

success1. The encryption and

decryption algorithms are known

2. There are only 25 keys to try

3. The language of the plaintext is known and easily recongnizable

Page 5: Classical Techniques: Substitution

5

Monoalphabetic Cipher Increased key space compared to Caesar cipher Alphabet sequence is not required What is the key space?

26! > 4 x 1026

Monoalphabetic ciphers are easier to break because they reflect frequency of alphabet E = 12.75, T = 9.25, R = 8.50, N = 7.75, etc.

Page 6: Classical Techniques: Substitution

6

Relative Frequency of Letters in English Text

Page 7: Classical Techniques: Substitution

7

Frequency Statistics of LanguageIn addition to the frequency info of single letters,

the frequency info of two-letter (digram) or three-letter (trigram) combinations can be used for the cryptanalysis

Most frequent digramsTH, HE, IN, ER, AN, RE, ED, ON, ES, ST, EN, AT, TO, NT,

HA, ND, OU, EA, NG, AS, OR, TI, IS, ET, IT, AR, TE, SE, HI, OF

Most frequent trigramsTHE, ING, AND, HER, ERE, ENT, THA, NTH, WAS, ETH,

FOR, DTH

Substitution Techniques

Page 8: Classical Techniques: Substitution

8

Playfair CipherBest-known multiple-letter substitution cipherDigram cipher (digram to digram, i.e., E(pipi+1) =

cici+1 through keyword-based 5x5 transformation table)

Great advance over simple monoalphabetic cipher(26 letters 26x26=676 digrams)

Can be generalized to polygram cipher

Keyword = monarchy

Plaintext: H S E A A R M UCiphertext: B P I M R M C M

M O N A RC H Y B DE F G I/J KL P Q S TU V W X Z

Page 9: Classical Techniques: Substitution

9

Playfair Cipher - Rules Repeating plaintext letters are separated with a filler

letter, such as X. Plaintext letters that fall in the same row of the matrix are

each replaced by the letter to the right, with the first element of the row circularly following the last.

Plaintext letters that fall in the same column are each replaced by the letter beneath, with the top element of the row circularly following the last.

Otherwise, each plaintext letter is replaced by the letter that lies in its own row and the column occupied by the other plaintext letter.

Page 10: Classical Techniques: Substitution

10

Polyalphabetic CipherTypically a set of monoalphabetic substitution rules is

usedKey determines which rule to use

Page 11: Classical Techniques: Substitution

11

Vigenère cipher Best-known polyalphabetic ciphers Each key letter determines one of 26 Caesar (shift) ciphersci = E(pi) = pi + ki mod(key length) mod 26 Example:

Keyword is repeated to make a key as long as the plaintext

Key: deceptivedeceptivedeceptivePlaintext: wearediscoveredsaveyourselfCipheretxt: ZICVTWQNGRZGVTWAVZHCQYGLMGJ

Page 12: Classical Techniques: Substitution

12

Vigenère cipher - 2

Page 13: Classical Techniques: Substitution

13

Example: Encryption

Decryption

Page 14: Classical Techniques: Substitution

14

Vigenère cipher - 3

Vigenère autokey system: after key is exhausted, use plaintext for running key (to eliminate the periodic nature)

Key: deceptivewearediscoveredsavPlaintext: wearediscoveredsaveyourselfCipheretxt: ZICVTWQNGKZEIIGASXSTSLVVWLA

Page 15: Classical Techniques: Substitution

15

Transposition (Permutation) Techniques Hide the message by rearranging the letter order without

altering the actual letters used Rail Fence Cipher

Write message on alternate rows, and read off cipher row by row Example:

Block (Columnar) Transposition Ciphers Message is written in rectangle, row by row, but read off column by

column; The order of columns read off is the key Example:

M e m a t r h t g p r y e t e f e t e o a a t MEMATRHTGPRYETEFETEOAAT

Key: 4 3 1 2 5 6 7Plaintext: a t t a c k p

o s t p o n ed u n t i l tw o a m x y z

Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ