{"id":21214594,"url":"https://github.com/cr2007/f20cn-cw1","last_synced_at":"2026-04-28T19:35:39.162Z","repository":{"id":216629947,"uuid":"708944312","full_name":"cr2007/F20CN-CW1","owner":"cr2007","description":"Coursework on Vigenere Cipher and Known-Plaintext Attack","archived":false,"fork":false,"pushed_at":"2025-03-09T12:21:51.000Z","size":206,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T13:25:32.970Z","etag":null,"topics":["computer-network-security","key-length","openssl","plaintext-attack","python","shell-scripting","streamlit","symmetric-cipher","vigenere-cipher"],"latest_commit_sha":null,"homepage":"https://cr2007.github.io/f20cn-cw1-web/","language":"Typst","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cr2007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-23T17:42:03.000Z","updated_at":"2025-03-09T12:21:56.000Z","dependencies_parsed_at":"2024-01-14T05:55:39.590Z","dependency_job_id":"fd521406-0d2b-4639-9b0c-2936c6808564","html_url":"https://github.com/cr2007/F20CN-CW1","commit_stats":null,"previous_names":["cr2007/f20cn-cw1"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr2007%2FF20CN-CW1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr2007%2FF20CN-CW1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr2007%2FF20CN-CW1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr2007%2FF20CN-CW1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cr2007","download_url":"https://codeload.github.com/cr2007/F20CN-CW1/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663752,"owners_count":20327339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-network-security","key-length","openssl","plaintext-attack","python","shell-scripting","streamlit","symmetric-cipher","vigenere-cipher"],"created_at":"2024-11-20T21:28:36.596Z","updated_at":"2025-12-29T19:08:05.112Z","avatar_url":"https://github.com/cr2007.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Computer Network Security (F20CN)\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/cr2007/F20CN-CW1)\n\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://f20cn-cw1.streamlit.app)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"Python\" title=\"Python Programming Language\" src=\"https://img.shields.io/badge/Python-informational?style=flat-sqaure\u0026logo=python\u0026logoColor=white\u0026color=3776ab\"\u003e\n  \u003cimg alt=\"Bash\" title=\"Bourne Again SHell\" src=\"https://img.shields.io/badge/Bash-informational?style=flat-sqaure\u0026logo=gnubash\u0026logoColor=white\u0026color=4EAA25\"\u003e\n\u003c/div\u003e\n\n## Coursework 1\n\nThis repository contains the code and report for Coursework 1. The coursework consists of 2 tasks related to cryptography and network security.\n\n### Task 1: Verifying Key Length Guesses: Vigenere Cipher\n\nThis task is written in Python and implements a function that guesses the key length of a ciphertext encrypted with the Vigenere cipher.\n\nTasks:\n- [X] Write a Python program\n  - [X] Input a ciphertext (encrypted with a Vigenere cipher) and guess of one or more possible key lengths\n  - [X] Output\n    - [X] Value of the Index of Coincidence (IC) for each key length guess\n    - [X] Indication of which key length guess is most likely to be correct\n      - This will be the key length guess where the IC value is closest to the known value of the IC for English language\ntext\n- [X] Testing\n  - [X] Find a plaintext example of English text (at least 1000 words in length)\n  - [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\n  - [X] The results for the key length guesses should be 4, 5, and 6.\n\nIC formula\n\n$$\nIC = \\frac{\\sum_{i=1}^{26}f_i * (f_i-1)}{L * (L-1)}\n$$\n\nwhere $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.\u003cbr\u003e\nNote that $IC_{\\text{english}} \\approx 0.0686$.\n\n### Task 2: Verifying Key Length Guesses: Substitution Cipher\n\nTasks:\n\n- [ ] Write a Shell Script\n  - [ ] Find the\n    - [ ] Password\n    - [ ] Remainder of the plaintext\n  - [ ] Call the `openssl` command and check the resulting file\n  - [ ] Create a loop to read each line and use it as a password? In bash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr2007%2Ff20cn-cw1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcr2007%2Ff20cn-cw1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr2007%2Ff20cn-cw1/lists"}