{"id":20553471,"url":"https://github.com/nvsriram/decipher","last_synced_at":"2025-03-06T06:19:12.605Z","repository":{"id":98030059,"uuid":"229137694","full_name":"nvsriram/DeCipher","owner":"nvsriram","description":"A user-friendly variable cipher with a catch*","archived":false,"fork":false,"pushed_at":"2019-12-20T06:48:22.000Z","size":502,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T17:30:04.070Z","etag":null,"topics":["caesar-cipher-algorithm","cipher","cipher-algorithms","dictionary","hashmap","spellchecker","vigenere-cipher"],"latest_commit_sha":null,"homepage":"","language":"C++","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/nvsriram.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":"2019-12-19T20:58:36.000Z","updated_at":"2023-04-30T05:13:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"158dfac2-0a9e-4db4-bc1d-67e0b9eaf10f","html_url":"https://github.com/nvsriram/DeCipher","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/nvsriram%2FDeCipher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvsriram%2FDeCipher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvsriram%2FDeCipher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvsriram%2FDeCipher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvsriram","download_url":"https://codeload.github.com/nvsriram/DeCipher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242157274,"owners_count":20081041,"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-algorithm","cipher","cipher-algorithms","dictionary","hashmap","spellchecker","vigenere-cipher"],"created_at":"2024-11-16T02:42:05.341Z","updated_at":"2025-03-06T06:19:12.559Z","avatar_url":"https://github.com/nvsriram.png","language":"C++","readme":"# DeCipher\n\u003cstrong\u003eDeCipher\u003c/strong\u003e is a user-friendly variable cipher with a \u003ci title = \"*wink wink*\"\u003ecatch\u003c/i\u003e.\n\n\u003cp\u003eThis will work on \u003ci\u003emost\u003c/i\u003e C++ IDEs. Just download the header files and add them all to the same folder as the .cpp file, compile and run! \u003cem\u003eNOTE: You may have to change library paths in order to read the \u003ccode\u003elarge.txt\u003c/code\u003e dictionary text file.\u003c/em\u003e \u003cbr\u003e\n  \u003ci\u003eP.S. You can replace the clearscreen.hpp and \u003ccode\u003eClearScreen()\u003c/code\u003e function header file with \u003ccode title=\"Not recommended\"\u003esystem(\"clear\");\u003c/code\u003e\u003ct\u003e,\u003ccode title=\"Also not recommended\"\u003esystem(\"cls\");\u003c/code\u003e,\u003ccode title=\"Recommended if you know to use it\"\u003e\u0026ltcurses.h\u0026gt\u003c/code\u003e library or any OS specific clear screen command. The \u003ccode\u003eClearScreen()\u003c/code\u003e function currently implements a \u003cq\u003eflush-endlines-till-it-exceeds-screen-dimensions\u003c/q\u003e approach to achieve the same result as any of the previously mentioned options.\u003c/i\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e \u003ccode\u003e\u0026ltasciiarmor.hpp\u0026gt\u003c/code\u003e, \u003ccode\u003e\u0026ltcaesar.hpp\u0026gt\u003c/code\u003e and \u003ccode\u003e\u0026ltvigenere.hpp\u0026gt\u003c/code\u003e header files correspond to their respective cipher and their implementation. It also defines a namespace that makes them easy to use. \u003ccode\u003e\u0026ltclearscreen.hpp\u0026gt\u003c/code\u003e header file defines one clear screen function that is used and two others that work based on the OS and included header files. \u003ccode\u003e\u0026ltdictionary.hpp\u0026gt\u003c/code\u003e header file implements the dictionary spellchecker by using the \u003ccode\u003elarge.txt\u003c/code\u003e text file as its source file for the dictionary.\u003cbr\u003e\n  \n  The program is very user-friendly and interactive. It starts by leading you to a pretty table of the various ciphers to choose from:\u003c/p\u003e\n\u003cdl\u003e\n  \u003cdt\u003eASCII armor\u003c/dt\u003e\n  \u003cdd\u003eASCII armor is a binary-to-textual encoding converter. ASCII armor is a feature of a type of encryption called pretty good privacy (PGP). In this you are asked to enter the plaintext(\u003ccode\u003estd::string\u003c/code\u003e) and a key(\u003ccode\u003elong int\u003c/code\u003e). The function then:    \n    \u003col\u003e\n      \u003cli\u003eCreates pseudo-random hashing key derived from the key\u003c/li\u003e\n      \u003cli\u003eUses the hashing key to encrypt the plaintext\u003c/li\u003e\n      \u003cli\u003eConverts to \u003ccode title=\"85 printable characters\"\u003eBase85\u003c/code\u003e to get a console-printable ciphertext\u003c/li\u003e\n    \u003c/ol\u003e\n    \n  The function also decodes said ciphertext and converts it back to plaintext. A good proof of execution of the program would have your initially entered plaintext match the decoded text.\n  \u003c/dd\u003e\n  \n  \u003cdt\u003eCaesar Cipher\u003c/dt\u003e\n  \u003cdd\u003eCaesar cipher is one of the earliest known and simplest ciphers. It is a type of replacement cipher in which each letter of the plaintext is 'moved' to a certain place under the alphabet. For example, with a shift of 1, A will be replaced by B, B becomes C, and so on until it cycles back to A. In this you are asked to enter the plaintext(\u003ccode\u003estd::string\u003c/code\u003e) and a \u003ci title=\"no negatives\"\u003ewhole\u003c/i\u003e number key(\u003ccode\u003estd::size_t\u003c/code\u003e). Based on the key, the program would perform one of the following:\n    \u003col\u003e\n      \u003cli\u003eIf they key is greater than 0, then treat the plaintext for what it is and perform the encryption and decryption shift based on the key\u003c/li\u003e\n      \u003cli\u003eIf the key is 0, then treat the plaintext as a ciphertext and perform decryption using \u003ci title=\"0, 1, ... 25\"\u003eevery possible key\u003c/i\u003e. Then perform the \u003cem title=\"Explained later\"\u003eBruteforce Dictionary\u003c/em\u003e to find the possible plaintexts.\u003c/li\u003e\n    \u003c/ol\u003e\n  \u003c/dd\u003e\n  \n  \u003cdt\u003eVigenère Cipher\u003c/dt\u003e\n  \u003cdd\u003eThe Vigenère cipher is a method of encrypting alphabetic text by using a series of interwoven Caesar ciphers, based on the letters of a keyword. It employs a form of polyalphabetic substitution. In this you are asked to enter the plaintext(\u003ccode\u003estd::string\u003c/code\u003e)and a alphabetic key(\u003ccode\u003estd::string\u003c/code\u003e). The program ignores case and assigns every alphabet to a shift value. For example, A/a is a shift of 0, B/b is a shift of 1 and so on. Based on the key, the function then:\n  \u003col\u003e\n    \u003cli\u003eShifts the first character of the plaintext by the shift determined by first character of the key. Second character will be shifted based on second character of key and so on.\u003c/li\u003e\n    \u003cli\u003eIf the key is longer than plaintext, it'll move until plaintext length and be shifted by the characters that come under that length of key. However, if the plaintext is longer than the key, then the key repeats until plaintext has reached its end.\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/dd\u003e\n\n\u003cdt\u003eBruteforce Dictionary\u003c/dt\u003e\n\u003cdd\u003eAlthough this is not a direct choice, it is an important part of the project. The Bruteforce Dictionary is used to implement a dictionary as a spellchecker to crack the plaintext for the Caesar cipher in this program but can be used for the other ciphers as well. This works as follows:\n  \u003col\u003e\n    \u003cli\u003eFirst the dictionary is loaded from the file into a hashtable dynamically indexed by the first letters of the word. Hence we get \u003ci title=\"A to Z\"\u003etwenty-six\u003c/i\u003e \u003cq\u003eheads\u003c/q\u003e for the linked lists.\u003c/li\u003e\n    \u003cli\u003eThen the inputted ciphertext is decoded with a key that loops from 0 to 25. This way we get every possible input for the given output.\u003c/li\u003e\n    \u003cli\u003eBased on the input at every iteration, it is checked with the linked list corresponding to the first letter of the input. If it is present, it is displayed along with the key corresponding to the result.\u003c/li\u003e\n  \u003c/ol\u003e\n  In this manner, we manage to arrive at the logical input corresponding to the given output using bruteforce.\n\u003c/dd\u003e\n\u003c/dl\u003e\u003c/p\u003e\n\u003cp\u003eJust enter your choice, follow the instructions, and you should be good to \u003ci title=\"Terms and conditions apply\"\u003ego\u003c/i\u003e!\u003cbr\u003e\nEnjoy!¯\\_(ツ)_/¯\u003c/p\u003e\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvsriram%2Fdecipher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvsriram%2Fdecipher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvsriram%2Fdecipher/lists"}