Benchmark a work factor on your own hardware

short · 50 min · Objective 3.3

Task

Measure how long a password derivation takes at several parameter settings on the machine you actually have, choose a setting from a target time, and confirm your hardware acceleration is in use.

Steps

  1. Write lab/kdf-bench.py timing a derivation across at least five parameter settings, and write the results to lab/kdf-bench.csv as function,params,ms.
  2. Pick a target time for interactive authentication, choose the parameters that meet it, and record the choice and the target in lab/kdf-choice.md.
  3. Compute your capacity: at that setting, how many authentications per second can the machine sustain, and what does that imply for rate limiting. Record it.
  4. Verify hardware acceleration is actually being used for symmetric encryption -- check processor flags and the library's reported backend -- and record it in lab/accel.txt.
  5. Deliberately disable acceleration if your library allows it, re-time a bulk encryption, and record the difference.

Verify

awk -F, 'NR>1 {n++} END {print n" parameter setting(s) timed"}' lab/kdf-bench.csv
awk -F, 'NR>1 {print $3}' lab/kdf-bench.csv | sort -n | head -1
awk -F, 'NR>1 {print $3}' lab/kdf-bench.csv | sort -n | tail -1
grep -Eci 'aes|ni|accel|hardware' lab/accel.txt
grep -Ec '[0-9]+' lab/kdf-choice.md

Five or more timings spanning at least an order of magnitude, a choice tied to a stated target, and acceleration verified rather than assumed. Libraries fall back to software implementations silently, and nothing reports it.

This is an independent study companion for CompTIA SecurityX CAS-005 and is not produced by or endorsed by CompTIA.