Zero-Trust Distributed Password Manager - A secure, offline-first password manager with WebDAV synchronization.
- End-to-End Encryption: AES-256-GCM encryption for all data
- Argon2id KDF: Modern key derivation function with device-specific parameters
- Double Envelope Encryption: KEK/DEK separation for key rotation support
- TEE Integration: Hardware-backed key storage (Secure Enclave / StrongBox)
- Constant-Time Operations: Side-channel attack resistance
- Secure Memory: Automatic sensitive data wiping with DoD 5220.22-M compliance
- Event Sourcing: Immutable event log for data consistency
- CRDT Merge: Conflict-free replicated data types for offline-first operation
- HLC Timestamps: Hybrid Logical Clocks for causal ordering
- WebDAV Sync: Multi-node backup with priority-based synchronization
- Snapshots: Automatic compaction and state snapshots
- Local-First Design: Full functionality without network
- SQLite + SQLCipher: Encrypted local database
- Blind Index Search: Privacy-preserving search capability
- Automatic Sync: Background synchronization when online
┌─────────────────────────────────────────────────────────────┐
│ Presentation Layer (Flutter UI) │
├─────────────────────────────────────────────────────────────┤
│ Application Layer (Vault Service) │
├─────────────────────────────────────────────────────────────┤
│ Domain Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Crypto Svc │ │ Event Svc │ │ CRDT Merger │ │
│ └──────────────┘ └──────────────┘ └──────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Infrastructure Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ SQLCipher │ │ WebDAV │ │ TEE/HSM │ │
│ └──────────────┘ └──────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Flutter SDK >= 3.16.0
- Dart SDK >= 3.0.0
- Android SDK (for Android builds)
- Xcode (for iOS builds)
- Clone the repository:
git clone https://github.com/yourusername/ztd-password-manager.git
cd ztd-password-manager- Install dependencies:
flutter pub get- Run the app:
# For Android
flutter run
# For iOS
flutter run -d ios# Android APK
flutter build apk --release
# Android App Bundle
flutter build appbundle --release
# iOS
flutter build ios --releaseConfigure WebDAV nodes in Settings > Synchronization:
-
Primary Node (Real-time sync)
- URL:
https://your-webdav-server.com - Username: Your username
- Password: Your password
- URL:
-
Secondary Nodes (Backup)
- Configure additional nodes for redundancy
- Supports: Nextcloud, ownCloud,坚果云, etc.
- Biometric Auth: Enable Face ID / Touch ID in Settings > Security
- Auto-Lock: Set automatic vault lock timeout
- Password Requirements: Configure minimum password strength
lib/
├── core/
│ ├── crypto/ # Cryptographic services
│ ├── crdt/ # CRDT merge logic
│ ├── events/ # Event sourcing
│ ├── hlc/ # Hybrid Logical Clock
│ ├── models/ # Data models
│ ├── security/ # Security utilities
│ ├── storage/ # Database layer
│ └── sync/ # WebDAV synchronization
├── services/
│ └── vault_service.dart # Main business logic
├── ui/
│ ├── screens/ # UI screens
│ ├── widgets/ # Reusable widgets
│ └── viewmodels/ # State management
└── main.dart
# Run unit tests
flutter test
# Run with coverage
flutter test --coverage| Threat | Mitigation |
|---|---|
| Physical Device Access | TEE-backed key storage, memory wiping |
| Network Eavesdropping | End-to-end encryption, no plaintext over network |
| Brute Force | Argon2id with device-specific parameters |
| Side-Channel Attacks | Constant-time algorithms |
| Data Loss | Multi-node WebDAV backup |
- KEK (Key Encryption Key): Derived from master password, stored in TEE
- DEK (Data Encryption Key): Random 256-bit key, encrypted by KEK
- Search Key: Separate key for blind index generation
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PointyCastle for Dart cryptography
- SQLCipher for encrypted database
- WebDAV for synchronization
This is a proof-of-concept implementation. For production use, additional security audits and testing are recommended. Always backup your data and keep your master password secure.