https://github.com/cr2007/f20cn-cw1
Coursework on Vigenere Cipher and Known-Plaintext Attack
https://github.com/cr2007/f20cn-cw1
computer-network-security key-length openssl plaintext-attack python shell-scripting streamlit symmetric-cipher vigenere-cipher
Last synced: 7 months ago
JSON representation
Coursework on Vigenere Cipher and Known-Plaintext Attack
- Host: GitHub
- URL: https://github.com/cr2007/f20cn-cw1
- Owner: cr2007
- Created: 2023-10-23T17:42:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-09T12:21:51.000Z (7 months ago)
- Last Synced: 2025-03-09T13:25:32.970Z (7 months ago)
- Topics: computer-network-security, key-length, openssl, plaintext-attack, python, shell-scripting, streamlit, symmetric-cipher, vigenere-cipher
- Language: Typst
- Homepage: https://cr2007.github.io/f20cn-cw1-web/
- Size: 201 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Computer Network Security (F20CN)
[](https://codespaces.new/cr2007/F20CN-CW1)
[](https://f20cn-cw1.streamlit.app)
![]()
![]()
## Coursework 1
This repository contains the code and report for Coursework 1. The coursework consists of 2 tasks related to cryptography and network security.
### Task 1: Verifying Key Length Guesses: Vigenere Cipher
This task is written in Python and implements a function that guesses the key length of a ciphertext encrypted with the Vigenere cipher.
Tasks:
- [X] Write a Python program
- [X] Input a ciphertext (encrypted with a Vigenere cipher) and guess of one or more possible key lengths
- [X] Output
- [X] Value of the Index of Coincidence (IC) for each key length guess
- [X] 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
- [X] Testing
- [X] Find a plaintext example of English text (at least 1000 words in length)
- [X] 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
- [X] The results for the key length guesses should be 4, 5, and 6.IC formula
$$
IC = \frac{\sum_{i=1}^{26}f_i * (f_i-1)}{L * (L-1)}
$$where $f_i$ is the frequency of the $i^{\text{th}}$ letter of the alphabet in the column, and $L$ is the total number of letters in the column.
Note that $IC_{\text{english}} \approx 0.0686$.### Task 2: Verifying Key Length Guesses: Substitution Cipher
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