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.
- 🌐 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
Add rexor as a dependency in Cargo.toml:
[dependencies]
ReXOR = "0.1.0"| 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. |
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
use rexor::encode;
fn main() -> std::io::Result<()> {
let input = "example.txt";
let password = "password123";
// Encode the file into "example.txt.rxor"
let output = encode(input, password, None)?;
println!("Encoded file saved at: {}", output);
Ok(())
}use rexor::decode;
fn main() -> std::io::Result<()> {
let input = "example.txt.rxor";
let password = "password123";
// Decode the file back to its original form
let output = decode(input, password, None)?;
println!("Decoded file saved at: {}", output);
Ok(())
}You can specify custom output paths for both encoding and decoding:
use rexor::{encode, decode};
fn main() -> std::io::Result<()> {
let input = "example.txt";
let password = "password123";
// Encode to a custom location
let encoded = encode(input, password, Some("encrypted/output.rxor"))?;
// Decode back into another file
let decoded = decode(&encoded, password, Some("decrypted/example.txt"))?;
println!("Encoded: {}", encoded);
println!("Decoded: {}", decoded);
Ok(())
}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.
A user-friendly command-line interface for ReXOR is available as a separate application.
- ✨ 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
You can download pre-built binaries directly from the GitHub Releases page:
You can easily install ReXOR CLI using Cargo:
cargo install ReXORAfter installation, you can run the CLI from the terminal:
ReXORAlternatively, you can clone the repository and install the CLI locally:
git clone https://github.com/ree-verse/ReXOR.git
cd ReXOR
cargo run --releaseSimply 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
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)
Released under the MIT License © 2025 Ree-verse.

