A better way to get passwords from users in python
- a secure way to read passwords from users
- check password strength and length
- custom prompt and mask
You can either install from pypi or the source code
- Using pip
pip install getpw
- from the source code
git clone https://github.com/n0x1s/getpw
cd getpw
pip install -e .
Let us suppose you want to get a password or a secret token from the user without exposing him
>>> from getpw import getpw
>>> getpw()
> Enter Password: ***********
- prompt : message that will be showen to the user -> default 'Enter Password: '
- mask : char that will replace password chars -> default '*'
- minlength : the minimum length -> default 1
- minlength : the maximum length -> default 32
- delay : delay in seconds -> default None
- strong: check if password strong -> default False
I will try to maintain this respiratory and update or add new things to it you are welcome to contribute
And, as always have a beautiful day!