A simple Python program to encrypt and decrypt files using the XOR operation.
This tool can work with almost any file type including text, documents, images, audio/video, and executables.
- Encrypt and decrypt any file type (text, images, audio, video, executables, etc.)
- Custom key support (default:
123) - Works via XOR encryption (lightweight & reversible)
- Simple CLI menu interface
- Colored warning banner to alert users
- Use the same key for both Encryption and Decryption
- This program will overwrite your original file (make a backup if needed)
- XOR encryption is not secure for sensitive data
- Use this program at your own risk
- Text files β
.txt,.csv,.json, etc. - Documents β
.docx,.pdf, etc. - Images β
.jpg,.png,.bmp, etc. - Media β
.mp3,.mp4,.wav, etc. - Executables β
.exe,.dll, etc.
Basically, any binary file can be encrypted/decrypted.
- Clone this repository or copy the script file.
- Install requirements:
pip install colorama
Run the script in your terminal: python xor_encryptor.py
- Encryption
- Decryption
- Exit
-
Choose 1 to encrypt β enter file path β enter key β file will be encrypted.
-
Choose 2 to decrypt β enter file path β use the same key β file will be restored.
- Encryption
- Decryption
- Exit Enter your choice here: 1 Enter your file path here (Encryption): sample.txt Enter your key for Encryption (e.g. 123): 555 File is Encrypted..
Then decrypt:
Enter your choice here: 2 Enter your file path here (Decryption): sample.txt Enter your key for Decryption (must match encryption key): 555 File is Decrypted..
- This project is released under the MIT License.
- You are free to use, modify, and distribute it β at your own risk.