This simple self-hosted website lets you enjoy the experience of encrypting and decrypting messages using the GOST symmetric block cipher. The idea is very simple: the website is consists of 2 main tabs, one for encryption and the other for decryption. In each tab, the website will ask you to fill in the needed fields; if you don't fill them, then it won't proceed until you do it.
The first tab is used for encryption. The required fields are:
- Operating mode (between ECB, CBC, OFB, CFB and CTR, default is CBC);
- The message to encrypt (A.K.A. plaintext);
- The password;
- Wether you want to choose the salt yourself or you want a random one.
If you choose to pick the salt yourself, then another input will appear for you to fill in.
Pushing the "Encrypt" button will take you to another page containing a resume of your choices, plus the ciphertext produced by the program.
The second tab is pretty similar to the first one, but instead of performing encryption it performs decryption. Again, the required fields are:
- Operation mode (between ECB, CBC, OFB, CFB and CTR);
- The ciphertext (in hex form);
- The password;
- The salt;
- The IV (for any operating mode other than ECB).
After pushing the "Decrypt" button you'll be redirected to another page containing a resume of the data you typed in, plus the decrypted message.
- Main dir: it contains the GOST.py library which allows you to encrypt and decrypt messages. The main file is used to make the web server run;
- Templates dir: contains the HTML files. Index is of course the homepage, while the other ones' purpose can be guessed easily;
- Static dir: it contains favicons and JS scripts, plus some CSS styling;
- Clone the repo on your PC;
- Create a virtual environment and install required packages from requirements.txt;
- Compile the C file GOST.c into a shared library object named GOST.so;
- Run the main Flask app from CLI.
To compile the C file to make the shared library object, you can use the following commands from inside the program's directory:
gcc -c -fPIC GOST.c -o GOST.o
gcc -shared GOST.o -o GOST.so
rm GOST.o
To run the app, you can use the following commands from inside the program's directory:
. venv/bin/activate
export FLASK_APP=main
export FLASK_DEBUG=0
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
flask run --host="0.0.0.0" --port=8080 --cert=gost.pem --key=gost.key
deactivate