Lab 3 Cryptography: Introduction To Computer Security
Lab 3 Cryptography: Introduction To Computer Security
CSE 3482
Introduction to Computer Security
Lab 3
Cryptography
The purpose of this lab is to demonstrate the basics principles and common uses of symmetric
and asymmetric cryptography. In Part 1, we will experiment with Caesar Cipher and look at the
use of letter-frequency analysis to facilitate the decryption of Caesar Cipher. In Parts 2, 3 and 4,
we will perform experimentation using TripleDES, RSA, and Hybrid RSA-AES
encryption/decryption, respectively.
Tools: CrypTool.
Before you begin: In the C:\ drive of your VM, create a directory ‘3482’. In this newly created
C:\3482 directory, download Lab3.zip file from the course website on Moodle. By unzipping
Lab3.zip, a directory C:\3482\Lab3 will be created. Verify that this directory comprises three
subdirectories: Part 1, Part 2, and Part 4.
After two failed brute-force approaches to decrypting MysteryText.txt, let us use a better
decrypting strategy.
9. In CrypTool click on Analysis -> Tools for Analysis -> Histogram. This will generate a graph
showing the relative frequency/representation of characters in MysteryText.txt.
11. Based on 9. and 10., we are in a good position to be able to estimate the
encryption/decryption key for MysteryText.txt.
12. Use the key estimated in 11. to decrypt MysteryText.txt. Save this (decrypted) file as
MysteryText_decrypted.txt.
________________________________________________________________
15. Select Analysis -> Tools for Analysis -> Histogram to generate the histogram of
MysteryText_decrypted.txt. Compare this new histogram with the one obtained in 9..
________________________________________________________________
________________________________________________________________
________________________________________________________________
16. In CrypTool, close all windows but MysteryText_decrypted.txt and its respective
histogram. Select Encrypt/Decrypt -> Symmetric (classical) -> Vigenere1. Enter ABCDEFG
in the Key Entry, and then click Encrypt.
17. Apply Analysis -> Tools for Analysis -> Histogram to the newly (Vigenere) encrypted file.
_______________________________________________________________
_______________________________________________________________
16. Again, in CrypTool, close all windows but MysteryText_decrypted.txt. Now, encrypt
MysteryText_decrypted.txt two times in a row - the first time by applying Caesar
encryption with K1=5, and the second time by applying Caesar encryption with K2=8.
1
Vigenere is an encryption method that involves a series of different Caesar ciphers. For more see:
http://en.wikipedia.org/wiki/Vigenere_cipher.
2. TripleDES Encryption [20 points]
Triple DES (Data Encryption Algorithm) is a symmetric-key block cipher, which applies the
standard/original DES cipher algorithm three times to each data block. The original DES
cipher’s key size of 56 bits was generally sufficient when that algorithm was first designed. But,
the availability of increasing computational power made brute-force attacks feasible. Triple DES
provides a relatively simple method of increasing the key size of DES, without the need to
design a completely new block cipher algorithm.
1. In CrypTool, close all windows but MysteryText_decrypted.txt. Click on Analysis -> Tools
for Analysis -> N-Gram. The obtained table is a numerical representation of the histogram
from 1.15., and it should look like shown below. After inspection, take a snapshot of the N-
gram window and paste it as an image in Paint for later use. Close the N-gram window.
_______________________________________________________________
_______________________________________________________________
Now, the encryption key that we have used in 2. is relatively weak. Let us assume that,
somehow, the adversary has learned all but the first four characters of the key.
5. For MysteryText_3DES.txt, select Analysis -> Symmetric Encryption (modern) -> Triple-
DEC (CBC). In the ‘Brute-Force Analysis of DEC (CBC)’ window enter ** ** AB CD 00 00 00
00 as the key (see below). Click Start.
_______________________________________________________________
7. Cancel the Brute-Force Analysis. This will generate a list of preliminary decryption results,
as shown below. The first of the enlisted results is readable. Click on Accept selection.
3. Digital Signatures using RSA [20 points]
RSA is one of the first practicable public-key (asymmetric) cryptosystems. It involves two
different types of keys: a public key and a private key. The public key can be known by
everyone and is used for encrypting messages. The messages encrypted with the public key
can only be decrypted in a reasonable amount of time using the private key. The RSA key
generation involves prime number manipulation.
In this part of the lab, you will create an RSA key-pair in Cryptool, and then use that key-pair to
sign and verify our MisteryText_decrypted.txt.
5. Back in the list of available asymmetric key pairs, click on Show Certificate to view Alice
Smith’s certificate.
6. Close both dialogs – Certificate Data and Available Asymmetric Key Pairs.
8. To obtain a more clear presentation, with the separation of the signature and the document,
click on Digital Signature/PKI -> Extract Signature. After inspection, close Extracted
Signature window.
9. To check that the signed MysteryText_decripted.txt has not been altered, select Digital
Signature/PKI -> Verify Signature. Select Smith Alice from the list of signatures and click on
the Verify Signature button. The following dialog appears.
10. Now, in the RSA (RIPEMD160) signature of <MysteryText_decrypted> window modify the
message by deleting the word fox. Select Signature/PKI -> Verify Signature. Select Smith
Alice from the list of signatures and click on Verify Signature button. A dialog box appears.
Symmetric encryption is generally much faster than asymmetric encryption. However, one of the
main challenges of symmetric encryption is a secure exchange of encryption keys.
With a combined symmetric-asymmetric encryption, we are able to achieve two important goals:
a) Fast encryption of the actual document/data that is to be sent; and
b) Secure delivery of the symmetric key, together with the encrypted document.
In this part of the lab, you will perform hybrid RSA-AES encryption of
MysteryText_encrypted.txt.
3. Click on Encrypt document symmetry, and then on Encrypted document. The encrypted
document (data block) will appear in the lower window.
4. Now, click on Select asymmetr, key. Select Bob RSA-512 key. Click OK.
6. Back in the visualization window, click on Encrypt session key asymmetry., and then on
Encrypted session key.
In the Windows Explorer, browse to the folder C:\3482\Lab3\Part4. Open Secret.hex. This
document contains a message encrypted with hybrid RSA-AES encryption, using Bob’s public
key (PIN: 1234). Extract the actual content of the message from the given file and write it below:
_____________________________________________________________________