Homework 1, part 3

Due date: 17 October 2022 at 11:59pm MST

Homework 1 has three parts, this is the third one. It has two questions, (a) and (b), worth 20 and 10 points, respectively, for 30/100 total.

Notes

This is an individual assignment. DO NOT share your solution with others or use solutions from others. You may have high-level discussions with your classmates about it, and you may use/share any source code that existed before the assignment was assigned and is not related to any similar assignment or any past offering of CSE 468 or a related class at ASU. You may use any source code I provided for lecture purposes at any time.

Preparation: Downloading your tarball

Start by “ratcheting” your MD5 token from homework 1.1 to find out the name of your tar ball. Do the following:

echo -n "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN" | md5sum | cut -c 1-32

But replace “NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN” with your MD5 token. The output of the above command will tell you which tar ball here is yours. Just add “.tgz” to the end of your ratcheted MD5 token. Download and it decrypt it like this, using your original MD5 token as the password:

openssl aes-256-cbc -md sha256 -d -in NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.enc -out /tmp/mytarball.tgz

You should be able to perform the above command on general.asu.edu or any Linux system. Then you can copy your plaintext tarball for the assignment out of /tmp/ and decompress/untar it wherever you plan to do your homework (the entire assignment can be done on general.asu.edu). Some students had problems for homework 1.2 using /tmp on general.asu.edu, just remove that part and it’ll put it in your current directory instead.

Do not share your tarball, MD5 token, tarball name, or anything that identifies you or your assignment in this way with others.

Homework 1, part 3, question (a)

20 out of 100 points

In your tar ball, you’ll find a text file called “eavesdrop.txt” that was generated using this python script using a command that was something like this:

cat /usr/share/dict/american-english | grep "^S.*" | python3 rc4hw13a.py | grep -v FIRSTBYTEOFKEY > eavesdrop.txt

Find the first byte of the key, or the most likely first byte of the key (I culled out instances where the most likely first byte was not the actual first byte, so these are effectively the same thing). Try to submit your answer as a hexidecimal byte in exactly the format that would have appeared in the FIRSTBYTEOFKEY line (just the byte, not the “FIRSTBYTEOFKEY” part), but I’ll try to write the grading script so that you’re in good shape as long as you submit the correct byte as a hexadecimal number.

Homework 1, part 3, question (b)

10 out of 100 points

In your tar ball, you’ll find a text file called “hw13partb.txt” that was generated using this python script, this one, and this one using a command that was something like this:

(python3 sixdigits.py ; python3 slides.py) | python3 rc4hw13b.py > hw13partb.txt

The answer you submit for this part should be the random six digit number that was generated by sixdigits.py when I did that, that corresponds to your ciphertext in your tar ball.

How to submit

You will copy and paste your answers into the Google form, no need to upload files. The Google Forms link will be provided in Piazza, note that every assignment will have a different Google Forms link to use. Try to avoid including any whitespace or newline characters, but the grading script should do a good job of removing them anyway. Both plaintexts you submit should be printable ASCII. Your part (a) answer should be a hex byte (like “0xb” or “0x3f” or “0x44”), and your part (b) answer should be a six digit number (like “048313” or “439712”).