Skip to main content

Brcrypt hashing for Quart.

Project description

Quart-Bcrypt

Quart-Bcrypt is a Quart extension that provides bcrypt hashing utilities for your application.

Due to the recent increased prevelance 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:

pip install quart-bcrypt

Usage

To use the extension simply import the class wrapper and pass the Quart app object back to here. Do so like this:

from Quart import Quart
from quart_bcrypt import Bcrypt

app = Quart(__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

Alternatively there are async versions also. Use them like so:

pw_hash = await bcrypt.async_generate_password_hash('hunter2')
await bcrypt.async_check_password_hash(pw_hash, 'hunter2') # returns True

Documentation

Documentation is available here: https://quart-bcrypt.readthedocs.io/en/latest/

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

Built Distribution

Quart_Bcrypt-0.0.5-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

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