Skip to main content

CLI for benchmarking bcrypt cost factors on local hardware.

Reason this release was yanked:

stale build

Project description

bcrypt-speed-tests

Small CLI for benchmarking bcrypt cost factors 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

uv sync

uv sync creates a local .venv by default.

Activate 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). 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: 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bcrypt_speed_tests-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bcrypt_speed_tests-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file bcrypt_speed_tests-0.1.0.tar.gz.

File metadata

  • Download URL: bcrypt_speed_tests-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for bcrypt_speed_tests-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1496168b26c5fd75adbadcc80f53770c840d10ca9065963e0fb5fad753cae032
MD5 fc436b46bdde4cde6fd584a88a681167
BLAKE2b-256 8b7c12d97a3b73fb72a395e609e9747c37cd05cc3fe8b07b142c360edd0667cf

See more details on using hashes here.

File details

Details for the file bcrypt_speed_tests-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bcrypt_speed_tests-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for bcrypt_speed_tests-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67956274f5a18830c591fbebd1329bea4fd3dc01b1a6489d1108c936e10dcb56
MD5 ad66440f82d040e1ae589e006a807723
BLAKE2b-256 a930be7f26e6b769da9d7e8b9d4cd153338d927878660ed87a7ad09b505265bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page