bcrypt (Python)

A Python library for secure password hashing using the bcrypt algorithm with an adjustable work factor

Library
PyPI
v5.0.0
1,498stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
76/100Good
Development Activity92
Maintenance52
Community72
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture78
Code Quality80
Innovation65
Learning Curve90

bcrypt is the Python Cryptographic Authority’s implementation of the bcrypt password-hashing algorithm, exposing a small, purpose-built API (hashpw, checkpw, gensalt, kdf) for hashing and verifying passwords. Each hash embeds a randomly generated salt and a configurable logarithmic work factor (rounds), so verification is a single checkpw call and there is no separate salt-management step for callers to get wrong. As of 3.0.0 the core hashing routine is implemented in Rust (src/_bcrypt) rather than C, which the maintainers adopted for improved memory safety while keeping the same Python-facing API.

The library intentionally does one thing — bcrypt password hashing — rather than bundling multiple algorithms, and its README is explicit that depending on the use case, scrypt or argon2id may be preferable; bcrypt is offered as a well-understood, widely compatible baseline rather than the state of the art. It supports adjustable prefixes (2a/2b) for compatibility with other bcrypt implementations, enforces the algorithm’s 72-byte password limit by raising instead of silently truncating, and ships typed stubs (py.typed, .pyi) for static-analysis-friendly integration.

What You Get

  • hashpw(password, salt) / checkpw(password, hashed) for one-line password hashing and verification
  • gensalt(rounds=12) to generate a salt with a configurable, adjustable logarithmic work factor
  • A kdf() function implementing bcrypt_pbkdf, used by OpenSSH’s encrypted private key format
  • Prefix compatibility (2a/2b) for interoperating with other bcrypt implementations
  • A memory-safe Rust core (since 3.0.0) behind the same stable Python API
  • Typed stubs (py.typed) for static type checkers

Common Use Cases

  • Hashing and verifying user account passwords in web applications
  • Implementing OpenSSH-compatible key derivation via the kdf function
  • Migrating legacy systems off weaker hashing (e.g. plain MD5/SHA1) onto a salted, work-factor-tunable scheme
  • Providing the password-hashing backend for higher-level auth frameworks and ORM user models

Under The Hood

Architecture - The Python package (src/bcrypt/__init__.py) is a thin re-export layer over a compiled extension module _bcrypt, whose implementation lives in src/_bcrypt/src/lib.rs (a Rust crate built via setuptools-rust). All actual hashing, salt generation, and the bcrypt_pbkdf-based kdf function are implemented in Rust and exposed to Python through PyO3-style bindings, so the Python layer only handles imports, __all__, and version metadata. Tech Stack - Built with setuptools + setuptools-rust (build-backend setuptools.build_meta), targeting Python 3.9+ (including free-threaded builds) and PyPy 3, with a Cargo.toml/Cargo.lock pinning the Rust dependency graph; the minimum supported Rust version is documented as 1.74.0 in the README. Code Quality - Tests live in a single tests/test_bcrypt.py file exercising hashpw/checkpw/gensalt/kdf across prefixes, rounds, and edge cases like the 72-byte password limit; the small, focused test surface matches the library’s narrow scope, and noxfile.py drives CI across Python versions. API Design - The API is deliberately minimal — four top-level functions and no configuration objects or classes — which keeps the learning curve close to zero; the tradeoff is that anything beyond bcrypt itself (e.g. algorithm negotiation or upgrade paths) is left to the caller or a higher-level library.

Used by 15 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
Python
73%
MIT

CertMate

Security · Devops

1,382

Automate SSL certificate lifecycle across any CA, 24+ DNS providers, and every major secret store — with a REST API, web dashboard, and built-in MCP server for AI-driven ops.

View details
82
Repo Health
84
Technical
70
Dependency
Built with
Python73%
JavaScript12%
HTML12%
Updated yesterday
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
Python
91%
MIT

Cronboard

Developer Tools · Devops

1,437

A keyboard-driven terminal dashboard for managing cron jobs on local machines and remote servers via SSH.

View details
76
Repo Health
74
Technical
75
Dependency
Built with
Python91%
Updated 3 weeks ago
Python
64%
MIT

Flowfile

Data Engineering

341

Visual ETL that compiles to Polars — build pipelines on a canvas, export as standalone Python, and run anywhere without platform lock-in.

View details
83
Repo Health
81
Technical
66
Dependency
Built with
Python64%
Vue19%
TypeScript16%
Updated today
TypeScript
53%
Apache 2.0

Flowsint

Automation · Developer Tools

7,669

A privacy-first, graph-based OSINT investigation platform with 30+ automated enrichers for mapping relationships between domains, IPs, people, and organizations.

View details
84
Repo Health
71
Technical
70
Dependency
Built with
TypeScript53%
Python45%
Updated 1 weeks ago
Python
56%
MIT

Foxel

File Storage

1,046

Self-hosted private cloud storage with AI semantic search and a pluggable multi-backend file management system.

View details
60
Repo Health
68
Technical
76
Dependency
Built with
Python56%
TypeScript41%
Updated 2 weeks ago
JavaScript
88%
GPL 3.0

Glass by Pickle

AI Assistants

7,577

A privacy-first desktop AI assistant that sees your screen, hears your meetings, and turns live context into structured summaries—without sending a single byte to the cloud.

View details
46
Repo Health
76
Technical
68
Dependency
Built with
JavaScript88%
TypeScript12%
Updated 9 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search