{"id":20300023,"url":"https://github.com/empobla/simpleciphers","last_synced_at":"2026-05-09T11:41:22.528Z","repository":{"id":86605344,"uuid":"348223857","full_name":"empobla/simpleCiphers","owner":"empobla","description":"Simple cipher contains simple implementations of cryptography and cryptoanalysis on Caesar's Cipher, Vigenere's Cipher, and One Time Pads.","archived":false,"fork":false,"pushed_at":"2023-01-26T10:10:10.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T10:35:34.041Z","etag":null,"topics":["caesar-cipher","ciphering","deciphering","one-time-pad","vigenere-cipher"],"latest_commit_sha":null,"homepage":"","language":"Python","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/empobla.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":"2021-03-16T05:21:38.000Z","updated_at":"2023-01-28T04:47:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"0eacad23-df88-4c45-826d-b2189c613551","html_url":"https://github.com/empobla/simpleCiphers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empobla%2FsimpleCiphers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empobla%2FsimpleCiphers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empobla%2FsimpleCiphers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empobla%2FsimpleCiphers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/empobla","download_url":"https://codeload.github.com/empobla/simpleCiphers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241795066,"owners_count":20021387,"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":["caesar-cipher","ciphering","deciphering","one-time-pad","vigenere-cipher"],"created_at":"2024-11-14T16:17:14.452Z","updated_at":"2026-05-09T11:41:17.503Z","avatar_url":"https://github.com/empobla.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\r\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\r\n\u003c!--\r\n*** Thanks for checking out the Best-README-Template. If you have a suggestion\r\n*** that would make this better, please fork the repo and create a pull request\r\n*** or simply open an issue with the tag \"enhancement\".\r\n*** Don't forget to give the project a star!\r\n*** Thanks again! Now go create something AMAZING! :D\r\n--\u003e\r\n\r\n\r\n\r\n\u003c!-- PROJECT SHIELDS --\u003e\r\n\u003c!--\r\n*** I'm using markdown \"reference style\" links for readability.\r\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\r\n*** See the bottom of this document for the declaration of the reference variables\r\n*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.\r\n*** https://www.markdownguide.org/basic-syntax/#reference-style-links\r\n--\u003e\r\n[![LinkedIn][linkedin-shield]][linkedin-url]\r\n\r\n\r\n\r\n\u003c!-- PROJECT LOGO --\u003e\r\n\u003cbr /\u003e\r\n\u003cdiv align=\"center\"\u003e\r\n\u003ch3 align=\"center\"\u003eSimple Ciphers\u003c/h3\u003e\r\n\r\n  \u003cp align=\"center\"\u003e\r\n    Simple implementations of cryptography and cryptoanalysis on Caesar's Cipher, Vigenere's Cipher, and One Time Pads.\r\n    \u003cbr /\u003e\r\n    \u003cbr /\u003e\r\n  \u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n\r\n\r\n\u003c!-- TABLE OF CONTENTS --\u003e\r\n\u003cdetails\u003e\r\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\r\n  \u003col\u003e\r\n    \u003cli\u003e\r\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\r\n      \u003cul\u003e\r\n        \u003cli\u003e\u003ca href=\"#caesars-cipher\"\u003eCaesar's Cipher\u003c/a\u003e\u003c/li\u003e\r\n        \u003cli\u003e\u003ca href=\"#vigeneres-cipher\"\u003eVigenere's Cipher\u003c/a\u003e\u003c/li\u003e\r\n        \u003cli\u003e\u003ca href=\"#one-time-pad\"\u003eOne Time Pad\u003c/a\u003e\u003c/li\u003e\r\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\r\n      \u003c/ul\u003e\r\n    \u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#abilities-mastered\"\u003eAbilities Mastered\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\r\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\r\n      \u003cul\u003e\r\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\r\n      \u003c/ul\u003e\r\n    \u003c/li\u003e\r\n    \u003cli\u003e\r\n      \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\r\n      \u003cul\u003e\r\n        \u003cli\u003e\u003ca href=\"#caesars-cipher-script\"\u003eCaesar's Cipher Script\u003c/a\u003e\u003c/li\u003e  \r\n        \u003cli\u003e\u003ca href=\"#vigeneres-cipher-script\"\u003eVigenere's Cipher Script\u003c/a\u003e\u003c/li\u003e  \r\n        \u003cli\u003e\u003ca href=\"#one-time-pad-script\"\u003eOne Time Pad Script\u003c/a\u003e\u003c/li\u003e  \r\n      \u003c/ul\u003e\r\n    \u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\r\n  \u003c/ol\u003e\r\n\u003c/details\u003e\r\n\r\n\r\n\r\n\u003c!-- ABOUT THE PROJECT --\u003e\r\n## About The Project\r\n\r\nSimple cipher contains simple implementations of cryptography and cryptoanalysis on Caesar's Cipher, Vigenere's Cipher, and One Time Pads.\r\n\r\nAll three programs use the following alphabet: `'abcdefghijklmnopqrstuvwxyz '`.\r\n\r\n`caesar.py` and `vigenere.py` both assume that the ciphertext is in english and use the following 5 words to cryptoanalyse and decipher a ciphertext with an unknown key:\r\n```\r\n[' the ', ' be ', ' to ', ' of ', ' and ']\r\n```\r\n\u003e A list of 100 words that occur most frequently in written English is given below, based on an analysis of the Oxford English Corpus. \r\n[Source](https://en.wikipedia.org/wiki/Most_common_words_in_English)\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n### Caesar's Cipher\r\n`caesar.py` can cipher a user's input plaintext with a given key, decipher a user's input ciphertext with a known given key, and find an unknown key for an input ciphertext ciphered with caesar's cipher (in this case the ciphertext is input as a `.txt` file in `./input` and chosen in the CLI).\r\n\r\nThe approach taken to cryptoanalyse and decipher an ciphertext with an unknown key is to assume that `' '` is one of the most occurrent characters in the ciphertext and proceeding to find the top most occurrent characters in the ciphertext.\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n### Vigenere's Cipher\r\n`vigenere.py` can cipher a user's input plaintext with a given key, decipher a user's input ciphertext with a known given key, and find an unknown key for an input ciphertext (in this case the ciphertext is input as a `.txt` file in `./input` and chosen in the CLI).\r\n\r\n**Note:** `vigenere.py` is made only to find unknown keys that are 4 characters in length and it assumes that the ciphertext is in english.\r\n\r\nWhen finding an unknown key for an input ciphertext, `vigenere.py` assumes that the original unknown plaintext has the following alphabet: `'abcdefghijklmnopqrstuvwxyz '` and does not contain line breaks or any other characters not included in the alphabet. It finds the unknown ciphertext through the following steps:\r\n\r\n1. Divides the ciphertext's characters into 4 groups (`'hello world'` would be divided into `[ ['h','o','r'],['e', ' ', 'l'],['l','w','d'],['l','o']`).\r\n2. Finds the top 4 most occurrent characters in each group.\r\n3. Assuming `' '` is one of the top 4 most occurrent characters in each group, it finds the appropriate shifts for each characacter of the top 4 most occurrent characters per group.\r\n4. Generates all the possible 4 lettered keys that the ciphertext could have (256 possible keys).\r\n5. Uses 4 threads that each decipher the text with 64 possible keys and count the number of appearances of the top 5 most common words in the english language (the, be, to, of, and), and each returns the key which had the most total matches of these substrings.\r\n6. Asks the user to pick one of the top 4 most possible plain texts and outputs the plaintext and key to a `.txt` file.\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n### One Time Pad\r\n`onetimepad.py` will cipher a user's input plaintext with a randomly generated key which is the length of the user's input plaintext, and given the key and the ciphertext, it can decipher the ciphertext back into a plain text. \r\n\r\nThis program uses the function `vigenere(text, key, cipher)` and the only thing it does differently from `vigenere.py` is that it generates a completely random key which it inputs into that function to cipher the plaintext. `onetimepad.py` also uses the same function to decipher the given ciphertext with a given key.\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n### Built With\r\n\r\n[![Python][Python]][Python-url]\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- ABILITIES MASTERED --\u003e\r\n## Abilities Mastered\r\n\r\n* Enciphering and Deciphering a plaintext/ciphertext with a key using Caesar's Cipher, Vigenere's Cipher, and a One Time Pad\r\n* Implementation of Caesar's Cipher, Vigenere's Cipher, and One Time Pad\r\n* Decipher through cryptoanalysis a ciphertext with an unknown key enciphered with Caesar's Cipher or Vigenere's Cipher\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- GETTING STARTED --\u003e\r\n## Getting Started\r\n\r\nTo get a local copy up and running follow these simple example steps.\r\n\r\n### Installation\r\n\r\n1. Clone the repo\r\n   ```sh\r\n   git clone https://github.com/empobla/simpleCiphers.git\r\n   ```\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- USAGE EXAMPLES --\u003e\r\n## Usage\r\n\r\n### Caesar's Cipher Script\r\nWith this script, you can: \r\n1. Cipher a message with a key\r\n2. Decipher a message with a key\r\n3. Decrypt a message in a file. \r\n\r\nIn order to decrypt a message in a file, you must save the file as a `.txt` in the `input/` directory. The output of the decrypted file will be found in `outputs/original_file_name.txt`, with the key of the cipher and the decrypted message.\r\n\r\nIn order to run this script, follow the following instructions:\r\n\r\n1. `cd` into the project's directory\r\n   ```sh\r\n   cd simpleCiphers\r\n   ```\r\n2. Run `caesar.py`\r\n   ```sh\r\n   python caesar.py\r\n   ```\r\n\r\n### Vigenere's Cipher Script\r\nWith this script, you can: \r\n1. Cipher a message with a key\r\n2. Decipher a message with a key\r\n3. Decrypt a message in a file. \r\n\r\nIn order to decrypt a message in a file, you must save the file as a `.txt` in the `input/` directory. The script will then analyze the ciphertext and will find possible keys that decipher the given text. After chosing the key that deciphers the ciphertext, the script will output the plain text as an output file. The output of the decrypted file will be found in `outputs/original_file_name.txt`, with the key of the cipher and the decrypted message.\r\n\r\nIn order to run this script, follow the following instructions:\r\n\r\n1. `cd` into the project's directory\r\n   ```sh\r\n   cd simpleCiphers\r\n   ```\r\n2. Run `vigenere.py`\r\n   ```sh\r\n   python vigenere.py\r\n   ```\r\n\r\n### One Time Pad Script\r\nWith this script, you can: \r\n1. Cipher a message\r\n2. Decipher a message\r\n\r\nWhen enciphering a plaintext message with this script, the script will create a One Time Pad, encipher the plaintext message, and output the ciphertext and the key to the console. These outputs can be used with this script's second option, which will decipher the message.\r\n\r\nIn order to run this script, follow the following instructions:\r\n\r\n1. `cd` into the project's directory\r\n   ```sh\r\n   cd simpleCiphers\r\n   ```\r\n2. Run `onetimepad.py`\r\n   ```sh\r\n   python onetimepad.py\r\n   ```\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- LICENSE --\u003e\r\n## License\r\n\r\nThis project is property of Emilio Popovits Blake. All rights are reserved. Modification or redistribution of this code must have _explicit_ consent from the owner.\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- CONTACT --\u003e\r\n## Contact\r\n\r\nEmilio Popovits Blake - [Contact](https://emilioppv.com/contact)\r\n\r\nProject Link: [https://github.com/empobla/simpleCiphers](https://github.com/empobla/simpleCiphers)\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- ACKNOWLEDGMENTS --\u003e\r\n## Acknowledgments\r\n\r\n* [Most common words in english](https://en.wikipedia.org/wiki/Most_common_words_in_English)\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\r\n\r\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\r\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\r\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\r\n[linkedin-url]: https://linkedin.com/in/emilio-popovits\r\n\r\n[Python]: https://img.shields.io/badge/python-3776ab?style=for-the-badge\u0026logo=python\u0026logoColor=ffdc52\r\n[Python-url]: https://www.python.org/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fempobla%2Fsimpleciphers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fempobla%2Fsimpleciphers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fempobla%2Fsimpleciphers/lists"}