A secure, cross-platform file and folder encryption tool built with C++ that uses military-grade AES-256-CBC encryption with PBKDF2 key derivation.
- π‘οΈ Military-Grade Security: AES-256-CBC encryption with PBKDF2 key derivation (100,000 iterations)
- π File & Folder Support: Encrypt single files or entire directory structures
- π₯οΈ Interactive CLI: User-friendly interface with tab autocompletion for file paths
- π Home Directory Support: Works with
~paths and automatic expansion - π Secure Password Input: Hidden password entry with confirmation for encryption
- π¦ Smart Compression: Automatic ZIP compression before encryption
- π Directory Preservation: Maintains folder structure during decryption
- β‘ Fast Performance: Optimized for large files and directories
- π§ Linux Native: Built specifically for Linux with bash-style tab completion
# Ubuntu/Debian
sudo apt update
sudo apt install build-essential cmake libssl-dev libzip-dev pkg-config
# CentOS/RHEL/Fedora
sudo dnf install gcc-c++ cmake openssl-devel libzip-devel pkgconfig
# Arch Linux
sudo pacman -S base-devel cmake openssl libzipgit clone https://github.com/muskiteer/Encyptor
cd encryptor
mkdir build && cd build
cmake ..
make -j$(nproc)./build/bin/encryptor- Follow the guided prompts
- Use Tab for path autocompletion
- Supports
~/home directory paths
# Encrypt a file
./build/bin/encryptor -i document.txt -o ~/encrypted_output -p your_password -e
# Encrypt a folder
./build/bin/encryptor -i ~/my_folder -o ~/encrypted_output -p your_password -e
# Decrypt
./build/bin/encryptor -i file.txt.enc -o ~/decrypted_output -p your_password -d
# Show help
./build/bin/encryptor -h- Input Processing: Files/folders are compressed into ZIP format
- Key Derivation: Password β PBKDF2 (100,000 iterations) β 256-bit key
- Random Generation: Cryptographically secure salt and IV generation
- Encryption: AES-256-CBC encryption with integrity delimiter
- Output: Single
.encfile containing:[salt][IV][encrypted_data]
- File Reading: Extract salt, IV, and encrypted data
- Key Derivation: Recreate encryption key using password and salt
- Decryption: AES-256-CBC decryption with integrity verification
- Extraction: Decompress ZIP and restore original structure
| Component | Technology |
|---|---|
| Encryption | AES-256-CBC |
| Key Derivation | PBKDF2-HMAC-SHA256 |
| Iterations | 100,000 (configurable) |
| Salt/IV Size | 128-bit (16 bytes) |
| Compression | ZIP with directory preservation |
| Libraries | OpenSSL, libzip |
| Language | C++17 |
encryptor/
βββ CMakeLists.txt # Build configuration
βββ main.cpp # Main application entry
βββ cmd/
β βββ cli.h # Interactive CLI with tab completion
βββ internal/
β βββ directory.h # Directory structure cleanup utilities
β βββ encryption.h # AES encryption/decryption functions
β βββ zip.h # ZIP compression utilities
βββ test/ # Test files and examples
β βββ testing.txt # Sample test file
β βββ *.enc # Generated encrypted files
βββ build/ # Build output (gitignored)
β βββ bin/
β βββ encryptor # Compiled binary
βββ README.md # This file
- Strong Key Derivation: 100,000 PBKDF2 iterations (configurable up to 600,000)
- Cryptographically Secure Random: Uses OpenSSL's RAND_bytes()
- Memory Security: Automatic password clearing after use
- Path Validation: Protection against directory traversal attacks
- Integrity Verification: Built-in tamper detection
- No Key Storage: Keys are derived fresh each time
./build/bin/encryptorFeatures:
- Tab completion for file paths
- Home directory (
~) support - Hidden password input
- Password confirmation for encryption
- Real-time path validation
-i <path> Input file or folder
-o <path> Output directory
-p <pass> Password for encryption/decryption
-e Encrypt mode
-d Decrypt mode
-h Show help- Industry-standard AES-256-CBC encryption
- High iteration PBKDF2 (100,000+ iterations)
- Cryptographically secure random generation
- Memory clearing after password use
- Path traversal protection
- Password Strength: Use strong, unique passwords
- Backup: Keep secure backups of encrypted files
- Updates: Regularly update OpenSSL and dependencies
- Environment: Use on trusted systems only
cmake -DCMAKE_BUILD_TYPE=Debug ..
makecmake -DCMAKE_BUILD_TYPE=Release ..
makeModify main.cpp line 8:
const int iterations = 600000; // Increase for higher security"libssl not found"
sudo apt install libssl-dev # Ubuntu/Debian
sudo dnf install openssl-devel # CentOS/Fedora"libzip not found"
sudo apt install libzip-dev # Ubuntu/Debian
sudo dnf install libzip-devel # CentOS/Fedora"Permission denied"
chmod +x build/bin/encryptorTab completion not working
- Ensure you're in interactive mode (
build/bin/encryptorwithout arguments) - Check terminal supports ANSI escape sequences
- Small files (<1MB): Near-instantaneous
- Medium files (1-100MB): 1-10 seconds
- Large files (100MB-1GB): 10-60 seconds
- Folders: Depends on total size and file count
- Use Release build for production
- SSD storage for better I/O performance
- Adjust PBKDF2 iterations based on security vs speed needs
The test directory contains sample files for testing:
# Test encryption
./build/bin/encryptor -i test/testing.txt -o /tmp/encrypted_test -p testpass123 -e
# Test decryption
./build/bin/encryptor -i /tmp/encrypted_test.txt.enc -o /tmp/decrypted_test -p testpass123 -d$ ./build/bin/encryptor
=== File Encryption Tool ===
Tab for autocompletion, Enter to confirm
Choose operation:
1. Encrypt (e)
2. Decrypt (d)
Enter choice (e/d): e
Input file/folder: ~/Documents/secret.txt
Output directory: ~/encrypted/
Enter password: ********
Confirm password: ********
Operation: Encrypt
Input: /home/user/Documents/secret.txt
Output: /home/user/encrypted/
Proceeding...
Encrypting...
File successfully zipped: /home/user/Documents/secret.txt.tmp.zip
Encryption completed successfully: /home/user/encrypted/secret.txt.enc$ ./build/bin/encryptor -i ~/encrypted/secret.txt.enc -o ~/decrypted/ -p mypassword -d
Decrypting...
Extraction completed: /home/user/decrypted/
No unnecessary nesting detected.
Decryption completed successfully: /home/user/decrypted/- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Follow C++17 standards
- Add security tests for new features
- Update documentation for API changes
- Ensure cross-platform compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenSSL - Cryptographic library
- libzip - ZIP compression library
- CMake - Build system
- Linux Community - Terminal handling inspiration
- π Issues: Create a GitHub issue
- π¬ Questions: Start a GitHub discussion
- Initial release
- AES-256-CBC encryption
- Interactive CLI with tab completion
- File and folder support
- ZIP compression
- Home directory support
π Security Note: This tool is designed for personal and educational use. For enterprise or high-security environments, consider additional security audits and compliance requirements.