Presentation is loading. Please wait.

Presentation is loading. Please wait.

Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.

Similar presentations


Presentation on theme: "Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2."— Presentation transcript:

1 Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2

2 2 Poly alphabetic Ciphers Another approach to improving security is to use multiple cipher alphabets Called polyalphabetic substitution ciphers Makes cryptanalysis harder with more alphabets to guess and flatter frequency distribution Use a key to select which alphabet is used for each letter of the message Use each alphabet in turn Repeat from start after end of key is reached

3 Poly alphabetic Ciphers The polyalphabetic substitution cipher is a simple extension of the monoalphabetic one. The difference is that the message is broken into blocks of equal length, say B, and then each position in the block (1… B) is encrypted (or decrypted) using a different simple substitution cipher key. The block size (B) is often referred to as the period of the cipher.

4 Poly alphabetic Ciphers Example of the polyalphabetic substitution cipher key and encryption process.(Using block size 3 ) Plaintext: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipherkey: NDWIEURYTLAKSJQHFGMZPXOBCV (Position 1) LPMKONJIBHUVGYCFTXDRZSEAWQ (Position 2) GFTYHBVCDRUJNXSEIKMZAOLWQP (Position 3) Position: 123 123 123 Plaintext: HOW ARE YOU Cipher text: RYOVLKIQWJR (How to decrypt?)

5 5 Vigenère Cipher Simplest polyalphabetic substitution cipher is the Vigenère Cipher Effectively multiple Caesar ciphers Key is multiple letters long K = k1 k2... kd i th letter specifies i th alphabet to use Use each alphabet in turn Repeat from start after d letters in message Decryption simply works in reverse

6 6 Example Write the plaintext out Write the keyword repeated above it Uses each key letter as a Caesar cipher key Encrypt the corresponding plaintext letter E.g. using keyword deceptive key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ ( How to decrypt?)

7 7 Vigenère Table

8 8 Security of Vigenère Ciphers There are multiple cipher text letters for each plaintext letter Hence letter frequencies are obscured, but not totally lost Q. Encipher “TO BE OR NOT TO BE THAT IS THE QUESTION", using a Vigenère cipher with keyword “SUBSTITUTION”.

9 9 Kasiski Method Method developed by Babbage / Kasiski to find the length of key word in Vigenère chpher Repetitions in cipher text give clues to period So find same plaintext an exact period apart Which results in the same cipher text Of course, could also be random fluke E.g. repeated “VTW” in previous example suggests that the size of keyword is 3 or 9 Then attack each mono alphabetic cipher individually using same techniques as before

10 10 One-Time Pad If a truly random key as long as the message is used, the cipher will be secure Called a One-Time pad It is unbreakable since ciphertext bears no statistical relationship to the plaintext Since for any plaintext & any ciphertext there exists a key mapping one to other The key can only be used once though There is a problem of safe distribution of key

11 One-Time Pad Encryption is a additional modulo 26 of plaintext character key length must be equal to the message length !!! For example: – Message: ONETIMEPAD – Pad Sequence: TBFRGFARFM – Cipher text: HO……… Because O+T mod 26 = H  14+19 mod 26 = 7 N+B mod 26 = O  13+1 mod 26 = 14 E+F mod 26 = ……… etc. Decryption P+K mod 26 = C P = C-K mod 26 H-T mod 26 =7-19 mod 26 = -12 mod 26 = 14 = O 11

12 12 Transposition Ciphers Now consider classical transposition or permutation ciphers These hide the message by rearranging the letter order without altering the actual letters used They can be recognised since have the same frequency distribution as the original text

13 13 Rail Fence cipher Write message letters out diagonally over a number of rows Then read off cipher row by row E.g. write message "meet me after the toga party” out as: m e m a t r h t g p r y e t e f e t e o a a t Giving cipher text MEMATRHTGPRYETEFETEOAAT

14 14 Row Transposition Ciphers This is a more complex scheme Write letters of message out in rows over a specified number of columns Then reorder the columns according to some key before reading off the rows Key: 4 3 1 2 5 6 7 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

15 15 Product Ciphers Ciphers using substitutions or transpositions are not secure because of language characteristics Hence consider using several ciphers in succession to make it harder, but: – two substitutions make a more complex substitution – two transpositions make more complex transposition – but a substitution followed by a transposition makes a new much harder cipher This is bridge from classical to modern ciphers

16 16 Rotor Machines Before modern ciphers, rotor machines were most common product cipher They were widely used in WW2 – E.g. German Enigma, Japanese Purple They implemented a very complex, varying substitution cipher Used a series of cylinders, each giving one substitution, which rotated and changed after each letter was encrypted With 3 cylinders have 26 3 =17576 alphabets

17 The Rotor Machine 17

18 Enigma Rotor Machine

19 Steganography An alternative to encryption Hides existence of message – using only a subset of letters/words in a longer message marked in some way – using invisible ink – hiding in graphic image or sound file Drawbacks – high overhead to hide relatively few info bits

20 20

21 Example hide your plaintext in a graphic image Each pixel has 3 bytes specifying the RGB color The least significant bits of pixels can be changed without greatly affecting the image quality So can hide messages in these LSBs Steganography

22 Summary Polyalphabetic ciphers Transposition ciphers Product ciphers Rotor machines Steganography


Download ppt "Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2."

Similar presentations


Ads by Google