This project implements a Shift Cipher Decrypter with a web-based user interface. It uses Python for the backend logic and HTML/CSS/JavaScript for the frontend.
- Decrypts shift ciphers (Caesar ciphers) automatically
- Uses letter frequency analysis for efficient decryption
- Validates decrypted words using an external dictionary API
- Provides a user-friendly web interface
- Supports drag-and-drop file input
- Displays multiple possible decryptions
- Allows downloading of decrypted text
- The program analyzes the frequency of letters in the ciphertext.
- It tries decryption using the most common English letters first, improving efficiency.
- For each attempt, it validates the first few words using a dictionary API.
- It displays all possible decryptions, sorted by likelihood.
- The user can select any of the displayed decryptions or download the suggested one.
- Python 3.7+
- Flask
- Requests
app.py
: Main Flask applicationshift_cipher.py
: Core decryption logicweb/
: Contains web applicationstatic/
: Contains static filescss/
: Contains CSS Stylesheetstyle.css
: CSS Stylesheet
templates/
: Contain HTML Templateindex.html
: Frontend codeREADME.md
: Frontend documentation
README.md
: Main documentationrequirements.txt
: pip requirements.gitignore
: Git ignore fileLICENSE
: License file.env.example
: Environment exampletest_shift_cipher.py
: Test the core decryption logic
- You need python installed
- clone the repository:
git clone https://github.com/yuemiyuki/shift-cipher-decrypter
- Start a python venv If you are on bash:
python3 -m pip install venv
python3 -m venv ./venv
source ./venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Start the app
python app.py
- Visit the address shown in the console
- Run the following command:
python -m unittest test_shift_cipher.py
- The test results will be displayed in the terminal. You should see output indicating which tests passed or failed.
- If all tests pass, you'll see a message like "OK" followed by the number of tests run.
- If any tests fail, you'll see "FAILED" messages with details about which tests failed and why.