Skip to content

A script that make use of passlib library for hashing strings

Notifications You must be signed in to change notification settings

Edmartt/password-hasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PASSWORD HASHER

A script that ask the user for an input and use the hash function from passlib library. The main purpose of this project is to use a more secure way of storing users data like passwords in databases.

Install

after clonning, follow this instructions:

On Windows:

$ python -m venv name of the virtualenv
$ env\Scripts\activate
$ pip install requirements.txt
$ set DB_HOST=your localhost
$ set DB_USER=your MySQL/MariaDB user
$ set DB_PASSWORD=your MySQL/MariaDB password
$ set DB_NAME= your database name

On Linux:

$ python -m venv name of the virtualenv
$ . env\Scripts\activate
$ pip install requirements.txt
$ export DB_HOST=your localhost
$ export DB_USER=your MySQL/MariaDB user
$ export DB_PASSWORD=your MySQL/MariaDB password
$ export DB_NAME= your database name

Running

On Windows:

$ python main.py

On Linux:

$ python3 main.py

Example of use:

 $ python(3) main.py
 
 $ Type your plaintext password (it won't be echoed):

 $ Your hashed password: $pbkdf2-sha256$29000$4pwzppRyTkmpdQ4hhJBSig$Yg/yq9VWkrN5NF6phWiN336r.GnwdoGqSkzsOjS8xmo

 $ Password stored in database

Testing

Coverage:

$ coverage run --source=hashing,password.py -m unittest

Note

  • The name passwords is needed for the table used in the database.