Brcrypt hashing for Flask.
Project description
Flask-Bcrypt
Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.
Due to the recent increased prevalence of powerful hardware, such as modern GPUs, hashes have become increasingly easy to crack. A proactive solution to this is to use a hash that was designed to be "de-optimized". Bcrypt is such a hashing facility; unlike hashing algorithms such as MD5 and SHA1, which are optimized for speed, bcrypt is intentionally structured to be slow.
For sensitive data that must be protected, such as passwords, bcrypt is an advisable choice.
Installation
Install the extension with one of the following commands:
$ easy_install flask-bcrypt
or alternatively if you have pip installed:
$ pip install flask-bcrypt
Usage
To use the extension simply import the class wrapper and pass the Flask app object back to here. Do so like this:
from flask import Flask
from flask_bcrypt import Bcrypt
app = Flask(__name__)
bcrypt = Bcrypt(app)
Two primary hashing methods are now exposed by way of the bcrypt object. Use them like so:
pw_hash = bcrypt.generate_password_hash('hunter2')
bcrypt.check_password_hash(pw_hash, 'hunter2') # returns True
Documentation
The Sphinx-compiled documentation is available here: https://flask-bcrypt.readthedocs.io/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Flask-Bcrypt-1.0.0.tar.gz
.
File metadata
- Download URL: Flask-Bcrypt-1.0.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e622fbd3b0bf63d516b8844fe3431fc30213592412b430036c3928a0c52dfb27 |
|
MD5 | 2a1724860244dd2d523343676b7b77e7 |
|
BLAKE2b-256 | d62fe70bb775ea1adb0fc04c48b37c0c0e84a98de50ff949b866e516d771b5ee |
File details
Details for the file Flask_Bcrypt-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: Flask_Bcrypt-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64a947e15ff06823c3843f4826d4548dfae038c7df8f98ea82755db62092ec4c |
|
MD5 | d2652a9bdb90f035a25cb64973a5ad51 |
|
BLAKE2b-256 | 84a104e75f0c282fb832ea7a76458073eed89c950b9a10da9fc2456844dc361d |