Interactive Python scripts to help you verify your CSCI 485 Project 3 decryption code
We were told that the target file will be encrypted with the equivalent of the algorithm found at https://encode-decode.com/aes192-encrypt-online/. After some testing, I determined that it uses the CBC block mode with an initialization vector of all zeroes. The plaintext message is padded to be a multiple of 24 bytes (128 bits) following the PKCS#7 standard.
aes192-encrypt-online.py
is intended to emulate the website. This is so that you can see exactly what it is doing by examining the python source code, and so you can verify that the code here is correct.aes192-with-files.py
instead uses paths to binary files for keys and ciphertexts in the same format thatsecret_file.txt
andspecial_file.txt
will be in for Project 2.key-util.py
can create a key file from a string using the same algorithm as the website, or read the file. It also supports hexadecimal and base 64 4648.
The only dependency is the cryptography
python package which can be installed with one of:
pip3 install cryptography
pip3 install -r requirements.txt
conda --file requirements.txt
mamba --file requirements.txt
You may want to start a virtual environment (.venv
or .conda
) first.
If you want to make edits, it is also recommended to install the dependencies from dev-requirements.txt
as well.
If you are using VS Code, you do not need to install or manually use pyright as long as you have the suggested extensions installed, but you should still manually run ruff check
and ruff format
. You may be interested in creating virtual environments.
As an alternative to ruff
you can use black
and pyflakes
, which ruff
is intended to emulate.
This work is dual-licensed under Apache 2.0 and MIT. You can choose between one of them if you use this work.