A simple yet powerful file encryption tool built with Rust. Securely encrypt and decrypt files using AES-256-GCM encryption with password-based key derivation.
- Strong Encryption: Uses AES-256-GCM, a highly secure authenticated encryption algorithm
- Password-Based: Simple password-based protection for your sensitive files
- Secure Key Derivation: Implements Argon2 for secure key derivation from passwords
- User-Friendly CLI: Simple command-line interface for ease of use
- Cross-Platform: Works on Windows, macOS, and Linux
- Ensure you have Rust installed
- Clone the repository
git clone https://github.com/karthik558/Rust-Crypt.git cd Rust-Crypt
- Build the project
cargo build --release
- The binary will be available at
target/release/rust-crypt
cargo install --git https://github.com/karthik558/Rust-Crypt.git
Encrypting a file:
rust-crypt encrypt --input <INPUT_FILE> --output <OUTPUT_FILE> --password <YOUR_PASSWORD>
Example:
rust-crypt encrypt --input secret.txt --output secret.enc --password mysecretpassword@7%%%!
Decrypting a file:
rust-crypt decrypt --input <ENCRYPTED_FILE> --output <OUTPUT_FILE> --password <YOUR_PASSWORD>
Example:
rust-crypt decrypt --input secret.enc --output secret.txt --password mysecretpassword@7%%%!
- A unique salt is generated for each file encryption
- An AES-256 key is derived from the user's password using Argon2
- A random nonce is generated for the AES-GCM encryption
- The file is encrypted using AES-256-GCM with the derived key and nonce
- The encrypted file format is: [salt_length (4 bytes)][salt][nonce (12 bytes)][encrypted data]
- Password Strength: The security of your encrypted files depends significantly on the strength of your password
- File Format: The encrypted file contains the salt and nonce used for encryption, but these do not compromise security
- Memory Safety: Built with Rust, providing memory safety guarantees
aes-gcm:
: Provides the AES-GCM encryption algorithmargon2:
: Secure password hashing and key derivationclap:
: Command-line argument parsinganyhow:
: Flexible error handling
Contributions are welcome! Feel free to open an issue or submit a pull request for new features, improvements, or bug fixes.
- Fork the repository
- Create your feature branch (
git checkout -b feature/security-feature
) - Commit your changes (
git commit -m 'Add some security feature'
) - Push to the branch (
git push origin feature/security-feature
) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by the need for simple, secure file encryption tools
- Thanks to the Rust cryptography community for maintaining excellent libraries