Coder Social home page Coder Social logo

passwordhasher's Introduction

passwordhasher

Password hashing module for python.

This module has just three functions. The first one is for checking if the password is secure enough, which means that the password meets at least three of the following four criteria:

  1. Password contains at least one uppercase character (A-Z)
  2. Password contains at least one lowercase character (a-z)
  3. Password contains at least one digit (0-9)
  4. Password contains at least one special character (.,#$&*, etc.)

Additionaly:

  1. Password must not contain more than two identical characters in a row, e.g. "aaa"
  2. Password must not be less than 10 characters short
  3. Password must not be more than 128 characters long

The module also provides an example function for generating password hashes, and a function to generate pseudo random hashing salt.

Tutorial

Check the password strength

from passwordhasher import is_password_secure

is_secure = is_password_secure('weak password')

Create pseudo random salt for password hashing

from passwordhasher import create_random_password_salt

salt = create_random_password_salt()

Get password hash

from passwordhasher import get_password_hash

stored_password_hash = ... # Get it from database
stored_password_salt = ... # Get it from database
entered_password = ... # Get the user entered password

computed_hash = get_password_hash(stored_password_salt, entered_password)

if computed_hash == stored_password_hash:
    # This user has provided the correct password.
    

passwordhasher's People

Contributors

drzymalanet avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.