Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

INSC 615 – Network Security and Perimeter Protection

Lab 1
“Secret-Key Encryption Lab”

Name:
Student ID:
Professor:
TA:
Introduction

This lab will help us to understand and gain the first-hand experience on symmetric encryption,
encryption algorithm and encryption modes. Practising to encrypt/decrypt messages. Since long time
ago messages have been encrypting to keep the secrecy or confidentiality of the information. With the
pass of the years and the rising of the new technologies, it is necessary that encryption methods evolve
because the attackers capture the messages and try to decrypt. Then the only way to protect the
information is make the codes more difficult to decrypt.

Summary

This lab consist in three task as follows:

 Task 1: Frequently Analysis, discover the plain-text base on a cipher text using the
replacement of the well know letters and the frequency they repeat.

 Task 2: Encryption using Different Ciphers and Modes, with openssl tool I will try to
encrypt in different ciphers and then decrypt back

 Task 3: Encryption Mode – ECB vs. CBC, I will encrypt a picture and modify the
header to see what happened with the picture.
Task 1:Frequency Analysis

First I will change the cipher text to know how we can modified through “tr command” from
lower letter to uppercase and see we can cipher a then decrypt back. Then I will try to discover the
article using the frequency analysis where we go changing the letter which more appears. The lab is in
VM with Linuz Ubuntu 20.04 (Seed image).

Figure 1 Commands used and file created

Figure 2 cipher-text, and cipher-text modified (Uppercase)


Now I will try to decrypt the cipher-text with the method of frequency
analysis, which take the advantage of the letters that appears many times, I will
use the recommended web http://www.richkni.co.uk/php/crypta/freq.php to analyze the
cipher-text.

Figure 3 Frequency analysis tool (web page)

Finally guessing the letter which repeat more I get the Key Encription.

Figure 4 The Encryption Key

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
r g a p n b v t m o s i c u x e j h q y z f l k d w

Now I will decrypt the cipher-text with the key encryption.


Figur
e5
The Encryption Key

$ tr ‘vgapnbrtmosicuxejhqyzflkdw’ ‘abcdefghijklmnopqrstuvwxyz’ < ciphertext > plaintext-article.txt

The Article is about Oscar academy award.

Figure 6 The text can be read after decryption

Task 2: Encryption using Different Ciphers and Modes


In this task I use 4 different types of ciphers which are:

1. rc2-64-cbc
2. des-ede3-cbc
3. aes-128-cbc
4. aes-256-cbc

Figure 7 command line to cipher in different types of encryption

After the encryption the generated file can NOT be read, and the only way to recover the file is with the
key (password). Now I will perform the deception of the files, and create new plain-text files to
compare with the originals.
Figure 7 command line to decrypt in different types of encryption

The files after the encryption can’t be read and then when it is decrypted. It can be read again, as the
original file.

Figure 8 files before, during


and after the encription
Task 3: Encryption Mode – ECB vs. CBC.
The picture was encrypted with 2 different modes ECB (Electronic Code Book) and CBC
(Cipher Block Chaning). Then I crop and paste the header of the original picture with the body of the
encrypted files to see what happens.

Figure 9 Commands to encrypt the picture with different modes and command to create a new picture
from the encrypted file that can be viewed to compare with the original.

I can see that the picture that was encripted with ECB still can show the picture even if it is
encripted, but the picure that was encripted with CBC can NOT be see.

Figure 10 : Original Picture


Figure 11: Picture encrypted by CBC Figure 12: Picture Encrypted by ECB

Conclusion

We could observe that not all the cipher methods are similar and even if they encrypt at 128
bits, the information can be restore in some way, then we have to be careful and look for the right
encryption mode that assure our information or data will not see by others who are not authorize.

Reference

Tool to find the key encryption


http://www.richkni.co.uk/php/crypta/letreplace.php

Seed Lab 2.0


https://seedsecuritylabs.org/Labs_20.04/Crypto/Crypto_Encryption

You might also like