Go Encryption
A secure and efficient file encryption tool written in Go that implements multi-layer encryption with parallel processing capabilities.
Features
- Multi-layer Encryption: Combines multiple encryption algorithms for enhanced security
- Serpent block cipher
- ChaCha20 stream cipher
- Reed-Solomon error correction encoding
- Data Compression: Utilizes zlib compression for efficient storage
- Parallel Processing: Leverages multi-core systems for faster encryption/decryption
- Progress Tracking: Real-time progress bar for file operations
- Error Recovery: Built-in error correction using Reed-Solomon encoding
- Interactive CLI: User-friendly command-line interface with file selection
- Cross-platform: Supports Windows, macOS, and Linux
⚠️ Important File Size Notice: Due to the Reed-Solomon error correction encoding, encrypted files will be significantly larger than the original files. For example, a 26MB unencrypted file will become approximately 96MB after encryption. Please ensure you have sufficient storage space available before encrypting large files.
Installation
From Releases
- Go to the Releases page
- Download the latest binary for your operating system.
- Make the file executable (Unix-based systems):
chmod +x go-encryption*
From Source
Requirements:
# Clone the repository
git clone https://github.com/hambosto/go-encryption.git
# Change to project directory
cd go-encryption
# Build the project
go build -o go-encryption
# (Optional) Install globally
go install
Usage
-
Run the application:
./go-encryption
-
Select operation:
- Choose between
Encrypt
or Decrypt
using arrow keys
-
Select file:
- Navigate through available files using arrow keys
- For encryption: shows all non-encrypted files
- For decryption: shows only
.enc
files
The program will process the selected file and display progress in real-time.
- Encrypted files are saved with the
.enc
extension
- Original filename is preserved when decrypting
- Files are processed in chunks for efficient memory usage
Security Features
Encryption Layers
-
Serpent (Block Cipher)
- 256-bit key
- Considered a highly secure AES finalist
- Block size: 128 bits
-
ChaCha20 (Stream Cipher)
- 256-bit key
- Modern, high-performance cipher
- Developed by Daniel J. Bernstein
-
Reed-Solomon (Error Correction)
- Adds redundancy for error recovery
- Helps protect against data corruption
- Configurable data/parity ratio
Additional Security Measures
- Unique nonces for each encryption layer
- Secure memory handling with buffer pools
- Padding and alignment for block cipher security
- Size header encryption
Technical Details
- Parallel Processing: Utilizes all available CPU cores
- Buffer Pools: Reduces memory allocations
- Chunked Processing: Handles large files efficiently
- Compressed Output: Reduces encrypted file size
Building from Source
To build for specific platforms:
# Windows
GOOS=windows GOARCH=amd64 go build -o go-encryption.exe
# macOS
GOOS=darwin GOARCH=amd64 go build -o go-encryption
# Linux
GOOS=linux GOARCH=amd64 go build -o go-encryption
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Security Notice
While this tool implements strong encryption algorithms, please note:
- Keep your encryption keys secure
- Back up important files before encryption
- Use strong, unique keys for each file
- Store nonces securely for decryption