Read the docs →
Overview
rexor is a simple and cross-platform Rust library with CLI app that provides basic file encryption and decryption functionality using XOR logic. It's designed to be easy to use while offering secure file protection with password-based encryption.
Features
- 🌐 Cross-platform compatibility - Works on Windows and UNIX-based systems
- 🔐 Simple file encryption/decryption using XOR logic with a provided password - Quick and easy to use
- ⚙ Automatic or custom output file path - Generates
.rxorfiles by default, or use a custom path - ⚡ Efficient processing in 8K chunks for large files - Handles large files without using excessive memory
- 📦 No external dependencies - Pure Rust implementation, no third-party crates required
Installation
Add rexor as a dependency in Cargo.toml:
[]
= "0.1.0"
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
input_path |
&str |
- | Path to the file to process (for encode, it must exist; for decode, it must be a valid .rxor file). |
password |
&str |
- | The password used for XOR encryption/decryption. Must not be empty. |
output_path |
Option<&str> |
None |
Custom output file path. If None, .rxor is appended on encode, or stripped on decode. |
Return Value
Both encode and decode return a std::io::Result<String>.
-
On success, the
Okvariant contains the path to the generated file. -
On failure, an appropriate
std::io::Erroris returned, commonly due to:- Invalid input paths or missing files
- Empty password (
std::io::ErrorKind::InvalidInput) - I/O issues while reading or writing files
Usage
Encoding a File
use encode;
Decoding a File
use decode;
Custom Output Paths
You can specify custom output paths for both encoding and decoding:
use ;
How It Works
The library uses the XOR operation to encrypt and decrypt files with the provided password. Since XOR is reversible with the same key, the same function can be used for both encryption and decryption.
CLI Application
A user-friendly command-line interface for ReXOR is available as a separate application.
Features
- ✨ Interactive text-based menu interface
- 📁 File selection dialogs for choosing input and output files
- 🔒 Secure password entry (input is hidden)
- 🎨 Colorful terminal output for better user experience
Screenshot
Installation
Option 1: Via releases
You can download pre-built binaries directly from the GitHub Releases page:
Option 2: Using Cargo
You can easily install ReXOR CLI using Cargo:
After installation, you can run the CLI from the terminal:
Option 3: Building from source
Alternatively, you can clone the repository and install the CLI locally:
Usage
Simply run the application to get started. The application provides an interactive menu with the following options:
- Encode a file
- Decode a file
- Exit
The CLI guides you through:
- Selecting the input file via a dialog
- Entering a password (which will be hidden during typing)
- Choosing where to save the output file
Dependencies
The CLI application uses several crates to improve the user experience:
clearscreen: For clearing the terminalcolored: For colorful text outputrfd: For file dialogsrpassword: For secure password input (hidden input)
Star History
License
Released under the MIT License © 2025 Ree-verse.