pwdlib
Modern password hashing for Python
What it is and what it does
pwdlib is a lightweight password hashing library for modern Python that wraps secure algorithms behind a simple, consistent API. It was created to address maintenance gaps in older libraries that will not work with Python 3.13 and later. The library deliberately keeps its scope narrow—it focuses on hashing and verifying passwords with modern, secure algorithms rather than attempting to support legacy algorithms.
You use it by creating a PasswordHash instance (typically via PasswordHash.recommended() to get sensible defaults), then calling hash() to create a password digest and verify() to check a plaintext password against a stored hash. It has a single runtime dependency (typing-extensions) and installs cleanly; optional algorithm backends are pulled in via pip extras.
Use it for:
- Secure user authentication in web applications by hashing passwords at registration and verifying them at login.
- Modernizing authentication layers in projects that need to support Python 3.13 and later.
- Building password management systems that require modern, audited hashing algorithms without legacy algorithm support.
- Prototyping authentication where a minimal, well-maintained password API is preferred over larger libraries.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a modern, easy-to-use wrapper for hashing and verifying passwords using secure algorithms, designed as a contemporary alternative to older password hashing libraries.
Yes, if you need straightforward password hashing for modern Python projects. The library is actively maintained, has no known vulnerabilities, installs cleanly, and supports Python 3.10–3.14. The Beta status is not a blocker given the narrow, focused scope. Install it if you want a simple, secure alternative; skip it only if you need legacy algorithm support or broader feature coverage.
Install
pwdlib on PyPI
pip
pip install pwdlibuv
uv add pwdlibpoetry
poetry add pwdlibInstalling pwdlib
Before you install
Low friction install with a single runtime dependency (typing-extensions). The project is actively maintained with a recent release (2 days ago) and supports current Python versions (3.10–3.14), though it is still in Beta status.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute the package freely in both open-source and proprietary projects without restriction.
Quickstart
pip install pwdlib
from pwdlib import PasswordHash
password_hash = PasswordHash.recommended()
hash = password_hash.hash("herminetincture")
password_hash.verify("herminetincture", hash)
Requires Python 3.10 or later; optional algorithm backends must be installed via extras.
Verify before relying
- Whether algorithm implementations are directly embedded or delegated to external libraries.
- Performance characteristics and memory usage compared to alternatives.
- Complete list of supported hashing algorithms beyond those mentioned in quickstart.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,123,174/month — #2,742 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pwdlib-0.3.1-py3-none-any.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
bcryptbcrypt provides modern password hashing using…
permissive · top 1,000 on PyPI
Flask-BcryptFlask-Bcrypt wraps the bcrypt password-hashing…
permissive · top 5,000 on PyPI
passlibPasslib provides a framework for hashing and…
permissive · top 1,000 on PyPI
argon2-cffiProvides a simple Python interface to Argon2, a…
permissive · top 1,000 on PyPI
AuthEncodingAuthEncoding provides a framework for creating,…
unclear · top 15,000 on PyPI
types-passlibProvides type stubs for the passlib…
permissive · top 5,000 on PyPI
hashringImplements consistent hashing in Python using…
permissive · top 15,000 on PyPI
siphashProvides a Python implementation of SipHash, a…
permissive · top 15,000 on PyPI
pwned-passwords-djangoIntegrates password breach checking from the…
permissive · top 15,000 on PyPI