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/
โ”œโ”€โ”€ apps/                  # Application code
โ”‚   โ”œโ”€โ”€ __init__.py        # Package initialization
โ”‚   โ”œโ”€โ”€ app.py             # CLI application entry point
โ”‚   โ””โ”€โ”€ gui.py             # GUI application entry point
โ”œโ”€โ”€ 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.6.0.tar.gz (38.4 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.6.0-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secure_password_manager-1.6.0.tar.gz
  • Upload date:
  • Size: 38.4 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.6.0.tar.gz
Algorithm Hash digest
SHA256 8591e69209dd646bbd4e4ca8abb50bb054547c3a029e8b03f8eb0e0203dba323
MD5 e45e6fef78fccf9efcd62f5ccce39c37
BLAKE2b-256 5dfb0576b464fd930cab12e59850585dcdd1722fafa3acee7960e1c29c9b4ef1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for secure_password_manager-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18596dc39280eff2f1c4f645dda90d804a44c9134b1f54d941b1b49be5f4ade0
MD5 2fbf658e30ecb20df3c7f792dd25709f
BLAKE2b-256 775907013b98a27ed21b6496a495dc02407b93758feb1491d13ef6a10ffb3369

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