Skip to main content

A secure local password manager with strong encryption

Project description

๐Ÿ” Secure Password Manager

A local-first Password Manager built with Python that securely stores your passwords using strong encryption.

Current version: see VERSION.txt (v1.8.0)

๐Ÿ†• What's New in v1.8.0:

  • KDF versioning for future-proof key derivation
  • Optional key protection with master password (encrypt secret.key)
  • Export integrity HMAC to detect tampering
  • Bulk import transactions for faster, lock-free restore
  • See v1.8.0 improvements for details

๐Ÿš€ Features

  • Secure Storage: All passwords encrypted with Fernet symmetric encryption
  • Password Management: Add, view, edit, and delete passwords
  • Security Analysis: Password strength evaluation and suggestions
  • Password Generator: Create strong, random passwords
  • Master Password: Protect access with a master password
  • Two-Factor Authentication: Additional security with TOTP (Time-based One-Time Password)
  • Categorization: Organize passwords by category
  • Security Audit: Find weak, reused, expired, or breached passwords
  • Backup & Restore: Export/import functionality
  • Password Expiration: Set expiry dates for passwords
  • Command-Line Interface: User-friendly CLI with color formatting
  • GUI Interface: Optional PyQt5 graphical interface
  • Activity Logging: Track all important actions

๐Ÿ“š Documentation

Comprehensive project documentation is organized in the docs/ folder:

For Users

For Developers

Build Documentation

๐Ÿ› ๏ธ Installation

Option 1: Install from PyPI (Recommended)

The simplest way to install Secure Password Manager:

pip install secure-password-manager

After installation, you can run the application with:

# For the command-line interface
password-manager

# For the graphical interface
password-manager-gui

Option 2: Install from Source

  1. Clone the repository:

    git clone https://github.com/ArcheWizard/password-manager.git
    cd password-manager
    
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate   # On Windows: venv\Scripts\activate
    
  3. Install the package in development mode:

    pip install -e .
    
  4. If upgrading from an older version, run the migration script:

    python scripts/migrate_to_new_structure.py
    

    This will move existing data files to the new .data/ directory.

๐Ÿ›ก๏ธ Requirements

  • Python 3.8+
  • Core dependencies (installed automatically):
    • cryptography: For secure encryption
    • PyQt5: For the GUI interface
    • zxcvbn: For password strength analysis
    • pillow: For image processing
    • Additional dependencies as listed in requirements.txt

๐Ÿ“‚ Project Structure

The project follows PEP 517 src/ layout for better packaging and distribution:

password-manager/
โ”œโ”€โ”€ src/                   # Source code (PEP 517 layout)
โ”‚   โ””โ”€โ”€ secure_password_manager/
โ”‚       โ”œโ”€โ”€ __init__.py    # Package initialization
โ”‚       โ”œโ”€โ”€ apps/          # Application entry points
โ”‚       โ”‚   โ”œโ”€โ”€ app.py     # CLI application
โ”‚       โ”‚   โ””โ”€โ”€ gui.py     # GUI application
โ”‚       โ””โ”€โ”€ utils/         # Core utilities
โ”‚           โ”œโ”€โ”€ auth.py            # Authentication
โ”‚           โ”œโ”€โ”€ backup.py          # Import/export
โ”‚           โ”œโ”€โ”€ crypto.py          # Encryption/decryption
โ”‚           โ”œโ”€โ”€ database.py        # Database operations
โ”‚           โ”œโ”€โ”€ interactive.py     # CLI input utilities
โ”‚           โ”œโ”€โ”€ logger.py          # Logging facilities
โ”‚           โ”œโ”€โ”€ password_analysis.py # Password evaluation
โ”‚           โ”œโ”€โ”€ paths.py           # Path management (XDG)
โ”‚           โ”œโ”€โ”€ security_analyzer.py # Breach checking
โ”‚           โ”œโ”€โ”€ security_audit.py  # Security auditing
โ”‚           โ”œโ”€โ”€ two_factor.py      # 2FA implementation
โ”‚           โ””โ”€โ”€ ui.py              # UI formatting
โ”œโ”€โ”€ tests/                 # Unit & integration tests
โ”œโ”€โ”€ docs/                  # Documentation
โ”‚   โ”œโ”€โ”€ development/       # Technical documentation
โ”‚   โ”œโ”€โ”€ build/             # Build instructions
โ”‚   โ””โ”€โ”€ releases/          # Release notes
โ”œโ”€โ”€ scripts/               # Build and utility scripts
โ”œโ”€โ”€ assets/                # Static assets
โ”‚   โ”œโ”€โ”€ icons/             # Application icons
โ”‚   โ””โ”€โ”€ screenshots/       # UI screenshots
โ”œโ”€โ”€ .data/                 # Development data (gitignored)
โ””โ”€โ”€ pyproject.toml         # Project configuration

Data Storage

The application uses XDG Base Directory Specification for organized data storage:

Development Mode (when running from source):

  • All data stored in .data/ directory in project root

Production Mode (when installed via pip):

  • Data files: ~/.local/share/secure-password-manager/
  • Config files: ~/.config/secure-password-manager/
  • Cache files: ~/.cache/secure-password-manager/
  • Log files: ~/.local/share/secure-password-manager/logs/

๐Ÿ“ธ Screenshots

First Time Setup

First Time Setup Setting Master Password Weak Password Warning Password Confirmation Setup Complete

Login

Login Screen

Home Screen

Home Screen

Password Management

Adding a Password Editing a Password

Categories

Categories

Security Audit

Security Audit

Backup & Restore

Backup Options Exporting Passwords Importing Passwords

Settings & Logs

Settings Activity Logs

๐Ÿ”’ How It Works

Security Model

This Password Manager uses a multi-layered security approach:

  1. Master Password: Access to the application is protected by a master password that is never stored directly. Instead, a salted hash is stored using PBKDF2 with 100,000 iterations.

  2. Encryption: All passwords are encrypted using Fernet symmetric encryption (AES-128-CBC + HMAC integrity, via cryptography).

  3. Key Management: The encryption key is stored locally and is used for encrypting/decrypting the stored passwords.

  4. Database: Passwords are stored in a local SQLite database, with the password values stored as encrypted binary data.

  5. Backup Protection: When exporting passwords, the entire backup file is encrypted using the same strong encryption.

Data Flow

  1. When adding a password:

    • Password is encrypted using the local key
    • Encrypted data is stored in the SQLite database
  2. When viewing passwords:

    • Encrypted data is retrieved from the database
    • Each password is decrypted for display
  3. When exporting passwords:

    • All passwords are decrypted
    • The entire password list is serialized to JSON
    • The JSON is encrypted and written to a file

๐Ÿงช Testing

pytest -q

Notes:

  • Integration tests use temporary databases and patch DB_FILE
  • Network-dependent breach checks are limited and resilient to failures
  • SQLite can lock under concurrent operations; tests include small delays/workarounds

๐Ÿ—บ๏ธ Roadmap (excerpt)

See docs/roadmap.md for the full plan. Highlights:

  • Derive or protect secret.key using the master password (or OS keyring)
  • Stronger KDF defaults (Argon2id/scrypt) with parameter versioning
  • Improved import/restore reliability and integrity verification
  • Clipboard auto-clear and additional UX hardening

๐Ÿ“ Changelog

See CHANGELOG.md for release notes.

๐Ÿ“š Future Improvements (historical)

  • โœ… Master Password authentication
  • โœ… Password strength evaluation and generator
  • โœ… Unit tests for critical functions
  • โœ… Backup and restore functionality
  • โœ… Search
  • โœ… Categories/tags
  • โœ… Password expiration notifications
  • โœ… GUI version (PyQt)
  • โœ… Package available on PyPI
  • โœ… Two-factor authentication (TOTP)
  • Password history tracking
  • Cross-platform desktop application (PyInstaller)
  • Docker support

๐Ÿ‘จโ€๐Ÿ’ป Author

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


For security considerations and design details, start with docs/security.md and docs/architecture.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secure_password_manager-1.8.2.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secure_password_manager-1.8.2-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file secure_password_manager-1.8.2.tar.gz.

File metadata

  • Download URL: secure_password_manager-1.8.2.tar.gz
  • Upload date:
  • Size: 52.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for secure_password_manager-1.8.2.tar.gz
Algorithm Hash digest
SHA256 ecba95991da14243cad662674689eb8598ecc88f2f40339545b4af681a0ebe07
MD5 6221152ae427cc90e10d6fd95224c0d1
BLAKE2b-256 8423d9ea9febf4a44a9e81f6a5360e4a958b5abc84e28019ceaddba2bda06743

See more details on using hashes here.

File details

Details for the file secure_password_manager-1.8.2-py3-none-any.whl.

File metadata

File hashes

Hashes for secure_password_manager-1.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f2d606ac4e1f83e75df51485d274f2ec2dc0e854a3da8a2aa53d3de92cb85a1
MD5 2002a44db1d1c34a7aa5078fcc891219
BLAKE2b-256 8e4991cc904c791cca2c58f943288b9bef3251fbcdb663c7c46b57b36781eb71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page