This project is a file encryption and decryption tool with a graphical user interface (GUI) built using Tkinter
and enhanced with drag-and-drop functionality (TkinterDnD2
). It allows users to securely encrypt and decrypt .txt
files using the cryptography
library’s Fernet
symmetric encryption.
- Drag-and-Drop File Selection: Users can easily drag and drop
.txt
files onto the GUI to select them for encryption or decryption. - Encryption:
- Generates a unique encryption key using
Fernet
. - Encrypts the content of the selected file, replacing the original text with the encrypted content.
- Displays the encryption key for the user to save (required for decryption).
- Generates a unique encryption key using
- Decryption:
- Users can input the saved encryption key to decrypt the selected file.
- Restores the original file content by replacing the encrypted text with the decrypted text.
- Reset Functionality: Clears the file and encryption key fields to reset the interface.
- Intuitive GUI:
Listbox
for file selection and content display.Text
box for displaying and inputting the encryption key.- Buttons for encrypting, decrypting, and resetting the interface.
- Python: Core programming language.
- Tkinter: For building the graphical user interface.
- TkinterDnD2: For adding drag-and-drop file functionality.
- Cryptography (Fernet): For secure file encryption and decryption.
To run this tool on your local machine, follow these steps:
- Clone the repository:
git clone https://github.com/yourusername/encryption-tool.git
- Navigate to the project directory:
cd encryption-tool
- Install the required dependencies:
pip install cryptography tk TkinterDnD2
- Run the program:
python main.py
- Encrypt a File: Drag a
.txt
file onto the interface and click the "Encrypt" button. Save the encryption key displayed in the text box. - Decrypt a File: Drag the encrypted
.txt
file, input the saved encryption key, and click the "Decrypt" button. - Reset: Click the "Reset" button to clear the file selection and encryption key fields.