Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS3517 Distributed Systems and Security Lecture 18

Similar presentations


Presentation on theme: "CS3517 Distributed Systems and Security Lecture 18"— Presentation transcript:

1 CS3517 Distributed Systems and Security Lecture 18
Security Cryptology CS3517 Distributed Systems and Security Lecture 18

2 What is Cryptology? Cryptology covers two related fields:
Cryptography “Art and science of keeping a message secure” Cryptanalysis “Art and science of breaking ciphertext” Cryptology covers two related fields: Cryptography: how to keep a message secure (develop ciphers that are unbreakable) Cryptanalysis: how break ciphers and cipher-text

3 Cryptography Why use Cryptography?
Communication Scenario Alice Bob Alice and Bob want to communicate

4 Cryptography Why use Cryptography?
Threat!! Alice Bob Eve So think again about CIA. Alice and Bob want to communicate Eve is eavesdropping (intercept, delete, add message) Cryptography is needed when communicated messages should be safeguarded against a third party intercepting or manipulating them.

5 Cryptography Terminology
Plain-Text Plain-Text Cipher-Text Encryption Algorithm Decryption Algorithm Communication Channel Start with plain text. This is fed through an encryption algorithm – resulting in a cipher text. This cipher text is then sent via a communication channel. At the other end, a decryption algorithm converts the cipher text back to the original plain text. Alice Bob Eve

6 Cryptography Encode and Decode with a Cipher
You have a process, whereby the encryption algorithm is a function of the plain text (its input), and a key. The output is the cipher text, which in turn is the input for the decryption algorithm. This is itself a function of the cipher text and another key – producing as an output, the original plain text. Cipher = Algorithm + Key No cipher should rely on the secrecy of the algorithm!

7 Basic Principles of Cryptography Cipher Algorithms
A cipher is an algorithm that scrambles plain text, given a key, into a form that hides its meaning Plaintext symbols can be single letters, blocks of letters or complete words Two forms of ciphers Substitution ciphers: replace plaintext symbols with corresponding cipher-text symbols Transposition ciphers: reorder plaintext symbols within the cipher-text

8 Transposition Cipher A transposition cipher is a method of encryption where symbols of the plaintext are reordered according to a particular scheme There are different forms of Transposition Cipher Rail Fence cipher, Route cipher, Columnar Transposition Columnar Transposition: The plaintext is written out in rows of fixed length, generating a matrix Cipher: an encoded form of the text is generated by reading out and concatenating the columns of this matrix, where the columns may be chosen in some scrambled order The length of the rows and the scrambling (permutation) of the columns is usually defined by a keyword E.g.: the word “ZEBRAS” is of length 6 (length of rows) and the letters have the following alphabetical order “ ” (determining how the columns have to be read in sequence Problem with Transposition Cipher: Cannot produce output until all input characters have been read Columnar Transposition – we’ll see an example of this in a minute. To concatenate – to link things together in a chain or series.

9 Transposition Cipher Columnar Transposition
Plaintext: Ciphertext: MESSAGE FROM MARY STUART KILL THE QUEEN M E S S A G E F R O M M A R Y S T U A R T K I L L T H E Q U E E N Plaintext in For example, choose 9 columns. We’ll see that this means our key is of length 9 and = Read vertical text from columns 1, 2, .. 9 to acquire the ciphertext. Ciphertext out MOAEEMRQSMTUSAKEARIEGYLNESLFTTRUH MOAEE MRQSM TUSAK EARIE GYLNE SLFTT RUH

10 Transposition Cipher Columnar Transposition
Plaintext: Ciphertext: MESSAGE FROM MARY STUART KILL THE QUEEN M E S S A G E F R O M M A R Y S T U A R T K I L L T H E Q U E E N With 9 columns, we have 9! = 362,880 possible keys Plaintext in Here the key is , and the columns are read in order (1, 2, 3 … 9) to acquire the cipher text Ciphertext out SMTUESLGYLNMOAEARIERUHSAKEFTTEMRQ SMTUE SLGYL NMOAE ARIER UHSAK EFTTE MRQ

11 Transposition Cipher How to decode: Therefore
We know: key has length 9 We know: cipher text has length 33 How many rows do we need in transposition table? Therefore Ciphertext-length / Keylength = 33 / 9 = 3.6 We round this number up to 4, therefore we need a table with 4 rows However: last row is not full, how many empty spaces? We calculate: Rows x Keylength – Ciphertextlength = 4 x 9 – 33 = 3 Therefore: the last row has 3 empty spaces (and 6 full) To decipher it, the recipient has to work out the column lengths by dividing the message length by the key length. Then he can write the message out in columns again, then re-order the columns by reforming the key word.

12 Transposition Cipher Columnar Transposition
Plaintext: using the word “SECRET” as a key defines number of columns for the transposition table The key has 6 letters, therefore 6 columns Defines the column sequence during readout According to the alphabet, the letter C corresponds to “1”, E to “2” and “3” (as it occurs two times), R to “4”, S to “5” and T to “6” The key “SECRET”, therefore, defines a read-out sequence of “ ” for the table columns to generate the cipher text S E C R E T M E S S A G E F R O M M A R Y S T U A R T K I L L T H E Q U E E N With 6 columns, we have 6! = 720 possible keys

13 Transposition Cipher Columnar Transposition
Plaintext: using “SECRET” as a key MESSAGE FROM MARY STUART KILL THE QUEEN S E C R E T M E S S A G E F R O M M A R Y S T U A R T K I L L T H E Q U E E N “SECRET” = Plaintext in ZEBRAS is the key. Numbers are assigned to the six letters such that A = 1, B = 2, E = 3 … z = 6. So 6 columns. Read out the columns in order (1, 2, 3, ..6) to acquire the cipher text. Ciphertext out SRYTHNEFRRTEAMTIQSOSKEMEAALEGMULU SRYTH NEFRR TEAMT IQSOS KEMEA ALEGM ULU

14 Transposition Cipher How to decode: Therefore
We know: key is “SECRET”, has length 6 We know: cipher text is of length 33 How many rows do we need in transposition table? Therefore Ciphertext-length / Keylength = 33 / 6 = 5.5 We always round up: with 5.5 as a result, we need a table with 6 rows However: last row is not full, how many empty spaces? We calculate: Rows x Keylength – Ciphertextlength = 6 x 6 – 33 = 3 Therefore: the last row has 3 empty spaces (and 3 full) To decipher it, the recipient has to work out the column lengths by dividing the message length by the key length. Then he can write the message out in columns again, then re-order the columns by reforming the key word.

15 Transposition Cipher Columnar Transposition
Decryption: using “SECRET” as a key We know: first three columns have 6 rows Fill ciphertext into columns according to column numbers SRYTH NEFRR TEAMT IQSOS KEMEA ALEGM ULU S E C R E T S R Y T H N ZEBRAS is the key. Numbers are assigned to the six letters such that A = 1, B = 2, E = 3 … z = 6. So 6 columns. Read out the columns in order (1, 2, 3, ..6) to acquire the cipher text. Ciphertext in First, column 3:

16 Transposition Cipher Columnar Transposition
Decryption: using “SECRET” as a key We know: first three columns have 6 rows Fill ciphertext into columns according to column numbers SRYTH NEFRR TEAMT IQSOS KEMEA ALEGM ULU S E C R E T E S F R R Y R T T H E N ZEBRAS is the key. Numbers are assigned to the six letters such that A = 1, B = 2, E = 3 … z = 6. So 6 columns. Read out the columns in order (1, 2, 3, ..6) to acquire the cipher text. Ciphertext in Second, column 2: Etc.

17 Transposition Cipher Columnar Transposition
Decryption: using “SECRET” as a key SRYTH NEFRR TEAMT IQSOS KEMEA ALEGM ULU S E C R E T M E S S A G E F R O M M A R Y S T U A R T K I L L T H E Q U E E N Ciphertext in ZEBRAS is the key. Numbers are assigned to the six letters such that A = 1, B = 2, E = 3 … z = 6. So 6 columns. Read out the columns in order (1, 2, 3, ..6) to acquire the cipher text. Plantext out MESSAGE FROM MARY STUART KILL THE QUEEN

18 Substitution Ciphers The basic idea for Substitution Ciphers is to substitute one symbol in the plain text with another symbol in the ciphertext

19 Substitution Cipher Mono-alphabetic Substitution
One symbol in plaintext is substituted by one symbol (always the same) in ciphertext Easy to attack: Frequency of occurrence of a particular letter is mirrored in ciphertext, with the use of frequency analysis (frequency tables) easy to decipher

20 Cesar Cipher Mono-Alphabetic Substitution Cipher
Cipher attributed to Julius Caesar Cipher algorithm: Shift each letter in the plaintext n places Each plaintext letter is replaced with the same symbol throughout the text With an alphabet of 26 characters, we have 25 different shift ciphers Example Try to encode: “treaty impossible” Try to decode: DWWDFN DW GDZQ

21 Mono-Alphabetic Substitution Cipher Caesar’s Cipher
Plaintext: Substitution table: Caesar’s Cipher Given: “key = 3”: construct the substitution table by shifting the alphabet three characters to the left: Ciphertext: MESSAGE FROM MARY STUART KILL THE QUEEN ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC key = 3 PHVVDJH IURP PDUB VWXDUW NLOO WKH TXHHQ

22 Mono-Alphabetic Substitution Cipher Key Phrase Substitution Table
Plaintext: Substitution table: Use a key phrase Given: “key = SCOTLAND”: construct the substitution table with the key and add the rest of the alphabet – each character can only occur once, even in the key! Ciphertext: MESSAGE FROM MARY STUART KILL THE QUEEN ABCDEFGHIJKLMNOPQRSTUVWXYZ SCOTLANDBEFGHIJKMPQRUVWXYZ key = SCOTLAND HLQQSNL APJH HSPY QRUSPR FBGG RDL MULLI

23 Mono-Alphabetic Substitution Cipher Random Substitution Table
Plaintext: Substitution table: Use a random sequence of the characters of the alphabet: The key is the sequence of the 26 characters, in random order Ciphertext: MESSAGE FROM MARY STUART KILL THE QUEEN ABCDEFGHIJKLMNOPQRSTUVWXYZ EYUOBMDXVTHIJPRCNAKQLSGZFW 26! possible keys JBKKEDB MARJ JEAF KQLEAQ HVII QXB NLBBP

24 Cryptanalysis Is the attempt to decipher ciphertext with specific attack methods First known publication: “A Manuscript on Deciphering Cryptographic Messages”, by the 9th century Arab scholar Abu Yusuf Ya’qub Attack methods: Frequency analysis Anagramming Dictionary attacks Probable word method Vowel – consonants splitting Etc. Lots of ways to attack an encoded message – we’ll have a quick look at frequency analysis.

25 Frequency Analysis In English:
Most common letters: E, T, A, O, N, I, ... Most common 2-letter words: ON, AS, TO, AT, IT, ... Most common 3-letter words: THE, AND, FOR, WAS, ... Letter frequencies in ciphertext can be used to guess plaintext letters Statistical Frequency Analysis of letters and words can easily break any mono-alphabetic substitution cipher

26 Frequency Analysis Example: an analysis of 200 English letters results in the following Frequency Table: Backs up what we just saw.

27

28 Use Frequency Analysis
Try to decode the following Ciphertext: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU ' EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. Let’s have a go at doing some frequency analysis. Based on the Frequency Table given, we assume that the letter with the highest frequency in the Ciphertext encodes the letter ‘e’

29 Use Frequency Analysis
Try to decode the following Ciphertext: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC --e---e e--e- --e e-e e UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU --e '- ---e----e--e --e---e- -e----e EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P -e ----e e e --- - DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. ---e---e e e So, the letter ‘I’ appears the most in our cipher text, so let’s assume that’s equivalent to ‘e’ in our plain text. Based on the Frequency Table given, we assume that the letter with the highest frequency in the Ciphertext encodes the letter ‘e’

30 Use Frequency Analysis
Step 1: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC --e---e-t ----t-- -et-e- the e-e---- the --th---t- -- UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the --t---'- --te----e--e --e---e- -e----e -t h-t EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he ----e th-t e -t e --- - DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. ---e---e-t t e e t---. Carrying on, we see that ‘U’ is the next most frequent letter, so let’s assume that is a ‘t’ in our plain text. That suggests ‘E’ is ‘h’ because of the frequency of the word ‘the’ discussed earlier. U = t E = h I = e We can identify:

31 Use Frequency Analysis
Step 2: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC --e---e-t ----t-- -et-e- the e-e---- the a-th---t- -- UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the -at---'- --te----e--e a-e---e- -e-a--e -t ---ta--- -hat EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he -a--e- a that a-e -t a ----e --- a DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. ---e---e-t a- t e --a-----e at---. P = a Step 3: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC --e-i-e-t --i-to- -etoe- the -i-- -e-e-i-- the a-tho-it- o- UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the -atio-'- i-te--i-e--e a-e--ie- -e-a--e it -o-tai-- -hat P = a as a very common single-letter word. It also makes sense by completing the word ‘that’. ‘it’ and ‘to’ are also very common two-letter words, giving F = I, and N = o. F = i N = o EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he -a--e- a --o-i-io- that -o--- -a-e it a --i-e -o- a DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. -o-e---e-t o--i-ia- to -i---o-e --a--i-ie- i--o--atio-.

32 Use Frequency Analysis
Step 4: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC -re-i-e-t --i-to- -etoe- the -i-- re-e-i-- the a-thorit- of UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the -atio-'- i-te--i-e--e a-e--ie- -e-a--e it -o-tai-- -hat EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he -a--e- a -ro-i-io- that -o--- -a-e it a -ri-e for a DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. -o-er--e-t offi-ia- to -i---o-e --a--ifie- i-for-atio-. C = f R = r Step 5: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC -re-i-e-t cli-to- -etoe- the -ill re-e-i-- the authority of UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the -atio-'- i-telli-e-ce a-e-cie- -ecau-e it co-tai-- -hat Another popular three letter word, with ‘o’ in the middle, comprising letters we haven’t figured out yet is ‘for’. Then we can start to fill in blanks to make whole words, like ‘authority’, and ‘official’ – giving us still more letters. Y = c K = l V = u A = y EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he calle- a -ro-i-io- that -oul- -a-e it a cri-e for a DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. -o-er--e-t official to -i-clo-e cla--ifie- i-for-atio-.

33 Use Frequency Analysis
Step 6: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC president clinton -etoed the -ill rene-in- the authority of UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the nation's intelli-ence a-encies -ecause it contains -hat O = p T = s S = d M = n L = m EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he called a pro-ision that -ould ma-e it a crime for a DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. -o-ernment official to disclose classified information. Step 7: ORITFSIMU YKFMUNM WIUNIS UEI HFKK RIMIXFMD UEI PVUENRFUA NC president clinton vetoed the bill renewing the authority of UEI MPUFNM'T FMUIKKFDIMYI PDIMYFIT HIYPVTI FU YNMUPFMT XEPU the nation's intelligence agencies because it contains what W = v H = b D = g M = n L = m X = w J = k The more letters we fill in, the easier this process becomes, and still more words can be deciphered giving still more letters, which can then be applied throughout the rest of the message – giving a more a more intelligible plain text. Then – result! EI YPKKIS P ORNWFTFNM UEPU XNVKS LPJI FU P YRFLI CNR P he called a provision that would make it a crime for a DNWIRMLIMU NCCFYFPK UN SFTYKNTI YKPTTFCFIS FMCNRLPUFNM. government official to disclose classified information.

34 Mono-alphabetic Substitution Ciphers Polygram
Polygrams are groups of characters that are substituted by other groups of characters Digrams: groups of 2 characters are substituted by corresponding cipher Digrams Trigrams: groups of 3 characters are substituted by corresponding cipher Trigrams Generally: n-grams are substituted by corresponding cipher n-grams The key space is extremely large: in full Digram substitution over an alphabet of 26 characters, there are 26! possible keys The first practical historical use in 1854 by Sir Charles Wheatstone: Called the “Playfair” cipher

35 Homophonic Substitution Cipher
Motivation Increase the difficulty of frequency analysis attacks on substitution ciphers Method Plaintext letters map to more than one ciphertext symbol to make it more ambiguous (a one-to-many mapping) Highest-frequency plaintext symbols are given more equivalents than others More than 26 characters will be required in the ciphertext alphabet – expansion becomes necessary History Used between 15th and 18th century for diplomatic mail Louis XIV “Great Cipher” was unbreakable for 200 years

36 Improving Mono-alphabetic Substitution
How to increase the security of this cipher: Eliminate spaces Use many-to-one mappings that level the frequencies (homophonic) Lots of other clever ideas ... Even with these improvements, mono-alphabetic substitutions are still very weak! Can easily be beaten Next big step: poly-alphabetic substitution ciphers These were ok until the dawn of modern computers So, we begin to see how computing changes the domain of cryptology. This is important for these lectures.

37 Poly-Alphabetic Substitution Ciphers
Uses multiple mono-alphabetic ciphers We use n different mono-alphabetic ciphers For each symbol in plaintext, decide which cipher to use May depend on the position of the symbol in plaintext Are mostly periodic substitution ciphers if we have n ciphers, we will apply them in sequence to the first n symbols in plaintext, after that we repeat this sequence of ciphers for the next n symbols etc. Need an example to show what this means – so the next few slides will do that.

38 Vigenère Poly-alphabetic Substitution Cipher
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J K L M N O P Q R S T U V W X Y Z 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 A B C D E F G H I J L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Vigenère square (1586)‏ The alphabet written out 26 times. Each alphabet shifted cyclically to the left compared to the previous one. Corresponds to the 26 possible Caesar ciphers. During encryption, the cipher uses a different alphabet from one of the rows. The alphabet used at each point depends on a repeating keyword.

39 Vigenère Poly-alphabetic Substitution Cipher
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J K L M N O P Q R S T U V W X Y Z 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 A B C D E F G H I J L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Vigenère square (1586)‏ Keyword: WHITE Our keyword will be ‘WHITE’.

40 Vigenère Poly-alphabetic Substitution Cipher
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J K L M N O P Q R S T U V W X Y Z 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 A B C D E F G H I J L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Vigenère square (1586)‏ Keyword: WHITE MESSAGE FROM .... WHITEWH ITEW HITE Keyword is repeated for the length of the message – ‘MESSAGE FROM….’ etc.

41 Vigenère Poly-alphabetic Substitution Cipher
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J K L M N O P Q R S T U V W X Y Z 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 A B C D E F G H I J L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Vigenère square (1586)‏ Keyword: WHITE MESSAGE FROM .... WHITEWH ITEW HITE I First take the column that corresponds to the first letter of the plain text ‘M’. Then look down to the row that matches the first letter of the keyword, i.e. M from MESSAGE, corresponds to W from WHITE. This produces the first letter of cipher text from the intersect of this column and row – which in this case is ‘I’.

42 Vigenère Poly-alphabetic Substitution Cipher
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J K L M N O P Q R S T U V W X Y Z 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 A B C D E F G H I J L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Vigenère square (1586)‏ Keyword: WHITE MESSAGE FROM .... WHITEWH ITEW HITE IL Then the process is just carried out for the rest of the message. Column E, corresponds to row H, yielding cipher text L – and so on…

43 Vigenère Poly-alphabetic Substitution Cipher
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J K L M N O P Q R S T U V W X Y Z 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 A B C D E F G H I J L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Vigenère square (1586)‏ Keyword: WHITE MESSAGE FROM .... WHITEWH ITEW HITE ILALECL NKSI …and so forth.

44 How to break the Vigenère Cipher
Was regarded as practically unbreakable for 300 years But: depending on the length n of the keyword, every nth letter in the ciphertext is encrypted by the same alphabet Attack Work out the length of the keyword Use frequency analysis to solve the resulting simple substitutions How would you approach this as a cryptanalyst?

45 Working out the Length of the Keyword
Search for re-occurring patterns in the ciphertext Record distance between patterns KSMKEHZALKSMKMPOWAJXSEJCSFLZSY Different example now. If we found the following cipher text… 9 letters between the ‘K’ of the first ‘KS’, ‘KSM’, ‘KSMK’ and the second ‘KS’, ‘KSM’, ‘KSMK’. Implies the key is 9, (or 3 or 1) characters long.

46 Longer Key? Make key longer: as long as the message itself?
If there are patterns in the key (e.g., words), the message can still be decrypted with a bit of work Could try and offset this as a disadvantage by using a longer key. Repetitions occur less frequently and are less obvious. But…

47 One Time Pad IF the key is as long as the message AND
the key is completely random THEN the encryption is perfect (can’t be broken) Such a key can only be used once Is called a “One Time Pad” Why is it called a one time pad? Earl 20th century. Duplicate paper pads printed with lines of random number groups. Each page had a serial number and could be used as a work sheet to encode a message. It was then destroyed. The serial number of the page would be sent with the encoded message. The recipient would reverse the procedure and then destroy their copy of the page.

48 The Use of Modern Computers
Computers are tailor-made for both code making and breaking - computing engines were spawned from code breaking efforts during WWII (Alan Turing) Possible encoding techniques Represent messages as list of numbers (bits) and operate on these with favourite algorithm Simplest Case: use Exclusive OR (Vernam, AT&T, 1917) 0  0 = 0 1  0 = 1 0  1 = 1 1  1 = 0 Plaintext DEAD Key BEEF Ciphertext = 6042 A = 1010 B = 1011 C = 1100 D = 1101 E = 1110 F = 1111 Bletchley Park. Can read all about the work they did if you’re interested. Start to look at how the principles we’ve looked at translate to the binary word of computing. The + in a circle symbol means Exclusive Or (XOR). It’ is ‘true’ when vales either side of it are different. If D = 1101 and B (from the key) = 1011, then the cipher text is produced from the binary such that 1 XOR 1 = 0, 1 XOR 0 = 1, 0 XOR 1 = 1, and 1 XOR 1 = 0. So the first ‘letter’ of the cipher text = 0110

49 Symmetric Key Encryption
Plaintext DEAD Key BEEF Ciphertext = 6042 = Ciphertext Key BEEF Plaintext = DEAD = This process works simply in reverse if the decryption key is the same as the encryption key. Work it through yourself as a simple exercise. Is simple: same key to encode and decode

50 Secure Key? Just generate a long “one time pad” bitstream, do the simple XOR, and we have perfect security This has two problems It is hard to generate a long truly random bitstream Sender and receiver must both have the same one time pad (i.e. the key) If we make the algorithm more sophisticated we can make the minimum length of a secure key much shorter The key is the ‘key’ to the security measures we are discussing – but what about the security measures we employ to keep the key secure..? No single answer to this.

51 Strength of Cryptographic Algorithms
Cryptographic algorithms are classified according to whether they can resist attacks Adversarial Models Ciphertext-only attacks (weakest) Attacker has access to encrypted data (e.g. wiretapping), but nothing else Known plaintext attacks (stronger) Attacker obtains the ciphertext and may succeed in getting or guessing all or part of the encrypted plaintext Chosen plaintext attacks (strongest) Attacker can play with encryption device, can choose plaintext to encrypt and may examine the resulting ciphertext Next two lectures are on Keys, Digital Signatures and Certificates. They aren’t trivial…


Download ppt "CS3517 Distributed Systems and Security Lecture 18"

Similar presentations


Ads by Google