Skip to main content

bcrypt-speed-tests

Small CLI for benchmarking bcrypt cost factors (rounds) so you can pick a sensible value on your target hardware.

What it does

  • Hashes a fixed password multiple times per cost factor.
  • Reports average time per cost in milliseconds.
  • Runs locally on the same machine your app will use.

Requirements

  • Python 3.9+
  • bcrypt (installed via project dependencies)

Install & Run from PyPI

Install uv first: https://docs.astral.sh/uv/

Preferred install with uv as a global tool:

uv tool install bcrypt-speed-tests

Run directly without installing:

uvx bcrypt-speed-tests

Add it to an existing project as a development dependency:

uv add bcrypt_speed_tests

Alternative installs:

pipx install bcrypt-speed-tests
pip install bcrypt-speed-tests

Install from repo

Clone and install locally:

git clone https://github.com/seapagan/bcrypt-speed-tests.git
cd bcrypt-speed-tests
uv sync

uv sync creates a local .venv by default.

Activate the virtual environment

source .venv/bin/activate

Deactivate when done:

deactivate

Windows (PowerShell):

.venv\Scripts\Activate.ps1

Or with pip:

pip install -e .

Run

bcrypt-speed-tests

CLI options

Available options:

Usage: bcrypt-speed-tests [OPTIONS] COMMAND [ARGS]...

Run the benchmark and print a timing table.

Options:
  --iterations  -i  INTEGER RANGE [x>=1]      Hashes to run per cost factor.
                                              [default: 3]
  --cost        -c  INTEGER RANGE [4<=x<=31]  Cost factor(s)/rounds. Repeat to
                                              pass multiple values.
  --help                                     Show this message and exit.

Override defaults at runtime:

bcrypt-speed-tests --iterations 5 --cost 10 --cost 12 --cost 14

Tasks

Run via poethepoet:

poe ruff
poe mypy
poe format

Configure

Edit defaults in src/bcrypt_speed_tests/benchmark.py:

  • ITERATIONS: hashes per cost factor
  • COSTS: bcrypt rounds (cost factor) range
  • PASSWORD: fixed input

Example output

Iterations per cost: 3

Cost | Avg time (ms)
----------------------
  10 |        23.4
  11 |        46.8
  12 |        93.1
  13 |       185.7
  14 |       370.9

License

MIT

Metadata

Release files for bcrypt-speed-tests 0.2.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 bcrypt-speed-tests 0.2.0
File Size Uploaded Provenance
bcrypt_speed_tests-0.2.0.tar.gz 3.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bcrypt-speed-tests 0.2.0
File Interpreter ABI Platform
bcrypt_speed_tests-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / bcrypt_speed_tests-0.2.0.tar.gz

Download URL bcrypt_speed_tests-0.2.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0ded9df6e3e0fda199c135e31b4b5efe5856651225f35517d231a04ed679d423
BLAKE2b-256 checksum
How to use checksums
944d64a77c51f66f92a08e6872fd7b2c5c1a29c3520a895cdb2c3c76ff9a7bb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bcrypt_speed_tests-0.2.0-py3-none-any.whl

Download URL bcrypt_speed_tests-0.2.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8351d94bc2c31b71d9bbd56e2787e0a34cb9803fdc9c3545b68b2b04e1b593b2
BLAKE2b-256 checksum
How to use checksums
d2f134ba7b975ea62d14e2a5a866f15c3a55f0152b0ad7a9ef4e3e3d6d2598d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bcrypt-speed-tests 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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