Cyber RangeCrypto and Block Cipher Mode
Hopefully, this will give a nice visual illustration of how Electronic codebook (ECB) and Cipher-block chaining (CBC) work using AES-128 and OpenSSL. You can learn a lot from a known plain text, and repeating patterns.
Grading Submission Report. Provide screen captures with time stamps and answer my questions. Points will be deducted if you fail to follow the instructions below.
Setup/Required Resources: Use Virginia Cyber Range Kali Linux Machine for this AssignmentFollow the Assignment Instruction From Here (crypto assignment instructions document attached)01 Download the tux.bmp image from below (right-click and save the file to your computer and upload to your Cyber Range VM) 02 Download Instruction From Here: (How to upload files to your Virginia Cyber Range Kali Linux VM document attached)This assignment requires you to submit screenshots of completed steps to ensure you understand the content. How to upload files to your Virginia Cyber Range Kali Linux VM
To open the side-panel within your exercise environment, press Ctrl+Alt+Shift (if
you are using a Mac, you can try Shift + Ctrl + Cmd). You will then be able to see
your Clipboard, a button with your “devices”, and other keyboard/mouse options
below. A screenshot of this view is shown below. Browse to the home directory,
select account “student” and Select Desktop directory. Save the file under your
user profile Desktop (/home/student/Desktop).
Press Ctrl+Alt+Shift (if you are using a Mac, you can try Shift + Ctrl + Cmd) again
when you are done. The download file from your computer should be on your
Desktop.
From your Desktop directory, type “ls” to verify the file uploaded okay.
Crypto & Block Cipher Modes
(OpenSSL, AES 128, ECB, CBC)
Hopefully this will give a nice visual illustration of how Electronic codebook (ECB) and Cipher-block chaining
(CBC) work using AES-128 and OpenSSL. You can learn a lot from a known plain text, and repeating patterns.
Grading Submission Report: Provide screen captures with time stamps and answer the questions. Points will
be deducted if you fail to follow the instructions below.
Setup/Required Resources: Use Virginia Cyber Range Kali Linux Machine for this Assignment
Create two (2) files and name them “dawn.txt” and “noon.txt”
Use the command nano to create the files
nano dawn.txt
nano noon.txt
Note: You can used “Ctrl + X” to save from nano editor
Add the content below to the dawn.txt as the plaintext:
The attack will happen at dawn!
Love, itn262
Add the content below to the noon.txt as the plaintext:
The attack will happen at noon!
Love, itn262
using AES-ECB Encryption Command to Encrypt “dawn.txt” and “noon.txt” for comparison:
openssl enc -aes-128-ecb -e -in dawn.txt -out dawnciphered.txt -K 00112233445566778889aabbccddeeff
openssl enc -aes-128-ecb -e -in noon.txt -out noonciphered.txt -K 00112233445566778889aabbccddeeff
note: -e for encrypt, -K for Key
note: -in for input file to be encrypted, -out for saving and name encrypted or ciptertext
View the Encrypted/Ciphertext of both “dawncipthered.txt” and
“nooncipthered.txt” using the “cat” commands
cat dawnciphered.txt
cat noonciphered.txt
**cat is use to view/display file content
Convert the Encrypted/Ciphertext of both “dawncipthered.txt” and
“nooncipthered.txt” using the “hexdump” command so you can analyze the files
hexdump dawnciphered.txt
hexdump noonciphered.txt
**hexdump is use to convert content to hex values
Question: Review and compare both ciphertext and provide feedback. What is different
Let us repeat using this process with an image
Download the image “tux.bmp” from canvas and upload to your CyberRange VM
Use the “ls -l” command to locate the size of the bitmap file (tux.bmp)
Save the first 54 Bytes of the bitmap header so we can use it later
head -c 54 tux.bmp > ecb.bmp
Applying the ECB Encryption to the image file
openssl enc -aes-128-ecb -e -in tux.bmp -out temp.bin -K 00112233445566778889aabbccddeeff
This command uses temp.bin file extracting 943754 Bytes (54B less than the original file tux.bmp file)
and append it to ecb.bmp
tail -c 943754 temp.bin >> ecb.bmp
Repeat for CBC Enryption by entering the following commands (CBC requires an Initialization Vector
(IV))
head -c 54 tux.bmp > cbc.bmp
openssl enc -aes-128-cbc -e -in tux.bmp -out temp.bin -K 00112233445566778889aabbccddeeff -iv
0102030405060708
tail -c 943754 temp.bin >> cbc.bmp
Question: Now, navigate to file manager. Locate the file in your home directory (/home/student/) and analyze
the ECB and CBC cipher images. Compare them to the original image (tux.bmp)
Provide feedback.