FileVault lΓ mα»t cΓ΄ng cα»₯ mΓ£ hΓ³a file command-line ΔΖ‘n giαΊ£n, an toΓ n vΓ hiα»u quαΊ£ Δược phΓ‘t triα»n bα»i NT140.Q11.ANTT Group 15. Sα» dα»₯ng mΓ£ hΓ³a AES-256-GCM vΓ key derivation PBKDF2, FileVault ΔαΊ£m bαΊ£o bαΊ£o mαΊt cao cho cΓ‘c file quan trα»ng cα»§a bαΊ‘n.
- π TΓnh NΔng ChΓnh
- π§ CΓ i ΔαΊ·t
- π Sα» Dα»₯ng CΖ‘ BαΊ£n
- π‘οΈ BαΊ£o MαΊt
- ποΈ KiαΊΏn TrΓΊc
- π§ͺ Testing
- π€ ΔΓ³ng GΓ³p
- π License
- π MΓ£ HΓ³a MαΊ‘nh: AES-256-GCM vα»i authenticated encryption
- π Key Derivation An ToΓ n: PBKDF2-SHA256 vα»i 100,000 iterations
- π² Random Salt: Mα»i file Δược mΓ£ hΓ³a vα»i salt unique 32-byte
- π Progress Tracking: Progress bar cho file lα»n
- π File Verification: Kiα»m tra tΓnh toΓ n vαΊΉn file
- π Batch Processing: MΓ£ hΓ³a nhiα»u file cΓΉng lΓΊc
- π± Cross-Platform: Hα» trợ Windows, Linux, macOS
- π§ Memory Security: Secure memory cleanup sau xα» lΓ½
- β‘ Streaming Encryption: Xα» lΓ½ file lα»n hiα»u quαΊ£
- π Custom File Format: Header metadata vα»i version control
- π― CLI Intuitive: Command-line interface dα» sα» dα»₯ng
TαΊ£i pre-built binary tα»« GitHub Releases:
# Windows
wget https://github.com/vuongdat67/NT140.Q11.ANTT-Group15/releases/latest/download/filevault-windows-amd64.exe
# Linux
wget https://github.com/vuongdat67/NT140.Q11.ANTT-Group15/releases/latest/download/filevault-linux-amd64
chmod +x filevault-linux-amd64
# macOS
wget https://github.com/vuongdat67/NT140.Q11.ANTT-Group15/releases/latest/download/filevault-darwin-amd64
chmod +x filevault-darwin-amd64YΓͺu cαΊ§u: Go 1.25 hoαΊ·c cao hΖ‘n
# Clone repository
git clone https://github.com/vuongdat67/NT140.Q11.ANTT-Group15.git
cd NT140.Q11.ANTT-Group15
# Build
make build
# HoαΊ·c build manual
go build -o filevault cmd/filevault/main.go# Linux/macOS
curl -sSL https://raw.githubusercontent.com/vuongdat67/NT140.Q11.ANTT-Group15/main/scripts/install.sh | bash
# Windows PowerShell
iwr -useb https://raw.githubusercontent.com/vuongdat67/NT140.Q11.ANTT-Group15/main/scripts/install.ps1 | iex# MΓ£ hΓ³a file ΔΖ‘n lαΊ»
filevault encrypt document.pdf
# Output: document.pdf.enc
# Chα» Δα»nh file output
filevault encrypt document.pdf secure.enc
# MΓ£ hΓ³a vα»i output directory
filevault encrypt document.pdf -o encrypted/# GiαΊ£i mΓ£ file
filevault decrypt document.pdf.enc
# Output: document.pdf
# Chα» Δα»nh file output
filevault decrypt secure.enc original.pdf
# GiαΊ£i mΓ£ vα»i output directory
filevault decrypt secure.enc -o decrypted/# Xem thΓ΄ng tin file ΔΓ£ mΓ£ hΓ³a
filevault info document.pdf.enc
# Kiα»m tra tΓnh toΓ n vαΊΉn
filevault verify document.pdf.enc
# Kiα»m tra file cΓ³ bα» mΓ£ hΓ³a khΓ΄ng
filevault check document.pdf# MΓ£ hΓ³a nhiα»u file
filevault encrypt *.txt
filevault encrypt file1.pdf file2.docx file3.xlsx
# MΓ£ hΓ³a vα»i pattern
filevault encrypt reports/*.pdf -o encrypted/
filevault encrypt "*.{txt,doc,pdf}" -o secure/# Verbose output
filevault encrypt document.pdf --verbose
# Force overwrite
filevault encrypt document.pdf -f
# Keep original file
filevault encrypt document.pdf --keep
# Custom iterations
filevault encrypt document.pdf --iterations 200000
# Secure delete original
filevault encrypt document.pdf --secure-delete$ filevault encrypt financial_report.pdf --verbose
π FileVault v1.0 - Encrypting: financial_report.pdf
Enter password: ********
Confirm password: ********
π Generating salt and deriving key...
π Using AES-256-GCM with PBKDF2 (100,000 iterations)
π [ββββββββββββββββββββββββββββββββ] 100% | 2.4MB/2.4MB | 15MB/s
β
Successfully encrypted: financial_report.pdf β financial_report.pdf.enc
β±οΈ Time elapsed: 1.2s$ filevault info report.pdf.enc
π File Information
==================
File: report.pdf.enc
Original Name: financial_report.pdf
Format: FileVault v1.0
Algorithm: AES-256-GCM
Key Derivation: PBKDF2-SHA256 (100,000 iterations)
Original Size: 2.4 MB (2,458,624 bytes)
Encrypted Size: 2.4 MB (2,458,756 bytes)
Overhead: 132 bytes (0.005%)
Created: 2024-09-23 14:30:22 UTC
Status: β
Valid & Intact| Component | Algorithm | Parameters |
|---|---|---|
| Encryption | AES-256-GCM | 256-bit key, 128-bit auth tag |
| Key Derivation | PBKDF2-SHA256 | 100,000 iterations, 32-byte salt |
| Random Generation | crypto/rand | Cryptographically secure |
| Authentication | GCM Mode | Built-in authenticated encryption |
- π§ Unique Salt: Mα»i file cΓ³ 32-byte random salt riΓͺng biα»t
- π― Authenticated Encryption: GCM mode chα»ng tampering
- π§ Memory Security: Zero-ize sensitive data sau sα» dα»₯ng
- β‘ Constant-Time: Password comparison chα»ng timing attacks
- π Secure Random: Sα» dα»₯ng OS entropy pool
- π Input Validation: Comprehensive validation cho tαΊ₯t cαΊ£ inputs
FileVault ΔΓ£ Δược phΓ’n tΓch bαΊ£o mαΊt toΓ n diα»n. Xem chi tiαΊΏt tαΊ‘i:
# β
SỬ DỀNG MẬT KHẨU MẠNH
- Tα»i thiα»u 12 kΓ½ tα»±
- Bao gα»m chα»― hoa, thΖ°α»ng, sα», kΓ½ tα»± ΔαΊ·c biα»t
- KhΓ΄ng sα» dα»₯ng tα»« Δiα»n hoαΊ·c thΓ΄ng tin cΓ‘ nhΓ’n
# β
BαΊ’O QUαΊ’N AN TOΓN
- LΖ°u file encrypted α» nΖ‘i an toΓ n
- Backup mαΊt khαΊ©u mα»t cΓ‘ch bαΊ£o mαΊt
- KhΓ΄ng share mαΊt khαΊ©u qua kΓͺnh khΓ΄ng an toΓ n
# β
VERIFY INTEGRITY
- ChαΊ‘y 'filevault verify' Δα»nh kα»³
- Kiα»m tra file size vΓ timestamp
- Test decrypt trΖ°α»c khi xΓ³a file gα»cfilevault/
βββ cmd/filevault/ # CLI entry point
βββ internal/ # Private packages
β βββ crypto/ # Encryption algorithms
β βββ fileops/ # File I/O operations
β βββ security/ # Security utilities
β βββ cli/ # CLI handlers
β βββ core/ # Business logic
βββ pkg/filevault/ # Public API
βββ test/ # Test suites
βββ docs/ # Documentation
βββ scripts/ # Build scripts
- Language: Go 1.25+
- CLI Framework: Cobra
- Progress Bar: pb
- Cryptography: Go standard crypto libraries
- Testing: Go testing + testify
- Build: Make + GitHub Actions
FileVault sα» dα»₯ng custom binary format:
βββββββββββββββββββββββββββββββββββ
β Header (108+ bytes) β
β ββ Magic: "FVLT" (4 bytes) β
β ββ Version: uint32 (4 bytes) β
β ββ Algorithm: uint32 (4 bytes) β
β ββ Salt: [32]byte (32 bytes) β
β ββ IV: [16]byte (16 bytes) β
β ββ Original Size: uint64 (8) β
β ββ Filename Length: uint32 (4) β
β ββ Original Name: variable β
β ββ Reserved: [32]byte (32) β
β ββ Checksum: [16]byte (16) β
βββββββββββββββββββββββββββββββββββ€
β Encrypted Data (variable) β
βββββββββββββββββββββββββββββββββββ€
β Auth Tag: [16]byte (16 bytes) β
βββββββββββββββββββββββββββββββββββ
FileVault cΓ³ comprehensive test suite:
# ChαΊ‘y tαΊ₯t cαΊ£ tests
make test
# Unit tests
go test ./internal/...
# Integration tests
go test ./test/integration/...
# Benchmark tests
go test -bench=. ./test/benchmarks/...
# Coverage report
make test-coverage- Unit Tests: 95%+ coverage
- Integration Tests: End-to-end workflows
- Security Tests: Cryptographic validation
- Performance Tests: Speed vΓ memory benchmarks
- Cross-Platform Tests: Windows, Linux, macOS
# Crypto tests - Validate encryption/decryption
go test ./internal/crypto/... -v
# File operations - Test I/O operations
go test ./internal/fileops/... -v
# Security tests - Validate security measures
go test ./internal/security/... -v
# CLI tests - Test command-line interface
go test ./internal/cli/... -v# Setup development environment
git clone https://github.com/vuongdat67/NT140.Q11.ANTT-Group15.git
cd NT140.Q11.ANTT-Group15
make setup
# Install dependencies
go mod download
# Run in development mode
go run cmd/filevault/main.go --helpmake build # Build cho current platform
make build-all # Build cho tαΊ₯t cαΊ£ platforms
make clean # Clean build artifacts
make lint # Run code linting
make fmt # Format code
make test # Run test suite
make release # Create release buildFileVault cung cαΊ₯p public Go API:
package main
import (
"log"
"github.com/vuongdat67/NT140.Q11.ANTT-Group15/pkg/filevault"
)
func main() {
// Create client
client := filevault.NewClient(
filevault.WithVerbose(true),
)
// Encrypt file
err := client.EncryptFile("document.pdf", "mypassword")
if err != nil {
log.Fatal(err)
}
// Decrypt file
err = client.DecryptFile("document.pdf.enc", "mypassword")
if err != nil {
log.Fatal(err)
}
// Verify file
result, err := client.VerifyFile("document.pdf.enc")
if err != nil {
log.Fatal(err)
}
if result.IsValid() {
log.Println("File is valid!")
}
}| ThΓ nh viΓͺn | Vai trΓ² | ChuyΓͺn mΓ΄n |
|---|---|---|
| ToΓ n | Tech Lead | Architecture, Build System |
| ΔαΊ‘t | Security Expert | Cryptography, Security Analysis |
| QuΓ’n | CLI Developer | User Interface, File Operations |
| Trung | QA Engineer | Testing, Validation |
- Fork repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push branch (
git push origin feature/AmazingFeature) - Open Pull Request
- TuΓ’n thα»§ Go coding standards
- ViαΊΏt tests cho new features
- Update documentation
- Maintain security standards
- Follow semantic versioning
- ποΈ Architecture Guide - System design vΓ patterns
- π Security Analysis - Comprehensive security assessment
- π API Reference - CLI commands vΓ Go API
- βοΈ Development Guide - Setup vΓ development workflow
- π Basic Usage - Getting started examples
- π Batch Processing - Bulk operations
- π‘οΈ Security Guide - Security best practices
Q: "Authentication failed" error
A: Kiα»m tra mαΊt khαΊ©u vΓ file integrity
filevault verify file.encQ: "File not found" error
A: Kiα»m tra ΔΖ°α»ng dαΊ«n file
ls -la /path/to/fileQ: Slow performance trΓͺn file lα»n
A: Sα» dα»₯ng SSD vΓ Δα»§ RAM
Kiα»m tra disk space# Enable verbose output
filevault encrypt file.txt --verbose
# Check system info
filevault version --system
# Verify installation
filevault --help| File Size | Encrypt Time | Decrypt Time | Memory Usage |
|---|---|---|---|
| 1 MB | 0.1s | 0.1s | 8 MB |
| 10 MB | 0.5s | 0.4s | 12 MB |
| 100 MB | 4.2s | 3.8s | 24 MB |
| 1 GB | 42s | 38s | 64 MB |
Benchmark trΓͺn: Intel i7-8700K, 16GB RAM, NVMe SSD
FileVault Δược phΓ‘t hΓ nh dΖ°α»i MIT License.
MIT License
Copyright (c) 2024 NT140.Q11.ANTT Group 15
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- UIT University - Cung cαΊ₯p mΓ΄i trΖ°α»ng hα»c tαΊp
- NT140.Q11 Course - Network Security coursework
- Go Community - Excellent cryptography libraries
- Security Researchers - Inspiration vΓ best practices
π LiΓͺn Hα»
- π§ Email: nt140.group15@uit.edu.vn
- π GitHub: NT140.Q11.ANTT-Group15
- π Issues: GitHub Issues
π FileVault - BαΊ£o mαΊt file ΔΖ‘n giαΊ£n, hiα»u quαΊ£ vΓ an toΓ n π
Made with β€οΈ by NT140.Q11.ANTT Group 15