rsecure
rsecure is a simple and secure command-line tool for AES-GCM file encryption and decryption, built in pure Rust. Ideal for protecting sensitive files, backups, and personal data.
rsecure uses stream encryption and rayon parallelism. The speed of the encryption also depends of your hardware specs (disk speed, CPU speed and number of cores).

Installation
curl --proto '=https' --tlsv1.2 -sSfL https://raw.githubusercontent.com/containerscrew/rsecure/main/install.sh | sh
Specific version:
curl --proto '=https' --tlsv1.2 -sSfL https://raw.githubusercontent.com/containerscrew/rsecure/main/install.sh | sh -s -- -v "0.3.0"
[!NOTE] The installation script automatic detects your
OSandARCHand install the correct binary for you (rpm, deb, apk or just a binary in/usr/local/bin). In alpine, install the packageapk add gcompatsine the binary is built withglibcand alpine usesmusl.
AUR (Arch Linux)
Homebrew
[!WARNING] Since this binary is not signed by the Apple ecosystem, you will need to run the following command to allow it to run on your system.
If you still have issues running the binary, I recommend using the
cargoinstallation method or downloading the binary from the releases page. Use the first method (installing viacurland theinstall.shscript).
Using cargo
Local build
Usage
Commands
| Command | Description |
|---|---|
rsecure create-key -o /mnt/myusb/rsecure.key |
Generate a new AES-256 key and save it to a file |
openssl rand -out /mnt/myusb/rsecure.key 32 |
Alternative: generate a random 256-bit key using OpenSSL |
rsecure encrypt -p /mnt/myusb/rsecure.key -s /home/mydirectory/text_to_encrypt.txt |
Encrypt a single file (.enc file is created in the same directory) |
rsecure encrypt -p /mnt/myusb/rsecure.key -s /home/mydirectory/files/ |
Encrypt all files in a directory |
rsecure decrypt -p /mnt/myusb/rsecure.key -s /home/mydirectory/text_to_encrypt.txt.enc |
Decrypt a single encrypted file |
rsecure decrypt -p /mnt/myusb/rsecure.key -s /home/mydirectory/files/ |
Decrypt all files in a directory |
rsecure encrypt -r -p /mnt/myusb/rsecure.key -s /home/rsecure/dirtoencrypt/ |
Encrypt and remove original files (plain text) |
rsecure encrypt -p /mnt/myusb/rsecure.key -s /home/rsecure/dirtoencrypt -e '.git' |
Encrypt all files in a directory excluding .git/ files |
[!WARNING] Saving the key in the same local filesystem where you save the encrypted files is not a good idea. Save the key in a secure location, like a
USB driveor a password manager. Or just save it in aroot owned directorywith strict permissions (will require sudo to use it).
Something like:
rsecuremust be in a PATH directory whererootuser can execute it. Which means, if you installed it usingcargo, you need to add~/.cargo/binto thePATHvariable in therootuser environment. Or just copy the binary to/usr/local/bin/or any other directory in thePATH.
[!IMPORTANT] By default,
rsecurewill not delete the source plain files after encryption to avoid data loss. If you want to delete the source files after encryption, use-rflag.
Local dev
Testing encryption and decryption:
Edit the
fake_data.shscript to create different types of files and directories for testing.
Benchmark (hyperfine)
TODO
- Add support for
zipandtararchives.
License
rsecure is distributed under the terms of the GPL3 license.