Skip to content

SanielDev/local-password-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Password Manager

Welcome to the Python Password Manager — your personal vault for securely managing passwords, powered by the robust combination of Python and MariaDB. Whether you're tired of forgetting passwords or juggling dozens of them, this tool simplifies your digital life with cutting-edge security built right in.

At its core, the password manager leverages PBKDF2 (Password-Based Key Derivation Function 2) to transform your MASTER PASSWORD and a DEVICE SECRET (a unique code tied to your device) into a powerful 256-bit encryption key. This key acts as the ultimate lock-and-key system, ensuring that your passwords are safely encrypted using AES-256, one of the most trusted encryption standards today.

With this password manager, your sensitive information is locked away in a local database that only you can access — no cloud storage, no third-party access — just you and your securely encrypted data.

Plus, with a command-line interface that’s easy to use and lightning-fast, managing your passwords is not only secure but also fun and efficient. Take control of your digital security while exploring the exciting world of encryption and databases!


Features

  • Strong AES-256 encryption for password security.
  • User-friendly command-line interface for adding, retrieving, and generating passwords.
  • Secure storage of credentials in a local MariaDB database.
  • Copy passwords directly to the clipboard using Pyperclip.

Table of Contents


Installation

Requirements:

  • Python 3.x
  • MariaDB
  • Pyperclip (for clipboard functionality)

Linux

  1. Install Python Requirements:

    sudo apt install python3-pip
    pip install -r requirements.txt
  2. Install MariaDB:

    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
    sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntuprecise main'
    sudo apt-get update
    sudo apt-get install mariadb-server
  3. Create MariaDB User:

    • Login as root:
      sudo mysql -u root
    • Create a user:
      CREATE USER 'pm'@localhost IDENTIFIED BY 'password';
    • Grant necessary privileges:
      GRANT ALL PRIVILEGES ON *.* TO 'pm'@localhost IDENTIFIED BY 'password';
  4. Pyperclip Fix (if needed): If you encounter a "not implemented error", follow this guide.

Windows

  1. Install Python Requirements:

    pip install -r requirements.txt
  2. Install MariaDB: Follow this guide for installation on Windows.

  3. Create MariaDB User:

    • Navigate to the MariaDB bin directory:
      C:\Program Files\MariaDB\bin
    • Login as root:
      mysql.exe -u root -p
    • Create a user:
      CREATE USER 'pm'@localhost IDENTIFIED BY 'password';
    • Grant privileges:
      GRANT ALL PRIVILEGES ON *.* TO 'pm'@localhost IDENTIFIED BY 'password';

Configuration

Before using the password manager, you need to configure it by setting up a MASTER PASSWORD.

  1. Create Configuration: Run the following command to set up the MASTER PASSWORD and generate the DEVICE SECRET. This also creates the necessary database and tables.

    python config.py make
  2. Delete Configuration: Warning: This will permanently delete all saved passwords.

    python config.py delete
  3. Remake Configuration: This will delete the existing setup and create a new configuration.

    python config.py remake

Usage

After configuration, you can use the password manager to add, retrieve, or generate passwords. Below are the common commands:

Command Help

python pm.py -h

This displays all available options for adding, retrieving, and generating passwords.

Adding Entries

To add a new entry for a site:

python pm.py add -s mysite -u mysite.com -e hello@email.com -l myusername

Retrieving Entries

  • Retrieve all entries:
    python pm.py extract
  • Retrieve entries by site name:
    python pm.py e -s mysite
  • Retrieve a specific entry by site name and username:
    python pm.py e -s mysite -l myusername
  • Copy the password of a specific entry to the clipboard:
    python pm.py e -s mysite -l myusername --copy

Generating Passwords

To generate a random password and copy it to the clipboard:

python pm.py g --length 15

License

This project is licensed under the MIT License.


Contributing

Contributions are welcome! Please open an issue or submit a pull request if you'd like to improve the code or documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published