GithubHelp home page GithubHelp logo

alex-repos / flask-scrypt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cryptojuice/flask-scrypt

0.0 2.0 0.0 830 KB

Flask-Scrypt flask extension provides scrypt password hashing and random salt generation.

Home Page: http://flask-scrypt.readthedocs.org/en/latest/

License: MIT License

flask-scrypt's Introduction

Flask-Scrypt

Build Status

Flask-Scrypt is a Flask extension used to generate scrypt password hashes and random salts. For those looking for extra security compared to SHA-1 and MD5 encryption. Flask-Scrypt depends on py-scrypt which should install automatically but can be installed manually using pip install scrypt.

Installation

$ pip install flask-scrypt

Usage

from flask.ext.scrypt import generate_password_hash, generate_random_salt, check_password_hash

Generate random salt for use with the generate_password_hash function. You will want to store this salt with the rest of your users database information. This salt along with the generated hash will be used to check the password later on.

salt = generate_random_salt()
password_hash = generate_password_hash('mypassword', salt)

Pull stored salt and password_hash from database:

salt = 'Users salt you stored in database'
password_hash = 'Hash you stored in database'

Check if password matches hash/salt combo:

check_password_hash('mypassword', password_hash, salt) 

check_password_hash() returns True is password checks out, otherwise returns False.

flask-scrypt's People

Contributors

cryptojuice avatar samuelmarks avatar

Watchers

 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.