Skip to main content

Brcrypt hashing for Flask.

Project description

Tests Version Supported Python Versions

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Bcrypt-1.0.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

Flask_Bcrypt-1.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file Flask-Bcrypt-1.0.1.tar.gz.

File metadata

  • Download URL: Flask-Bcrypt-1.0.1.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

Hashes for Flask-Bcrypt-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f07b66b811417ea64eb188ae6455b0b708a793d966e1a80ceec4a23bc42a4369
MD5 004c3ffe5259395aff2c710ddb32d7b2
BLAKE2b-256 0cf425dccfafad391d305b63eb6031e7c1dbb757169d54d3a73292939201698e

See more details on using hashes here.

File details

Details for the file Flask_Bcrypt-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Bcrypt-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 062fd991dc9118d05ac0583675507b9fe4670e44416c97e0e6819d03d01f808a
MD5 f62c8df17c974f7e0651c578601adef7
BLAKE2b-256 8b72af9a3a3dbcf7463223c089984b8dd4f1547593819e24d57d9dc5873e04fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page