Skip to main content

A secure local password manager

Project description

๐Ÿ” Password Manager

A secure Password Manager built with Python that securely stores your passwords locally using strong encryption.

๐Ÿš€ 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

๐Ÿ“‚ Project Structure

The project is organized into modules for maintainability and separation of concerns:

password-manager/
โ”œโ”€โ”€ [app.py](http://_vscodecontentref_/4)                 # CLI application entry point
โ”œโ”€โ”€ [gui.py](http://_vscodecontentref_/5)                 # GUI application entry point
โ”œโ”€โ”€ [initialize.py](http://_vscodecontentref_/6)          # Setup script
โ”œโ”€โ”€ [migrate_db.py](http://_vscodecontentref_/7)          # Database migration tool
โ”œโ”€โ”€ [requirements.txt](http://_vscodecontentref_/8)       # Python dependencies
โ”œโ”€โ”€ [setup.py](http://_vscodecontentref_/9)               # Packaging configuration
โ”œโ”€โ”€ utils/                 # Core utilities
โ”‚   โ”œโ”€โ”€ [auth.py](http://_vscodecontentref_/10)            # Authentication
โ”‚   โ”œโ”€โ”€ [backup.py](http://_vscodecontentref_/11)          # Import/export 
โ”‚   โ”œโ”€โ”€ [crypto.py](http://_vscodecontentref_/12)          # Encryption/decryption
โ”‚   โ”œโ”€โ”€ [database.py](http://_vscodecontentref_/13)        # Database operations
โ”‚   โ”œโ”€โ”€ [interactive.py](http://_vscodecontentref_/14)     # CLI input utilities
โ”‚   โ”œโ”€โ”€ [logger.py](http://_vscodecontentref_/15)          # Logging facilities
โ”‚   โ”œโ”€โ”€ [password_analysis.py](http://_vscodecontentref_/16) # Password evaluation
โ”‚   โ”œโ”€โ”€ [security_analyzer.py](http://_vscodecontentref_/17) # Breach checking
โ”‚   โ”œโ”€โ”€ [security_audit.py](http://_vscodecontentref_/18)  # Security auditing
โ”‚   โ”œโ”€โ”€ [two_factor.py](http://_vscodecontentref_/19)      # 2FA implementation
โ”‚   โ””โ”€โ”€ [ui.py](http://_vscodecontentref_/20)              # UI formatting
โ”œโ”€โ”€ tests/                 # Unit & integration tests
โ”‚   โ”œโ”€โ”€ [test_crypto.py](http://_vscodecontentref_/21)     
โ”‚   โ”œโ”€โ”€ [test_database.py](http://_vscodecontentref_/22)   
โ”‚   โ”œโ”€โ”€ [test_integration.py](http://_vscodecontentref_/23)
โ”‚   โ””โ”€โ”€ [test_password_analysis.py](http://_vscodecontentref_/24)
โ””โ”€โ”€ [README.md](http://_vscodecontentref_/25)              # Project documentation

๐Ÿ› ๏ธ Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/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 dependencies:

    pip install -r requirements.txt
    
  4. Run the application:

    python app.py
    

๐Ÿ›ก๏ธ Requirements

  • Python 3.8+
  • Libraries:
    • cryptography
    • colorama

Install them via:

pip install -r requirements.txt

๐Ÿ“ธ Screenshots

Home Screen

Home Screen

Adding a Password

Add Password

Editing a Password

Edit Password

Security Audit

Security Audit

Backup Options

Backup

Exporting Passwords

Export

Importing Passwords

Import


๐Ÿ“š Future Improvements

  • โœ… Add a Master Password authentication
  • โœ… Password strength evaluation and generator
  • โœ… Unit tests for critical functions
  • โœ… Backup and restore functionality
  • โœ… Add a search function for passwords
  • โœ… Add password categories/tags
  • โœ… Add password expiration notifications
  • โœ… GUI version (PyQT)
  • Two-factor authentication
  • Password history tracking
  • Cross-platform desktop application (using PyInstaller)
  • Docker support

๐Ÿ”’ 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 in CBC mode with PKCS7 padding).

  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

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


Create a MIT license file

curl https://opensource.org/licenses/MIT > LICENSE

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.5.0.tar.gz (38.5 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.5.0-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secure_password_manager-1.5.0.tar.gz
  • Upload date:
  • Size: 38.5 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.5.0.tar.gz
Algorithm Hash digest
SHA256 ed0cf93700594831bf9e4518beaf1f5116e09a94f94a4efe4da29169008937aa
MD5 952ca55c662aed4d9e8ff6085f04b3d3
BLAKE2b-256 0bda1deea65e6d862fa237b25228a55d6a426ca7288b803071fff7a88d941b3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for secure_password_manager-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9802b369cc03c3ceb86dca54ca9c110f06b71aea9278e145917ab26c293409c1
MD5 ddf6bc2a3c369954c42ec6e359f108f0
BLAKE2b-256 20479725da224ddb4ef93adbafb33c490872a631a1622e1220ccb2445289b3a5

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