A secure, local-first password manager with military-grade encryption and image steganography capabilities.
Passwault is a command-line password manager that prioritizes security and privacy. All passwords are encrypted with AES-256-GCM before being stored locally, and your master password never leaves your machine. The unique image steganography feature allows you to hide passwords in plain sight by encoding them into image files.
- ๐ Military-Grade Encryption: AES-256-GCM encryption with PBKDF2 key derivation (600,000 iterations)
- ๐ค Multi-User Support: Separate encrypted vaults for multiple users with data isolation
- ๐จ Image Steganography: Hide passwords in images using LSB (Least Significant Bit) encoding
- โก Session Management: Secure sessions with automatic timeout (10 minutes)
- ๐ Zero-Knowledge Architecture: Master password and encryption keys never persisted to disk
- ๐ก๏ธ Authenticated Encryption: AES-GCM provides both confidentiality and authenticity
- ๐ Password Generation: Cryptographically secure random password generation
- ๐ฆ Local Storage: SQLite database - no cloud, no third parties
-
Clone the repository (if not already done):
git clone <repository-url> cd passwault-project
-
Install dependencies with uv (recommended) or poetry:
# Using uv (recommended) uv sync # Install the package in editable mode uv pip install -e . # Or using poetry poetry install poetry shell
-
Verify installation:
uv run passwault --help # Or if using poetry shell passwault --helpYou should see the help menu with all available commands.
-
Optional: Install clipboard tool (for auto-copy feature):
# Linux (X11) sudo apt install xclip # or sudo apt install xsel # macOS - pbcopy is pre-installed # WSL2 - clip.exe works if Windows interop is enabled # Otherwise install xclip/xsel as above
-
Register a new account:
uv run passwault auth register -u yourname # You'll be prompted for a master password -
Login to your account:
uv run passwault auth login -u yourname # Enter your master password when prompted -
Add your first password:
uv run passwault add -n github -p "your_github_password" -u "your_username"
-
Retrieve your password:
uv run passwault get -n github
By default, Passwault uses SQLite and stores data in ~/.passwault/. For advanced users, PostgreSQL is also supported.
Passwault loads database configuration in this order:
- Environment variable (highest priority):
DATABASE_URL - Config file:
~/.config/passwault/.env - Default: SQLite at
~/.passwault/passwault.db
export DATABASE_URL="postgresql://user:password@localhost:5432/passwault"
passwault auth login -u yournameCreate a config file at ~/.config/passwault/.env:
mkdir -p ~/.config/passwault
echo 'DATABASE_URL="postgresql://user:password@localhost:5432/passwault"' > ~/.config/passwault/.envThis is the recommended approach when installing passwault as a uv tool:
uv tool install passwault
passwault auth login -u yourname # Uses config from ~/.config/passwault/.envIf no DATABASE_URL is set, Passwault automatically uses SQLite:
passwault auth register -u yourname # Data stored in ~/.passwault/passwault.dbpasswault auth register -u <username> [-p <password>] [-e <email>]
# Example
passwault auth register -u john -e john@example.com
# Password will be prompted securely if not providedpasswault auth login -u <username> [-p <password>]
# Example
passwault auth login -u john
# Password will be prompted securely if not providedpasswault auth logoutpasswault auth change-password [-o <old-password>] [-n <new-password>]
# Example (will prompt for passwords)
passwault auth change-passwordNote: This command re-encrypts all your stored passwords with the new encryption key derived from your new master password.
passwault add -n <resource-name> -p <password> [options]
Options:
-u, --username Username associated with this password
-w, --website Website URL
-d, --description Description
-t, --tags Comma-separated tags
# Examples
passwault add -n github -p "mypassword123" -u "john"
passwault add -n aws -p "complex_pass" -w "https://aws.amazon.com" -t "cloud,work"# Get by resource name
passwault get -n <resource-name>
# Get all passwords for a username
passwault get -u <username>
# Get all passwords
passwault get -a
# Examples
passwault get -n github
passwault get -u john
passwault get -apasswault update -n <resource-name> -p <new-password> [options]
# Example
passwault update -n github -p "new_password456" -w "https://github.com"passwault delete -n <resource-name>
# Example
passwault delete -n old_accountGenerate a cryptographically secure random password:
passwault generate [options]
Options:
-l, --length Password length (default: 16)
--no-symbols Exclude symbols
--no-digits Exclude digits
--no-uppercase Exclude uppercase letters
# Examples
passwault generate
passwault generate -l 32
passwault generate -l 20 --no-symbolsHide passwords inside images using LSB (Least Significant Bit) steganography.
passwault imagepass encode <image_path> -p <password>
# Example
passwault imagepass encode photo.png -p "my_secret_password"
# Creates: results/photo.png with hidden passwordpasswault imagepass decode <image_path>
# Example
passwault imagepass decode results/photo.png
# Output: my_secret_passwordSupported Image Formats: PNG, BMP (lossless formats only - JPEG compression will destroy hidden data)
Master Password (user input)
โโโ bcrypt hash โ stored in users.master_password_hash (authentication)
โโโ PBKDF2-SHA256 + salt โ encryption_key (in-memory only)
โโโ AES-256-GCM โ encrypted_password + nonce (stored in DB)
-
Master Password Protection
- Never stored (only bcrypt hash)
- Verified using constant-time comparison
- High bcrypt cost factor (12) prevents brute force
-
Encryption Key Derivation
- PBKDF2-HMAC-SHA256 with 600,000 iterations (OWASP 2023 recommendation)
- Unique 32-byte salt per user
- Encryption key exists only in memory during active session
-
Password Encryption
- AES-256-GCM (authenticated encryption)
- Unique nonce per password entry
- Tamper detection via GCM authentication tag
-
Session Security
- 10-minute automatic timeout
- Encryption keys cleared on logout/timeout
- Session file encrypted (does not contain encryption key)
-
Multi-User Isolation
- Each user has unique salt and encryption key
- Foreign key constraints enforce data isolation
- No cross-user password access
Protected Against:
- โ Database theft (passwords encrypted with user-specific keys)
- โ SQL injection (SQLAlchemy ORM parameterization)
- โ Timing attacks (bcrypt constant-time comparison)
- โ Brute force attacks (high KDF iterations)
- โ Password tampering (GCM authentication)
- โ Session hijacking (encrypted session files)
Not Protected Against:
- โ Keyloggers on compromised systems
- โ Memory dumps while session is active
- โ Physical access to unlocked system
- โ Master password compromise (use a strong master password!)
passwault/
โโโ core/
โ โโโ commands/ # CLI command implementations
โ โ โโโ authenticator.py # Register, login, logout, change password
โ โ โโโ password.py # Add, get, update, delete, generate
โ โโโ database/ # Data layer
โ โ โโโ models.py # SQLAlchemy models (User, PasswordManager)
โ โ โโโ user_repository.py # User CRUD operations
โ โ โโโ password_manager.py # Password CRUD operations
โ โโโ services/ # Business logic
โ โ โโโ crypto_service.py # Cryptography operations
โ โโโ utils/ # Utilities
โ โ โโโ decorators.py # @require_auth decorator
โ โ โโโ session_manager.py # Session handling
โ โ โโโ local_types.py # Custom exception classes
โ โ โโโ logger.py # Logging utilities
โ โโโ cli.py # Argument parser
โโโ imagepass/ # Steganography module
โ โโโ embedder.py # LSB encoding/decoding
โ โโโ utils/
โ โโโ image_handler.py # Image manipulation
โโโ tests/ # Comprehensive test suite
Passwault includes a comprehensive test suite with 247 tests covering:
- Authentication flows
- Encryption/decryption
- Password operations
- Session management
- Multi-user isolation
- Image steganography
- Error handling
Run the test suite:
# Run all tests
uv run pytest tests/ -v
# Run with coverage report
uv run pytest tests/ --cov=passwault --cov-report=html
# Run specific test suite
uv run pytest tests/test_authenticator.py -v
uv run pytest tests/test_crypto_service.py -v
uv run pytest tests/imagepass/ -vThe project uses modern Python tooling:
- Linting: flake8 (max line length: 100)
- Formatting: black
- Type Hints: Throughout codebase
- Testing: pytest with high coverage
Run code quality checks:
# Format code
uv run black passwault tests
# Lint code
uv run flake8 passwault tests --max-line-length=100
# Run tests
uv run pytest tests/ -v- Repository Pattern: Clean separation between data access and business logic
- Decorator Pattern:
@require_authfor authentication enforcement - Custom Exceptions: Typed exception hierarchy for clear error handling
- Dependency Injection: Session managers and services passed explicitly
-
REST API Backend
- Convert to client-server architecture
- JWT-based API authentication
- Zero-knowledge design (server never sees decrypted passwords)
- Keep client-side encryption
-
Enhanced CLI
- Interactive TUI (Terminal User Interface)
- Password search and filtering
- Password strength analysis
- Import/export functionality
-
Additional Security
- 2FA/TOTP support
- Hardware key (YubiKey) integration
- Password breach checking (Have I Been Pwned API)
- Secure password sharing
-
Cloud Sync
- Optional encrypted cloud backup
- End-to-end encryption
- Multi-device synchronization
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for new functionality
- Ensure all tests pass (
uv run pytest tests/) - Follow code style (black + flake8)
- Submit a pull request
This project is open source. Please check the LICENSE file for details.
While Passwault uses industry-standard cryptography (AES-256-GCM, PBKDF2, bcrypt), it has not undergone a professional security audit. Use at your own risk. For critical passwords, consider using established password managers like Bitwarden or 1Password.
Important:
- Never forget your master password (it cannot be recovered)
- Use a strong, unique master password
- Keep your system secure (antivirus, firewall, updates)
- Regular backups recommended (encrypted database is in
~/.passwault/)
For issues, questions, or feature requests:
- Check the documentation
- Search existing issues on GitHub
- Open a new issue with details
Zero Trust: Your master password and encryption keys never leave your machine. No cloud, no third parties, complete control.
Open Source: Full transparency. Review the code, audit the cryptography, verify the security model.
Educational: Learn about modern cryptography, key derivation, authenticated encryption, and steganography through a real-world application.
Unique Features: Image steganography sets Passwault apart - hide passwords in plain sight for an additional layer of obfuscation.
Built with ๐ and โค๏ธ for security-conscious users.