Document Details

StylishSpessartine

Uploaded by StylishSpessartine

جامعة العلوم والتقانة

Full Transcript

1 University of Science and Technology Faculty of Computer Science and Information Technology Department of Information and Communication Technology Lecture (6) Instructor: Mashair Omer Classical Substitution Ciphers 2 2.Mo...

1 University of Science and Technology Faculty of Computer Science and Information Technology Department of Information and Communication Technology Lecture (6) Instructor: Mashair Omer Classical Substitution Ciphers 2 2.Monoalphabatic Ciphers Every plaintext character in A is replaced (substituted) by another suitable character from the secret text B. We have to alphabets: a – plaintext, b – secret text and f is unique f : a→b Example: 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 D A G x y L S c b w z q n e H I M V J P K F R U T O Cont: 3  each plaintext letter maps to a different random cipher text letter. hence key is 26 letters long  now have a total of 26! = 4 x 1026 keys  with so many keys, might think is secure, but would be !!!WRONG!!!  problem is language characteristics  Language Redundancy and Cryptanalysis  human languages are redundant  in English e is by far the most common letter, then T,R,N,I,O,A,S  other letters are fairly rare Z,J,K,Q,X  have tables of single, double & triple letter frequencies English Letter Frequencies 4 Natural English text has a very distinct distribution that can be used help crack codes. This distribution is as follows: 3. Polyalphabetical Ciphers 5 In this kind of ciphering, every plaintext a is convert into many secret alphabets b1, b2, …. fi : a → Bi Where i=1, 2, 3, … Special case of this kind of ciphers is Polyalphabetical cipher with period p: fi : a → Bi Where i=1, 2, 3, …, p p- is the period of cipher. Attention: When p=1 then we got mono alphabatic cipher 6 Vigenere Cipher  Simplest polyalphabetic substitution cipher  Consider the set of all Caesar ciphers: { Ca, Cb, Cc,..., Cz }  Key: e.g. security  Encrypt each letter using Cs, Ce, Cc, Cu, Cr, Ci, Ct, Cy in turn.  Repeat from start after Cy.  Decryption simply works in reverse. 7 Vigenere cipher c=(m+ki) mod n m=(c-ki) mod n 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Example: If we have n=26, and k=HOST, cipher the following “ I AM GOING HOME”: m= I A M G O I N G H O M E k= H O S T H O S T H O S T c= P O E Z V W F Z O C E Y 8 Vigenère table: 9 Transposition Ciphers  Consider classical transposition or permutation ciphers  Hide the message by rearranging the letter order without altering the actual letters used  Can recognise these since have the same frequency distribution as the original text Note:  Transposition cipher doesn’t change the characters in the plain-text when it generates the cipher-text – it just re- arranges them Write Geometric Write out Overt Text figure Secret Text 10 1. Rail-fence Cipher The rail fence cipher is a very simple, easy to crack cipher. It follows a simple rule for mixing up the characters in the plaintext to form the cipher text.  The key for the rail fence cipher is just the number of rails.  write message letters out diagonally over a number of rows  then read off cipher row by row  eg. write message meet me after the toga party out as: mematrhtgpry etefeteoaat giving cipher text  MEMATRHTGPRYETEFETEOAAT 2.Column Transposition Ciphers 11 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. Algorithm of ciphering: Begin 1. Make a table with four columns and index them in turn from one. 2. Fill every cell in turn with one character for every cell When we finish filling the cells from right to left in one row insert a new one 1. If not end of m go to point 2 2. If there is still any cell empty in the last row fill it with character X. 3. Read in turn by the index given order of the key, which will represent c. End. 12 Example: m=CRYPTOGRAPHY IS SO NICE and k=(4,2,3,1) 1 2 3 4 1 C R Y P 2 T O G R 3 A P H Y 4 I S S O 5 N I C E c = PRYOEROPSIYGHSCCTAIN 13 How to break transposition cipher The only way is trial and error. A cryptanalyst (code breaker) simply has to try several keys until the correct one is found.

Use Quizgecko on...
Browser
Browser