ITN260 Lab 3 FA22

doc

School

Tidewater Community College *

*We aren’t endorsed by this school

Course

260

Subject

Computer Science

Date

Feb 20, 2024

Type

doc

Pages

4

Uploaded by DeaconGerbil2297

Report
ITN 260 Lab 3 All screen prints should be pasted into the Word document. Format your answers in blue. When completed submit the file under the appropriate link in Canvas before the due date. I. History of Cryptography 1. Encrypt the message “Cyber Rocks” with the ATBASH cipher. 2. Encrypt the message “Professor Perez is the best” with the Caesar cipher. Tell me what key you are using and in which direction. 3. Encrypt the original text using the Vigenere cipher from the using the key COMPUTE: Encryptionisawesome II. Symmetric Encryption with ccrypt From you Cyber Range course, select the Environment: Kali Linux and Vulnerable Windows 7 (2022.9) and start the Primary Machine. environment. Click “start” to start your environment and “join” to get to your Linux desktop login. If necessary, enter login credentials: Username: student Password: student Ccrypt is a symmetric file and stream encryption utility for Linux and Unix that replaces the weaker bcrypt utility. Ccrypt uses the Rijndael cipher, which is the algorithm on which the Advanced Encryption Standard (AES) is based. Ccrypt is not installed by default on your Ubuntu Linux virtual machine. Open a terminal and use the Linux package manager to install this software at the command line as follows. $ sudo apt-get update [you may be prompted for your ‘sudo password’. On you Virginia Cyber Range Ubuntu Linux VM it is your student account password. Probably ‘student’.] Paste screenshot here. $ sudo apt-get install ccrypt Paste screenshot here. To see all of the command-line options available to ccrypt, use the following command: $ ccrypt --help
Paste screenshot here. Next we need a file to encrypt. You can download a text file from the Cyber Range using the command below, or you can create a text file using a text editor on your Linux virtual machine (“Mousepad” on your Ubuntu Linux virtual machine) and save it in your home directory. $ wget artifacts.virginiacyberrange.net/gencyber/textfile1.txt Paste screenshot here. You can examine the contents of the file using the Linux ‘cat’ utility as follows. $ cat textfile1.txt Paste screenshot here. Use ccrypt to encrypt your textfile. Ccrypt will ask for an encryption key –type in passphrase at the command line (you will use the same passphrase to decrypt the file) You will NOT see the cursor move, but you are entering it in. The program will prompt you to type in the encryption key again (type in passphrase). Be sure that you are in the directory location as your text file and encrypt it as follows. The ‘-e’ option is used to specify encryption rather than decryption. $ ccrypt -e textfile1.txt Paste screenshot here. If you list your directory you should see textfile1.txt.cpt – the encrypted version of the file replaced the plaintext version. Use the linux ‘cat’ utility to view the file. It should be unintelligible. $ cat textfile1.txt.cpt Paste screenshot here. You could now send this file to someone else and as long as they have the passphrase, they can decrypt and read it. Note that the file textfile1.txt is gone. Don’t forget your encryption key if you want this file back! Use ccrypt with the –d switch to decrypt your file. Be sure to use the same passphrase as in step 3, above. $ ccrypt –d textfile1.txt.cpt Paste screenshot here. Your unencrypted file should be restored to textfile1.txt (use ‘ cat’ to be sure). Task 2: Asymmetric Encryption using Gnu Privacy Guard (gpg) Asymmetric encryption using Gnu Privacy Guard (gpg), an open-source implementation of Pretty-Good Privacy (pgp). Gpg is included in your Kali Linux VM so we don’t need to install anything. Below we will take basic steps to create a public/private key pair, then encrypt a file using our own public key and decrypt it using our own private key. There are lots more features and options, however. Review the man page for the gpg utility for more details.
1. First we have to create an encryption key $ gpg –-gen-key Paste screenshot here. Depending on your system, you You may be prompted for a key type (this is used to select the encryption algorithm for the keys). The default is RSA, simply press enter to accept the default. Next you may be prompted for a key length. 2048 bits is the default and is generally accepted to be sufficiently long (although if you need your data to stay secret well into the future you can select 4096). Press enter to accept the default key length of 2048. Next you may be prompted for your key expiration. Press enter to accept the default (key never expires). When asked ‘are you sure’, enter ‘y’ and press enter. Use any name you want, but remember it (must be at least 5 characters). Enter your VCCS email address (and remember what you entered!). Then type O for Okay . You can enter a passphrase for your key if you would like, or you can leave the passphrase blank and just press enter. If you enter a passphrase, be sure to remember it for later. Once complete, you should get output listing a public key fingerprint and some other data. 2. Download (or create) a second textfile. $ wget artifacts.virginiacyberrange.net/gencyber/textfile2.txt Paste screenshot here. 3. Now we’ll encrypt the file using our public key. Be sure you are in the same directory as your new text file and encrypt it as follows. Use your VCCS email address you used above. $ gpg –e –r your-email-address textfile2.txt Paste screenshot here. A new file will be added with a .gpg extension. Use ‘ cat’ to examine the file. It should be unreadable. 4. Use gpg to decrypt the file using your private key (delete the old file first). $ rm textfile2.txt $ gpg -d textfile2.txt.gpg Paste screenshot here. Your unencrypted file should be restored! 5. Now that you know that your key works for encryption and decryption, you can share your public key with others so that they can encrypt files to be decrypted with your private key. Use the following syntax to export your key to a text file. $ gpg --export -a your-email-address > public.key
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Paste screenshot here. Examine the key using ‘ cat’ . The ‘ -a ’ flag has the key encoded in ascii (text). Some people append a text version of their public key to their email signatures, making is easy for others to use to encrypt files and send to them. $ cat public.key Paste screenshot here. From here, you could share your public key with others at a key-signing party, upload it to a key server, or otherwise make it available for others to use to encrypt documents that only you can decrypt.