This repository contains the code and report for Coursework 1. The coursework consists of 2 tasks related to cryptography and network security.
This task is written in Python and implements a function that guesses the key length of a ciphertext encrypted with the Vigenere cipher.
Tasks:
- Write a Python program
- Input a ciphertext (encrypted with a Vigenere cipher) and guess of one or more possible key lengths
- Output
- Value of the Index of Coincidence (IC) for each key length guess
- Indication of which key length guess is most likely to be correct
- This will be the key length guess where the IC value is closest to the known value of the IC for English language text
- Testing
- Find a plaintext example of English text (at least 1000 words in length)
- Encrypt it with the Vigenere cipher at https://rumkin.com/tools/cipher/vigenere with the Cipher key equal to the first 5 characters of your surname
- The results for the key length guesses should be 4, 5, and 6.
IC formula
where
Note that
Tasks:
- Write a Shell Script
- Find the
- Password
- Remainder of the plaintext
- Call the
openssl
command and check the resulting file - Create a loop to read each line and use it as a password? In bash
- Find the