Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Password Manager

credits to Tech Raj (https://www.youtube.com/@TechRaj156)

A simple local password manager written in Python and MariaDB. Uses pbkdf2 to derive a 256 bit key from a MASTER PASSWORD and DEVICE SECRET to use with AES-256 for encrypting/decrypting.

Installation

You need to have python3 to run this on Windows, Linux or MacOS

Linux

Install Python Requirements

sudo apt install python3-pip
pip install -r requirements.txt

MariaDB

Install MariaDB on linux with apt

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

Create user 'pm' and grant permissions

Login to mysql as root

sudo mysql -u root

Create User

CREATE USER 'pm'@localhost IDENTIFIED BY 'password';

Grant privileges

GRANT ALL PRIVILEGES ON *.* TO 'pm'@localhost IDENTIFIED BY 'password';

Pyperclip

Pyperclip is a python module used to copy data to the clipboard. If you get a "not implemented error", follow this simple fix: https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error

Windows

Install Python Requirements

pip install -r requirements.txt

MariaDB

Install

Follow these instructions to install MariaDB on Windows

Create user and grant privileges

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

Run

Configure

You need to first configure the password manager by choosing a MASTER PASSWORD. This config step is only required to be executed once.

python config.py make

The above command will make a new configuration by asking you to choose a MASTER PASSWORD. This will generate the DEVICE SECRET, create db and required tables.

python config.py delete

The above command will delete the existing configuration. Doing this will completely delete your device secret and all your entries and you will loose all your passwords. So be aware!

python config.py remake

The above command will first delete the existing configuration and create a fresh new configuration by asking you to choose a MASTER PASSWORD, generate the DEVICE SECRET, create the db and required tables.

Usage

python pm.py -h
usage: pm.py [-h] [-s NAME] [-u URL] [-e EMAIL] [-l LOGIN] [--length LENGTH] [-c] option

Description

positional arguments:
  option                (a)dd / (e)xtract / (g)enerate / (i)mport / (d)elete / (m)odify

optional arguments:
  -h, --help            show this help message and exit
  -s NAME, --name NAME  Site name
  -u URL, --url URL     Site URL
  -e EMAIL, --email EMAIL
                        Email
  -l LOGIN, --login LOGIN
                        Username
  --length LENGTH       Length of the password to generate
  -c, --copy            Copy password to clipboard
  -f, --file            Used to import entries from a file

Add entry

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

Retrieve entry

python pm.py extract

The above command retrieves all the entries

python pm.py e -s mysite

The above command retrieves all the entries whose site name is "mysite"

python pm.py e -s mysite -l myusername

The above command retrieves the entry whose site name is "mysite" and username is "myusername"

python pm.py e -s mysite -l myusername --copy

The above command copies the password of the site "mysite" and username "myusername" into the clipboard

Generate Password

python pm.py g --length 15

The above command generates a password of length 15 and copies to clipboard

Import from file

For now it is necessary to save a file at the same level as pm.py The file should contain the following columns: site, url, username, password Then it is possible to run the following:

python pm.py i -f logins.csv

Delete entry

Delete entry by sitename:

python pm.py d -s mysite

Modify entry

The entry can be selected by sitename

python pm.py m -s mysite

Then it will be possible to modify one of the following: sitename, url, username, password

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages