CSE 468 Computer Network Security

I want a written source code with explanation,

Part (a): Decrypting when you are given the key

n the tarball in the `withkey` directory, you’ll find five files:

1. `ciphertext.txt` – A ciphertext encrypted with a Caesar cipher.
2. `caesarkey.txt` – The key used for the Caesar cipher.
3. `juliaplaintext.txt.gz.enc` – A ciphertext encrypted as described below.
4. `juliakey.txt` – The key used for Julia’s cipher.
5. `sha512sums.txt` – sha512sums of the correct answers.

For each of the two ciphers, Ceasar’s and Julia’s, you’ll need to write some code so you can plug in the key and decrypt (and then also decompress if necessary). You’ll submit two different plaintexts, one for each cipher, for part 1. In the `src/` directory `cse365encrypt.py` is the code that was used for encrypting both ciphertexts.

For the Caesar cipher, the alphabet for the plaintext and ciphertext is the capital letters [A-Z], and the key is a number between 0 and 25.

For Julia’s cipher, the crypto algorithm is:

“`
enc_char = bit_rotate(plain_char, N) xor key_byte
“`

where `N` is a fixed integer, and `key_byte` is a byte of the key. If the key is shorter than the length of the file, the key will be used again for xor from the beginning. Julia’s cipher works on binary files, so basically raw bytes. I need THE TWO PLAINTEXTS AS TWO OF FOUR TEXT BOXES. They should both be ASCII-encoded English text. In some cases there may be some extra steps after decryption before you get to English text.After completing this part you should be confident with dealing with files and basic calculations in Python, and familiar with the two cryptosystems (that you’ll be using in the next part, as well).

Part (b): Decrypting when you are not given the key, i.e., cryptanalysis

In the tarball in the `withoutkey` directory, you’ll find three files:

1. `ciphertext.txt` – A ciphertext encrypted with a Caesar cipher.
2. `secretfile.txt.gz.enc` – A ciphertext encrypted with Julia’s cipher, as
described in Homework 1.2.
3. `sha512sums.txt` – sha512sums of the correct answers.

This time you are not provided with any keys. Use the techniques discussed in class to mount ciphertext-only attacks on both of these ciphertexts. Note that Julia’s cipher is not the same as a Vigenere cipher. You’ll need to use the basic insights you learned, but the specifics from the slides won’t be exactly what you’re doing. I need THE TWO PLAINTEXTS AS TWO OF FOUR TEXT BOXES. They should both be ASCII-encoded English
text.

Finally:

1- Put the plaintext from part (a) Caesar cipher here:

2- Put the plaintext from part (a) Julia cipher here:

3- Put the plaintext from part (b) Caesar cipher here:

4- Put the plaintext from part (b) Julia cipher here:

with explanation please

*** I will upload a file calls digitalartifacts3 that you will use to do the work**