A simple and fast console tool to encrypt and decrypt any kind of file using XOR byte encryption. Perfect for basic obfuscation or fun file-locking projects. Works on Windows and Linux.
- 🔒 Encrypts any file type (ZIP, PDF, EXE, TXT, JPG, etc.)
- 🔁 Reversible XOR cipher encryption
- ✅ Input validation for file path and key
- 📂 Saves output as
.encryptedor.decrypted - 🧠 One key does both encryption & decryption
- 💻 Runs on Windows and Linux
This tool uses a symmetric XOR algorithm:
- XORs each byte of the file with a numeric key (0–255)
- XORing the same file twice with the same key restores the original
| Operation | Input File | Output File |
|---|---|---|
| Encrypt | example.zip |
example.zip.encrypted |
| Decrypt | example.zip.encrypted |
example.zip.encrypted.decrypted |
- Make sure .NET SDK is installed.
- Open CMD or PowerShell in the folder containing the
.csfile. - Build and run:
dotnet new console -o FileEncryptorApp
cd FileEncryptorApp
# Replace default Program.cs
copy ..\Program.cs .\Program.cs
dotnet build
After building, run the .exe directly:
cd bin\Debug\net8.0
File\ Encryptor\ \&\ Decrypter.exe
💡 Tip: You can also double-click the File Encryptor & Decrypter.exe in File Explorer.
🐧 Linux
Install .NET SDK:
sudo apt update
sudo apt install dotnet-sdk-8.0
In terminal:
dotnet new console -o FileEncryptorApp
cd FileEncryptorApp
mv ../Program.cs ./Program.cs
dotnet run
Or, build and run the output manually:
dotnet build
cd bin/Debug/net8.0
./File\ Encryptor\ \&\ Decrypter
🧪 Example Usage
Enter file path: /home/user/Desktop/test.pdf
Enter encryption key (0–255): 123
✅ File encrypted successfully: test.pdf.encrypted
To decrypt, run again with the .encrypted file and the same key.
⚠️ Disclaimer
This tool uses basic XOR encryption, which is not secure for highly sensitive data. It’s intended for educational purposes, light protection, or pranking.
📄 License
Open-source under the MIT License.
👤 Author
Made by @dionabazi with ❤️
## ☕ Support Me
If you like this project, feel free to [buy me a coffee](https://ko-fi.com/G2G114SBVV)!
[](https://ko-fi.com/G2G114SBVV)