bcrypt

bcrypt

Language
Python
Category
3
Version
3.2.2
Authors
Unknown
Description
Password hashing and salting library for passwords and servers.
Install Instructions
  • Install with pip
python3 -m pip install --upgrade pip
python3 -m pip install bcrypt
Usage
  • Example hashing and then checking if they match
import bcrypt
password = b"super secret password"
# Hash a password for the first time, with a randomly-generated salt
hashed = bcrypt.hashpw(password, bcrypt.gensalt())
# Check that an unhashed password matches one that has previously been hashed
if bcrypt.checkpw(password, hashed):
print("It Matches!")
else:
print("It Does not Match :(")
Links