jonjpbm / pyPasswordValidator

My simply python password validation script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyPasswordValidator

My simple python password validation script to take over the world.

A simple program to detect if a password meets the NIST requirements.

  1. Have an 8 character minimum
  2. AT LEAST 64 character maximum
  3. Allow all ASCII characters and spaces (unicode optional)
  4. Not be a common password

Installation

To install this cool app, you can:

  • Clone repo from my github
git clone https://github.com/jonjpbm/pyPasswordValidator  
  • Download the zip file
wget https://github.com/jonjpbm/pyPasswordValidator/archive/main.zip  
  • Pip install
pip3 install pyPasswordValidator --user  

Usage

Setup

The script accepts input from STDIN in newline delimited format and will take a file of newline delimited common passwords and efficiently check if a password is in that file If you would like, you can use this common password list to compare you list of passwords

wget https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt

Create a list of passwords you want to test:

cat > small_input.txt  
2small  
l;ksjaofieuaorihno234j23u8r9u3459328f9aaf89234289h98234us9ga8ert923r8a9gje8w9r3tr2j;o32ijq42oqijg8ewoa4ur8439q324gj9849gjao4i  
भारतभारतभारत  
password1

You can either:

  • Import the module and use the methods
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyPasswordValidator.pyPasswordValidator as pv
>>> pv.is_ascii('teststring')
True
  • Can run the script as is
cat small_input.txt | python3 pyPasswordValidator.py 10-million-password-list-top-1000000.txt  
2small -> Error: Too Short  
l;ksjaofieuaorihno234j23u8r9u3459328f9aaf89234289h98234us9ga8ert923r8a9gje8w9r3tr2j;o32ijq42oqijg8ewoa4ur8439q324gj9849gjao4i -> Error: Too Long  
************ -> Error: Invalid Charaters  
password1 -> Error: Too Common 

Testing

cd pyPasswordValidator/pyPasswordValidator/
python3 test_pyPasswordValidator.py 

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

My simply python password validation script

License:MIT License


Languages

Language:Python 100.0%