Presentation is loading. Please wait.

Presentation is loading. Please wait.

Classical Techniques: Substitution

Similar presentations


Presentation on theme: "Classical Techniques: Substitution"— Presentation transcript:

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

2 Caesar Cipher ci=E(3,pi)=(pi+3) mod 26; pi=D(3,ci)=(ci-3) mod 26
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 alphabet Plain: meet me after the toga party Cipher: PHHW PH DIWHU WKH WRJD SDUWB No key, just one mapping (translation) Plain: abcdefghijklmnopqrstuvwxyz Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC ci=E(3,pi)=(pi+3) mod 26; pi=D(3,ci)=(ci-3) mod 26

3 Generalized Caesar Cipher
Can use any shift from 1 to 25, i.e., replace each letter by a letter a fixed distance away ci=E(k,pi)=(pi+k) mod 26; pi=D(k,ci)=(ci-k) mod 26 Shift cipher Key = k Key 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) ciphers Key space = 26

4 Brute-Force Cryptanalysis of Caesar Cipher
Ciphertext only attack Charateristics for success The encryption and decryption algorithms are known There are only 25 keys to try The language of the plaintext is known and easily recongnizable

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 still easy to break because they reflect frequency of alphabet E = 12.75, T = 9.25, R = 8.50, N = 7.75, etc.

6 Relative Frequency of Letters in English Text

7 Frequency Statistics of Language
Substitution Techniques Frequency Statistics of Language In 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 digrams TH, 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 trigrams THE, ING, AND, HER, ERE, ENT, THA, NTH, WAS, ETH, FOR, DTH

8 Playfair Cipher Best-known multiple-letter substitution cipher Digram 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 U Ciphertext: B P I M R M C M M O N A R C H Y B D E F G I/J K L P Q S T U V W X Z

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.

10 Polyalphabetic Cipher
Typically a set of monoalphabetic substitution rules is used Key determines which rule to use

11 Vigenère cipher ci = E(pi) = pi + ki mod(key length) mod 26 Example:
Best-known polyalphabetic ciphers Each key letter determines one of 26 Caesar (shift) ciphers ci = E(pi) = pi + ki mod(key length) mod 26 Example: Keyword is repeated to make a key as long as the plaintext Key: deceptivedeceptivedeceptive Plaintext: wearediscoveredsaveyourself Cipheretxt: ZICVTWQNGRZGVTWAVZHCQYGLMGJ

12 Vigenère cipher - 2

13 Example: Encryption Decryption

14 Vigenère cipher - 3 Vigenère autokey system: after key is exhausted, use plaintext for running key (to eliminate the periodic nature) Key: deceptivewearediscoveredsav Plaintext: wearediscoveredsaveyourself Cipheretxt: ZICVTWQNGKZEIIGASXSTSLVVWLA

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 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: Plaintext: a t t a c k p o s t p o n e d u n t i l t w o a m x y z Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ

16 Steganography “The art of covered writing” “Security by obscurity”
Hide messages in other messages Conceal the existence of message Conceal what you are communicating (Sending encrypted messages would make you a spy) Character marking. Overwrite with a pencil Invisible ink, - Pin punctures, - First letter of each word Letter position on page, - Drawings, - Codes Typewriter correction ribbon Microdots Digital steganography

17 Steganography - Example
News Eight Weather: Tonight increasing snow. Unexpected precipitation Smothers Eastern towns. Be extremely cautious and use snowtires especially heading east. The highways are knowingly slippery. Highway evacuation is suspected. Police report emergency situations in downtown ending near Tuesday First letter of each word yields: Newt is upset because he thinks he is President This example was created by Neil F. Johnson, and was published in Steganography,Technical Report TR_95_11_nfj, URL:  From WWII German spy (Kahn): Apparently neutral’s protest is thoroughly discounted and ignored. Isman hard hit. Blockade issue affects pretext for embargo on by products, ejecting suets and vegetable Oils. Second letter of each word yields: Pershing sails from NY June 1.


Download ppt "Classical Techniques: Substitution"

Similar presentations


Ads by Google