Authors: Quincy Conduff, Scott Payne, Colin Conduff
- Python version 3 (~3.5 should be fine)
- Tkinter version 8.5 (should be included with python)
python3 aes_gui.py- Select desired key length by clicking a radio button next to 128, 192, or 256.
- Click
Gen. Keybutton - Select AES mode
a. For ECB AES mode, selectECBradio button
b. For CBC AES mode, selectCBCradio button and clickGen. IVbutton - In
File Pathtextbox: enter in full file path to file that you would like to encrypt
Example:/Users/username/Desktop/test.png
Note: IfOut Directoryinput is empty, the program will create an encrypted file with.encappended to the end (e.g. test.png.enc). - Click
Encryptbutton - After encryption has finished, change File Path input to the file path to the encrypted file.
Example:/Users/username/Desktop/test.png.enc
Note: IfOut Directoryinput is empty, will overwrite original input file (e.g. test.png). - Click the
Decryptbutton
python3 aes_gui.py- In
File Pathtextbox: enter in full file path to file that you would like to encrypt
Example:/Users/username/Desktop/test.png
Note: IfOut Directoryinput is empty, the program will create an encrypted file with.encappended to the end (e.g. test.png.enc). - Select checkbox next to
Configtextbox.
Note: This disables entry intoKeyandInitialization Vectorfields. - In
Configtextbox: enter in full file path to file that hasJSONconfiguration settings.
Example:/Users/username/Desktop/test.png.conf
Note: IfConfiginput is empty, the program will create a configuration file with given settings uponEncryption. The file path for theConfigwill be the inputFile Pathwith '.conf' appended (e.g. test.png.conf). - Click
Encryptbutton
Note: If theKeyorInitialization Vectorfields are empty, then they will be generated automatically when necessary.
Note: Decrypt will fail when Config is enabled, but no Config file is found or the file is ill formatted.
{
"mode": "ecb",
"key-size": 16, // key size in bytes
"key": xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, // key in hex string format (leading 0x can be omitted)
// "iv": xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, not necessary for ecb mode
}python3 aes_test.py
Functions implementing core AES encryption and decryption functionality.
Sample I/O handling.
Opens files and encrypts them in byte sized chunks, appending results to output file.
Unit tests for the encryption and decryption AES functions on files and string messages.
Encryption/Decryption GUI implementation.
Takes file path, key, and output directory as input.
Clicking buttons will result in actions, with information logged in text window and bottom of window about errors or successes.
Encrypt:
Takes the file path and key and encrypt the file with that key, placing it within the desired output directory.
Decrypt:
Takes the file path and key and decrypts the file with that key, placing it within the desired output direcory.
Gen. Key:
Generates a key for the user, in the event they don't want to provide their own during ecryption.
Gen. IV:
Generates an initialization vector for use during CBC AES mode.
File Path:
Text field for user to provide file path of the file they want to encrypt or decrypt.
Key:
Text field for user to provide the key needed for decryption or the key phrase they'd like to use for encryption.
This will need to use an appropriate hasing function to convert human-friendly phrases into correct byte length keys.
Out Directory:
Text field for user to provide the desired directory for the resulting encrypted/decrypted file to be placed in.
Will default to same directory as the file given to be encrypted/decrypted.
Provide options for key sizes and AES modes.
Icon image file for thumbnail of GUI.
Temporary image file used in aes_io.py to test file I/O.
Provides functions for generating keys and initialization vectors, as well as performing number conversions.