High-performance directory encryption tool written in Rust
TreeLock is a high-performance directory encryption tool written in Rust. It is designed to protect your files both at rest and during transport by allowing you to encrypt and decrypt files recursively within a folder.
TreeLock ensures the confidentiality and integrity of your data through a multi-layered encryption architecture inspired by tools like Cryptomator and Age.
You can find all the implementation details in the documentation
- AES-GCM 256-bit Encryption: Protects against unauthorized access, network interception, and tampering.
- Quantum Resistance: Uses a 256-bit key size to maintain 128 bits of security even against Grover's algorithm.
- Unique File Keys: Every file is encrypted with a unique key derived from its path and a Master Encryption Key (MEK) using HKDF-SHA256.
- Memory Safety: Sensitive keys are zeroed out of memory when no longer needed using the
Zeroizecrate.
Warning
This program has not been seriously audited. Use it at your own risk.
Since TreeLock is written in Rust, you can compile it using cargo:
- Clone the repository.
- Build the release version:
cargo build --release- The binary will be available in the
./target/release/directory.
When you run the tool, you can choose from several operations:
- Encrypt/Decrypt: Process a single file or an entire directory.
- Password Change: Update your password without needing to re-encrypt your actual files.
You can manage your Key Encryption Key (KEK) in two ways:
- Default Mode: Generates a random 256-bit key shown as a base64 secret.
- Password Mode (
-u/--using-password): Derives a KEK from a password using Argon2id (less secure).
- Protected against: Unauthorized access, passive/active network attacks, and brute-force on encrypted data.
- Not protected against: Side-channel attacks or dynamic reverse analysis (an attacker with local machine access may read the keys from memory).
The management of secrets is the responsibility of the user; ensure you store and share your keys securely.
TreeLock is an open-source project, and your input is welcome! You are encouraged to use this program however you see fit for your encryption needs.
If you are a developer or a security enthusiast, please don't hesitate to contribute. Whether it’s improving the Rust implementation, identifying potential vulnerabilities, or suggesting new features, your help is appreciated.
Important
As noted in the documentation, this program has not undergone a formal security audit. Contributing to the codebase or helping with security reviews is a great way to make the tool safer for everyone.
