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
.encrypted
or.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
.cs
file. - 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)