Skip to main content

libpass-next

Libpass is a rewrite of passlib library

Installation

pip install libpass-next

Usage

You can use individual hashers (argon2, bcrypt, pbkdf2, etc) individually:

from libpass.hashers.bcrypt import BcryptHasher

hasher = BcryptHasher()

hash = hasher.hash("password")
print(f"{hash=}")

is_valid = hasher.verify(hash=hash, secret="password")
print(f"{is_valid=}")

Or you can combine them into a single CryptContext if you need to support multiple password hashing schemes:

from libpass.context import CryptContext
from libpass.hashers.argon2 import Argon2Hasher
from libpass.hashers.bcrypt import BcryptHasher

context = CryptContext(
    schemes=[
        Argon2Hasher(),
        BcryptHasher(),
    ]
)

hash = context.hash("password")
# $argon2id$v=19$m=65536,t=3,p=4$cIRqyLJEF2IBc0ggxp4Kqw$W+PxOyErga7uHi/BOkyTsT6atZAfFuc1GEPwHOwyJMM
print(f"{hash=}")

is_valid = context.verify(hash=hash, secret="password")
print(f"{is_valid=}")  # True

old_hash = "$2b$12$eNeQerKdKhGj3IfERBdGPem7wUtlW3szwawvT5GIm/UNKxCuDnZku"
print(context.verify(hash=old_hash, secret="password"))  # True
print(context.needs_update(old_hash))  # True

Release files for libpass-next 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libpass-next 0.3.0
File Size Uploaded
libpass_next-0.3.0.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libpass-next 0.3.0
File Interpreter ABI Platform
libpass_next-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.8 kB

Release files / libpass_next-0.3.0.tar.gz

Download URL libpass_next-0.3.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
477363d887d8737fec7202b5b71617bad4f7e5f19e672e74dffca3acd8ffbc37
BLAKE2b-256 checksum
How to use checksums
1fac05a541f73e4a244e7d5cb4997ddd2b7800ff0f2b805519b4029cb3007d84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.19

Release files / libpass_next-0.3.0-py3-none-any.whl

Download URL libpass_next-0.3.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
787813bd99462115b86a17e7ba427a9c8f066347c7027d9f06d4f78f67bd0fa0
BLAKE2b-256 checksum
How to use checksums
dd3327d1b1d6245dcd75f390c1460ee7ebbf68d79dc07829a546276108336e8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.19

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page