Registry / auth-security / py-bcrypt

py-bcrypt

JSON →
library0.4pypypi✓ verified 86d ago

A minimal bcrypt password hashing and key derivation library for Python. Current version 0.4 is outdated and no longer maintained; most users should switch to bcrypt or passlib.

pip install py-bcrypt
INSTALL
IMPORT
SIG · PY-BCRYPT
P
py-bcrypt
auth-securitypythonv0.4
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bcrypt
import bcrypt
from pybcrypt import bcrypt
The correct import is just 'import bcrypt' after installing py-bcrypt. Common mistake is using a different module name.

Hash a password and verify it.

import bcrypt password = b"my_password" hashed = bcrypt.hashpw(password, bcrypt.gensalt()) if bcrypt.checkpw(password, hashed): print("Password matches")
Debug
Known issues
deprecatedpy-bcrypt is abandoned and not compatible with modern Python (3.x+). Use bcrypt or passlib instead.
fix
Replace py-bcrypt with 'bcrypt' (pip install bcrypt) and update imports accordingly.
affects: all
gotchapy-bcrypt is extremely slow compared to modern alternatives (e.g., bcrypt, argon2). It uses a pure Python implementation.
fix
Switch to a C-extension based library like bcrypt.
affects: all
gotchaThe salt generation with gensalt() returns bytes; ensure you pass bytes to hashpw.
fix
Always use bytes: bcrypt.hashpw(password.encode(), bcrypt.gensalt()).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'bcrypt'
The library is not installed or import name is wrong.
fix
Install with 'pip install py-bcrypt' and import as 'import bcrypt'.
TypeError: Unicode-objects must be encoded before hashing
Passing a string instead of bytes to bcrypt functions.
fix
Encode the string: bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()).
Upgrade
Version history
0.4latest on PyPI · released Aug 25, 2013
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
1
Resources
py-bcrypt — pip install py-bcrypt · libregistry