A lightweight C program that provides file encryption using XOR cipher security. Simple yet effective for basic encryption needs.
- File encryption using XOR cipher
- Support for both text and binary files
- Customizable key storage
- Simple command-line interface
- Fast and efficient processing
- Clone the repository:
git clone https://github.com/yourusername/xenigma.git
cd xenigma
- Build the project:
make
The executable will be created in the bin
directory.
xenigma -f file.txt -o encrypted.xor -k my_secret.key -e
-f
: Input file (required)-o
: Output file (optional, default:<input_file>.xor
)-k
: Key file location (optional, default:xor.key
)-e
: Encrypt mode flag
xenigma -f encrypted.xor -o decrypted.txt -k my_secret.key -d
-f
: Input file (required)-o
: Output file (optional, default:out.txt
orfile.out
for binary)-k
: Key file location (optional, default:xor.key
)-d
: Decrypt mode flag
Use the -b
flag when dealing with binary files:
xenigma -f image.png -e -b
xenigma -f image.png.xor -d -b
Option | Description |
---|---|
-f <file> |
Input file to encrypt/decrypt (required) |
-o <file> |
Output file location (optional) |
-k <file> |
Key file location (optional) |
-e |
Encrypt mode |
-d |
Decrypt mode |
-b |
Binary file mode |
-h |
Show help message |
- Encryption output:
<input_file>.xor
- Decryption output:
out.txt
(text) orfile.out
(binary) - Key file:
xor.key
- The program will overwrite output files without warning
- Keep your key file safe - it's required for decryption
- Use the same key file that was used for encryption when decrypting
- Binary mode (-b) must be used consistently for encryption and decryption
- Encrypt a text file:
xenigma -f secret.txt -e
- Decrypt using custom filenames:
xenigma -f encrypted.xor -o decrypted.txt -k my_key.key -d
- Handle binary files:
xenigma -f image.jpg -e -b
xenigma -f image.jpg.xor -d -b
# Clone the repository
git clone https://github.com/HarshNarayanJha/xenigma.git
# Navigate to project directory
cd xenigma
# Build the project
make
# Clean build files
make clean
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
XOR encryption is a simple cipher and should not be used for serious security needs. This tool is for educational purposes and basic encryption tasks only.