Secure Folder Monitor is a powerful Python utility that provides automatic, high-security AES-256 encryption for any folder on your system. It actively watches for new or modified files and encrypts them on the fly, creating a secure environment for your sensitive data.
The application is designed for flexibility, offering both a user-friendly graphical interface (GUI) for desktop use and a command-line interface (CLI) for automation and server environments. For users seeking an additional layer of physical security, the monitor can be optionally configured to work with a hardware security dongle.
- Automatic File Monitoring: Leverages the
watchdoglibrary to instantly detect and process file changes. - Strong Encryption: Implements AES-256 in GCM mode via
pycryptodomefor robust, authenticated encryption. - Secure Key Management: Derives encryption keys from a user-provided password using the PBKDF2 standard. Your password is never stored.
- Dual-Mode Operation:
- GUI Application: An intuitive interface for easy configuration, monitoring control, and file decryption.
- Command-Line Interface: A script for headless operation, perfect for scripting or server use.
- Highly Configurable: A simple
config.inifile manages all settings, including the target directory and operational modes. - Safe File Handling: Intelligently avoids re-encrypting already secured files and waits for large files to be fully written before processing.
- Optional Hardware Security: Can be linked to a physical USB dongle to ensure encryption/decryption only occurs when you are physically present.
Software:
- Python 3.10+
watchdog,pycryptodome,pyserialtkinter&ttkbootstrap(for GUI)
Optional Hardware:
- Arduino Nano (or compatible microcontroller)
- Arduino IDE
pip install watchdog pycryptodome pyserial ttkbootstrap
Configure the Application
Open the config.ini file.
In the [Settings] section, set watch_directory to the full path of the folder you want to protect.
The [Hardware] section is optional. Leave dongle_id blank to run in software-only mode.
How to Use
A) GUI Mode (Recommended for Desktops)
Run the app in GUI mode:
bash
Copy code
python app_gui.py
The graphical interface will launch, allowing you to enter your password and control the monitor with the click of a button.
B) Command-Line (CLI) Mode
Run in CLI mode:
bash
Copy code
python main_cli.py
You will be prompted for your password in the terminal. The monitor will run until you stop it with Ctrl+C.
<details>
<summary>📂 Hardware Dongle Setup Guide</summary>
This guide explains how to set up the optional hardware dongle for an added layer of physical security.
When enabled, the Secure Folder Monitor will refuse to encrypt or decrypt any files unless this specific USB device is connected to the computer.
### Requirements
- An Arduino Nano, ESP32, or any compatible microcontroller that can communicate over a serial port.
- The Arduino IDE installed on your computer.
- A USB cable to connect the Arduino to your computer.
### Step 1: Program the Dongle
The dongle works by sending a unique, secret ID over the USB serial port. The Python application listens for this specific ID to verify its presence.
**Arduino Sketch:**
```cpp
#define DONGLE_ID "Encr_Dongle_Alpha_7721"
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(DONGLE_ID);
delay(1500);
}
Change "Encr_Dongle_Alpha_7721" to your own secret string.
Upload Steps:
Connect Arduino.
Select board & port in Arduino IDE.
Click Upload.
Step 2: Configure Software
Edit config.ini:
ini
Copy code
[Hardware]
dongle_id = Encr_Dongle_Alpha_7721
Step 3: Run Application
App scans USB ports for dongle.
Works if found, pauses if not.
</details> ```