This project started when I stored my project files on the server and it became public and my logs were read because of password exposure, don't use it for bad purposes, YOU ARE RESPONSIBLE
File Description and Purpose
This Python script is designed to encrypt and decrypt an entire directory, including all subdirectories and files, with the ability to customize the encryption key and number of encryption iterations. The program ensures that the file content, filenames, and folder names (except file extensions) are fully encrypted, providing a robust solution for securing sensitive data.
Features:
-
Recursive Encryption:
- Encrypts all files and subfolders within a specified directory, ensuring complete protection of the folder structure and its contents.
- Maintains file extensions to avoid errors in file handling.
-
Customizable Encryption:
- Users can define an alphanumeric key (
a-z
, A-Z
, 0-9
) for encryption and decryption.
- Supports multiple iterations of encryption for added security.
-
Filename and Folder Encryption:
- Encrypts filenames and folder names while ensuring compatibility with operating systems (no invalid characters are used in filenames).
- Uses separate character mappings for file content and names to avoid conflicts.
-
File Content Encryption:
- File content is fully encrypted using a printable character set (
string.printable
), ensuring complete obfuscation of data.
-
Cross-Platform Compatibility:
- Supports Windows, macOS, and Linux file systems, with handling for OS-specific filename restrictions.
-
Top-down and Bottom-up Processing:
- Processes files first, then folders to ensure the integrity of the directory structure during encryption and decryption.
Limitations:
- Complex and Non-Text File Handling:
- The encryption process alters the original binary content of non-text files (e.g.,
.jpg
, .png
, .exe
), potentially rendering them unreadable after decryption.
- This tool is recommended primarily for text-based files (e.g.,
.txt
, .csv
, .json
) or files that can tolerate changes during encryption.
- No Error Recovery:
- If the key or the number of iterations is lost or incorrect during decryption, files and folder structures cannot be recovered.
Recommended Use Cases:
- Securing sensitive text-based data (e.g.,
.txt
, .csv
, .log
files).
- Obfuscating project structures, source code files, or other readable formats.
- Not suitable for multimedia, binary, or system-critical files due to potential corruption.