Professional Documents
Culture Documents
Summary
You are going to practice some of the classic cryptographic algorithms and learn how to
break cipher texts using cryptanalysis techniques including Entropy, Histogram and more.
You’ll also learn how to use Cryptool 1 to help you with these tasks.
Activities
You should’ve done this in the first lab in Week01 (when you played Number Shark). If you
haven’t, head to the software centre and install them. Ask your tutor for help if you’re stuck.
CrypTool 1 is a powerful tool used to aid users with the encryption and decryption of data.
The aim of this activity is to introduce you to the CrypTool 1 by familiarising yourself with its
basic functions.
Open Cryptool from the application menu. You should see the Startingexample-en.txt file
opened within Cryptool as shown in the figure below.
From here you will have the option of encrypting with either Caesar or ROT-13 variants.
Make sure to read the description box to memorise Caesar cipher again. Can you tell the
difference between Caesar and ROT-13?
The key that you input here is the amount that the alphabet will be shifted by. You can
enter the key as a character of the alphabet or as a number. The character will correspond
to the shift of the alphabet, so for example A will shift the alphabet by 1 or 0, as it is the first
character in the alphabet, B by 2 or 1 as it is the second etc.
ROT-13 is an abbreviation for Rotate by 13 places, and so would have a key of M (if the 1st
alphabet character is assigned the value 1). Additionally, the shifted alphabet is
demonstrated below to clearly illustrate what the cipher will do.
Once you have selected your key select Encrypt. A new window will open with your
encrypted message.
Now, you can analyse the strength of the encryption algorithms using a variety of
techniques. We’ll start by looking at brief explanation of these techniques.
1 – Entropy
Entropy calculates the occurrence of each character relative to each of the others. The
maximum possible value that can be calculated when using a standard English alphabet is
4.70 and the lowest is 0. In general, a high calculated value is considered less likely to be
deciphered by a cryptanalyst, while a low value tends to correspond with weak security. This
is particularly true of the substitution ciphers like Caesar, as statistical analysis is its main
weakness.
2 – Histogram
This tool shows you the relative frequency of each character in the document. It is very
useful for comparing the prevalence of different characters and reveal some of the
character’s representation. This applies especially to substitution ciphers like the Caesar
cipher, where statistical analysis is its main weakness.
3 – Autocorrelation
This tool analyses different sections of a message and compares them to find similarities. It’s
possible to find out the length of the key using this tool especially when analysing messages
encrypted with the Vigenère cipher.
Select from the menu bar Analysis > Tools for Analysis > Entropy. This should display the
calculated result.
In the same manner, proceed to analyse your text using the following tools:
• Histogram
• Autocorrelation
Which analysis tool would be the most effective for a cryptanalyst to use to decipher a text
encrypted with the Caesar cipher, and why?
If you look closely at the ciphertext, you can notice that any punctuation or numbers are left
unchanged. To change this Options > Text Options and from here you can select what attributes
of a message the cipher will alter and which it will leave unchanged.
Try different settings to encrypt the same message with the Caesar cipher. What can you
notice? Would that make it more difficult to break? Why?
Now, we’ll look at the Vigenère cipher. Like with the Caesar cipher, open Cryptool and make
sure you’ve Startingexample-en.txt file opened.
To encrypt your message, select Crypt/Decrypt > Symmetric (classic) > Vigenère. Think of a
key to use and select Encrypt.
Like earlier, analyse your encrypted message with all the tools available: Entropy, Histogram
and Autocorrelation.
What do you notice about the histogram results when the text is encrypted with the
Vigenère cipher in comparison to the results of the Caesar cipher? Why is this the case?
To decipher, once again select Crypt/Decrypt > Symmetric (classic) > Vigenère, type the key
and then Decrypt.
Try experimenting with different length keys and see how that affects the ciphertext.
Cryptool offers a nice tool called ANIMAL that shows the concepts behind a cipher using
animation. The animation of a cipher takes example data and then runs through each of the
processes that the cipher requires. This tool is extremely beneficial as it reinforces users’
understanding of a given cipher by showing each process of a given cipher with a high
degree of detail.
We will use it now to see data been encrypted with both Caesar and Vigenère ciphers.
NOTE: the tool might not work if Java is not installed. If that’s the case, ask your tutor to
demonstrate it on the screen.
From the menu bar: Indiv. Procedures > Visualization of Algorithms > Caesar... The
machine may take a minute for ANIMAL to load. When it does, select the play button from
the bottom menu bar to begin the animation.
After watching the Caesar cipher encryption, repeat the process for the Vigenère cipher.
Do you like it J
5. Task 1
Given that the Caesar’s cipher is used, recover the plaintext that corresponds to the
following ciphertext: Sodlqwhaw wr eh hqfubswhg. Describe your approach to
cryptanalysis of the ciphertext. (Try to recover the plaintext without assistance of CrypTool.)
Now, use CrypTool to aid your cryptanalysis. To do this, you should first create a new
document in CrypTool by choosing File > New. Write the challenge ciphertext in the newly
open document. Then, Analysis > Tools for Analysis > Histogram.
If you can’t figure it out, ask your tutor for the right answer.
This type of a cipher is similar to Caesar’s cipher (i.e., every letter of the plaintext is replaced
by a different letter of the alphabet), with the difference that the encryption key can be any
permutation of the plaintext elements. In this way, the key space increases from 26 (in the
case of Caesar’s cipher) to 26! This cipher, however, is still vulnerable to the “relative
frequency”-based attack.
Your task is to decrypt the following message that was encrypted using a monoalphabetic
substitution cipher.
Recover the corresponding encryption key knowing that the first ciphertext word
corresponds to plaintext “Recall”.
In CrypTool, write the ciphertext above in a newly open document. In the main menu,
Analysis > Symmetric Encryption > Manual Analysis > Substitution... and perform
cryptanalysis using the fact that the first word in the ciphertext corresponds to plaintext
“Recall” (as shown in the figure below).
Have you started your assignment yet? If not, you must do now! It’s due by the 1st of
December! If yes, keep going and use the rest of this lab to work on it.