Video intypedia001en LESSON 1: HISTORY OF CRYPTOGRAPHY AND ITS EARLY STAGES IN EUROPE EXERCISES Dr. Arturo Ribagorda Garnacho, Carlos III University of Madrid, Spain. EXERCISE 1 The discovery that in each language the letters appeared with a different frequency, allowed the deciphering of Caesar type ciphertexts and, specially, monoalphabetic ciphertexts. For this reason, since the Renaissance, cryptographers exerted in finding new ciphering methods and hence came up with the polyalphabetic systems. These use several alphabets for ciphering, so that each ciphertext letter of another letter depends on the position of the plaintext letter. The simplest of these methods uses two cipher alphabets: one for letters occupying even positions of the plaintext and the other alphabet for the letters in odd positions. An example of this would be: Alphabet for odd positions 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 a e i m p t x b f j n q u y g k c r v z d h l o s w Alphabet for even positions 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 n r w b g l p u z e j c s x h m q v a f k o t y d i Use this polyalphabetic method to encipher the following plaintext: POLYALPHABETIC SUBSTITUTION Exercises intypedia001en 1
SOLUTION Following the given instructions leads to this substitution: P O L Y A L P H A B E T I C S U B S T I T U T I O N k h q d a c k u a r p f f w v k e a z z z k z z g x So the final result would be: k h q y a c k u a r p f f w v k e a z z z k z z g x EXERCISE 2 1.- A transposition method, which was commonly used in ancient times, was the COLUMNAR TRANSPOSITION. First of all, the plaintext is written out, from left to right and top to bottom, in a table with a certain amount of columns. Each letter fits into a cell of the table, which has as many rows as necessary. Then, the ciphertext is obtained by writing the letters in the first column, afterwards the letters in the second column, and so on, until all the letters in the table have been written. Using the columnar transposition method, with five columns, encipher the following plaintext: A COLUMNAR TRANSPOSITION EXERCISE 2.- In order to complicate this process a little, a keyword formed by non-repeating letters and as many letters that you wish the table to have can be used. By writing the keyword on top of the table the first letter of the keyword on top of the first column, the second letter on top of the second column, etc - the ciphertext is obtained by writing out the column whose first letter (that of the keyword) is first in alphabetical order, then the column whose first letter is the following in alphabetical order and so on. Using the columnar transposition method, with the keyword CIPHER, encrypt the following plaintext: I HAVE A COMPLETE EXAM WITH SOLUTION SOLUTION 1.- The plaintext is written in a table with five columns: A C O L U M N A R T R A N S P O S I T I O N E X E Exercises intypedia001en 2
R C I S E Extracting the letters following the column order (first the letters in the first column, then the letters in the second column, then the ones in the third and so on) the ciphertext reads as follows: a m r o o r c n a s n c o a n i e i l r s t x s u t p i e e 2.- Since the keyword has six letters, there should also be six columns. So the plaintext written out in six columns looks as follows: With the keyword written on top: C I P H E R I H A V E A C O M P L E T E E X A M W I T H S O L U T I O N So writing the letters of the columns, according to the alphabetical order of the letters of the keyword (first the C, then the E, then the H, then the I, then the P and finally the R), the ciphertext should look like this: i c t w l e l a s o v p x h i h o e i u a m e t t a e m o n EXERCISE 3 I H A V E A C O M P L E T E E X A M W I T H S O L U T I O N With the monoalphabetic substitution methods broken by the Arabs discovery of cryptanalysis, at the end of the Late Middle Ages, specifically since the Renaissance, new encryption methods began to arise, like the polyalphabetic and nomenclator methods. The latter consisted of a catalogue of names that were going to be ciphered, so each one of them appeared associated with a word, a number or a group of symbols that would substitute the original name in the ciphertext. Exercises intypedia001en 3
Often, polyalphabetic and nomenclator methods were combined, like in the Alberti cipher disk. Looking at the following Alberti cipher disk: and the nomenclator: Phillip II 123 King 124 Walshingam 122 Decipher the following text: b aavqnpgnvsvoiycekcel NOTE 1: For each ten deciphered letters, the outer ring (the one with the uppercase alphabet) has to rotate two positions clockwise. NOTE 2: When enciphering with the Alberti disk, the u corresponds to the v. And when deciphering, the meaning of the sentence is used to figure out which of the letters should it be. SOLUTION: With the rings in their original position: b a a v q n p g n v 1 2 2 I S D E A D I With the outer ring rotated 2 positions clockwise: s v o i y c e k c e N F O R M 1 2 4 1 2 With the outer ring rotated another 2 positions clockwise: l 3 This way, the plaintext (without taking into account the nomenclator) results in: Exercises intypedia001en 4
122ISDEADINFORM124123 So, if we take the nomenclator into account (and adding a space between words in order to read it properly) the deciphered text reads as follows: Walshingam is dead Inform King Phillip II EXERCISE 4 Substitution methods like Caesar replace each letter of the alphabet in the plaintext for another letter in a fixed position down the alphabet (in the Caesar methods this number is three). Knowing that the following ciphertext was obtained using the Caesar method, decipher the message knowing that the English letter frequency is as shown in the table below: drscsckxohkwzvoypmkockbdizoypwyxykvzrklodsmmszrob E T A O I N 10% 7% 6,5% 6% 5,6% 5,5% SOLUTION First of all we have to find the ciphertext letter that corresponds to the e, so we can know how many positions down the alphabet are the ciphertext letters in relation to the plaintext letters. Then the deciphering will be nearly automatic. If we count how many times the letters appear in the ciphertext, there are: O K S Y Z 6 6 4 4 4 The cipher letter o (the one that appears most times, along with the k ) corresponds to the plaintext letter e. So the alphabet used must be: 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 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 Exercises intypedia001en 5
This is confirmed, because the following most frequent ciphertext letter is k which corresponds to the a. Since the ciphertext is very short, the rest of the letters don t follow the typical frequency. The bigger the text, the closer it is to the aforementioned percentage. Considering the ciphertext: drscsckxohkwzvoypk mkockbdizoypwyxykvzrklodsmmszrob And using the attained alphabet: D R S C S C K X O H K W Z V O Y P K M K O C K B T H I S I S A N E X A M P L E O F A C A E S A R D I Z O Y P W Y X Y K V Z R K L O D S M M S Z R O B T Y P E O F M O N O A L P H A B E T I C C I P H E R Results in the following plaintext: This is an example of a Caesar type of monoalphabetic cipher EXERCISE 5 When cryptanalysing a ciphertext, one of the first problems we face is finding out whether a transposition or substitution method has been used. In the first case, the letters haven t changed their meaning, only the position, so the number of times each letter appears will probably correspond to the frequency in which it appears in the relevant language. Therefore, the method would be transposition. Knowing that the distribution of letters in Spanish is approximately: E A O L S N 15 13 9 8 8 7 Please reason out if the following ciphertext has been produced using a monoalphabetic substitution method or a permutation method: Is modí es unovedad porquean te slos hombrñe spodan divid irs es encillamf, igu rac i nhum an asi nparentoda l ahist, oriaele. Sp ecial ist ano ssi rveheaquunpór ecioso eje mpl ar dees te extraoho. Mb renuevoquehe int entad ente ensabiose igénorantesen ms omenoss a biosymso men osig no rantesoporu na yo tradesu. Sverti entes yha cesdefi niríhe dichoquee, raunaconparac, on cretar e nrgicament, el aáe s pecie yhacer n oás v ertod oelradical. Exercises intypedia001en 6
SOLUTION There is approximately the following amount of letters: e = 49 a = 44 o =32 l =9 s =29 n =28 Total letters = 368 That makes: e= 13%; a=12%; 0=9%; l=2%; s= 8%; n = 8%, which is more or less the same as the natural frequency of letters in Spanish, therefore, this is a transposition cipher. Madrid, Spain, September 2010 http://www.intypedia.com http://twitter.com/intypedia Exercises intypedia001en 7