bcrypt

5.0.0 · active · verified Sat Mar 28

A Python library for modern password hashing, currently at version 5.0.0, with a release cadence of approximately every 6 months.

Warnings

Install

Imports

Quickstart

A simple example demonstrating how to hash and check passwords using bcrypt.

import bcrypt

# Hash a password
password = b"supersecret"
salt = bcrypt.gensalt()
hash = bcrypt.hashpw(password, salt)

# Check a password
if bcrypt.checkpw(password, hash):
    print("Password matches")
else:
    print("Password does not match")

view raw JSON →