Reference no: EM132476986
Cryptanalysis
Aims
The aims of this practical work are to:
• Provide an understanding of the concept of entropy in the context of written language.
• Give a better understanding of how unicity distance is calculated.
• Illustrate the weakness of classical ciphers
• Reinforce understanding of the calculation of unicity distance
• Demonstrate the utility of knowledge of known plaintext to the cryptanalyst.
Learning Outcomes
After completing this practical work you will
• Appreciate that for large amounts of written text the most commonly used letters have a predictable frequency of occurrence.
• Understand how frequency analysis can be used to break classical ciphers.
• Know how to perform a ciphertext only attack on a monoalphabetic cipher.
• Know how to perform a known plaintext attack on a classical cipher.
Frequency Analysis
Question 1. Prepare three relatively long English texts (each of the size of 15,000 or more letters) taken from a
o novel or story
o news report
o technical report
, respectively, and save each as a word document.
Find on the Internet a similar single text (≥ 15,000 letters) written in an arbitrary foreign language, copy it and save it as a word document.
Determine and provide a histogram showing in the graphical form the relative frequency of letters in all four prepared long texts, as well, as the textual listings of 26 most frequent digrams and trigrams. This can be done using CrypTool. In Cryptool from the menu File>Open open the word document containing the text you want to analyse. The histogram can be obtained by selecting Analysis>Tools for Analysis >Histogram and the the digrams and trigrams by selecting Analysis>Tools for Analysis >N-Gram and selecting the appropriate option.
Do the frequency distributions depend significantly on the type of text in English? Do these distributions depend significantly on the language in which the message was written?
Question 2. For the English language novel/story text of Q1, using the N-Gram tool in Cryptool, note down the five most frequent letters in the text. For first 500, 1K, 2K, 5K, 10K, and 15K letters in the text, record the estimated probabilities of each of the five letters you noted down; The estimated probability of a letter is its frequency in a sample of text divided by the total number of letters in the sample of text.
Plot the estimated probabilities against the number of letters for the five most probable letters on a single graph and discuss what you observe.
Question 3. For the English language novel/story text of Q1, using Cryptool;
Analysis>Tools for Analysis>Entropy
Give the Entropy of the first 10, 20, 50, 100, 200, 500, 1K, 2K, 5K, 10K, and 15K letters and discuss what you observe.
Question 4. For the English text taken from a novel of Q1, for the first 1,000 letters and then the entire text give the frequency distribution of the 26 most frequent N-Grams of single letters, diagrams, and trigrams. Now encrypt the first 1,000 letters and then the entire text using the following 3 classical ciphers available in CrypTool: Vigenere, Hill, and Substitution. Give the frequency distribution of the 10 most frequent N-Grams of single letters, diagrams, and trigrams for all 6 obtained ciphertexts.
What are the characteristic features of the obtained distributions? How you could use them to determine which cipher was used to obtain the given ciphertext?
5. Recognizing and breaking ciphers for the same text encrypted using different ciphers
Question 5. Below please find 6 ciphertexts of the same message encrypted using the following 6 classical ciphers available in CrypTool: Caesar, Vigenere, Hill, Substitution, Playfair, and Permutation. Using the tools available in Cryptool under Analysis > Symmetric Encryption (classic) do your best to match each ciphertext with the cipher used to generate it and if possible give the key used in each case. Find the plaintext, by breaking the Caesar (shift) cipher or the Vigenere Cipher, and then use the plaintext if necessary to identify the other ciphers used to encrypt the now known plaintext. All attacks must be documented. Brute-force attacks do not count.
Note that the analysis tool for the Playfair cipher requires the plaintext in Playfair ‘form' which can be obtained by encrypting then decrypting the plaintext under a key of your choice. If the tool asks you to save a recovered key it may be viewed under Edit > Show Key after saving it. In some cases plaintext and ciphertext has to be loaded into the tool as .txt files.
Question 6. For any four of the ciphertexts of Q6 explain how the analysis tool you used to answer Q6 enabled identification of key used to create the ciphertext.
6. One-time Pad Cipher
Question 7. Consider the following letter encodings: letter encoding
A message M = SUSAN is Vernam encrypted into ciphertext C = WIOES. Find the corresponding encryption key. Provide details of your cryptanalysis.
Question 8. Consider the following two ciphertexts C1 = UNSI and C2 = EAUW that are obtained by Vernam encrypting messages M1 and M2, under the same encryption key which is different from the key obtained in Q8. The plaintext letter encodings are the same as Q8. The encrypted messages are two names. Let us denote with mi,k the kth letter in message Mi. The following is known about messages (names): m1,1 = I and m2,4 = E. Using this information, try to recover messages M1 and M2, as well as the encryption key. Provide details of your cryptanalysis. What does this tell you about the use of keys in the one-time cipher?
7. Conclusions
Question 9. Give the major conclusions that you draw from this laboratory.
Attachment:- Cryptanalysis.rar