Skip to content

Document PBKDF2 benchmarks: desktop and Android evidence - #14

Merged
WebReflection merged 3 commits into
mainfrom
password-pbkdf2-benchmark
Nov 25, 2026
Merged

WebReflection merged 3 commits into
mainfrom
password-pbkdf2-benchmark

Conversation

@WebReflection

@WebReflection WebReflection commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Supersedes: #13

Summary

Adds desktop and Android PBKDF2-HMAC-SHA-256 benchmark evidence plus a standalone reproducible browser demo and a complete password implementation proposal.

Proposed implementation

  • Default PBKDF2 iterations: 32,000.
  • AES-GCM authenticated encryption.
  • Random 16-byte public salt and 12-byte public nonce.
  • Optional server-only pepper, never stored in the envelope.
  • Configurable iterations and SHA values.
  • encrypt, decrypt, buffer, format, and alphabet output behavior preserved.
  • 100% statements, branches, functions, and lines in the password test run.

Reproducible demo

benchmarks/password-pbkdf2.html performs five runs for 8192, 32000, 64000, 128000, and 600000 iterations. It times importKey(PBKDF2) plus deriveKey(AES-GCM 256), reports the median and all five samples, and does not encrypt or decrypt payload data.

Desktop evidence

Apple M5 Max, macOS arm64, Node.js v26.3.0:

  • 8192: 0.76 ms median
  • 32000: 2.69 ms median
  • 64000: 5.70 ms median
  • 128000: 9.79 ms median
  • 600000: 42.63 ms median

Android evidence

ASUS_AI2302 ROG Phone 8, Snapdragon 8 Gen 2, Android 15, Chrome 157:

  • 8192: 1.90 ms median
  • 32000: 5.00 ms median
  • 64000: 9.20 ms median
  • 128000: 21.30 ms median
  • 600000: 82.30 ms median

A repeat run produced 64k: 9.60 ms, 128k: 23.20 ms, and 600k: 82.30 ms.

Recommendation

32,000 iterations balances this utility’s mobile-first latency and offline guessing work factor. 64,000–128,000 remains available through iterations where extra latency is acceptable. 600,000+ remains suitable for server/high-security profiles. Weak passwords should additionally use a server-only pepper.

This PR does not merge, publish, change package version, or release the proposal.

@WebReflection
WebReflection force-pushed the password-pbkdf2-benchmark branch from e95fc5f to 7032d2d Compare November 25, 2026 21:53
@WebReflection WebReflection changed the title Document PBKDF2 iteration benchmarks and tradeoffs Document PBKDF2 benchmarks: desktop and Android evidence Nov 25, 2026
@WebReflection
WebReflection force-pushed the password-pbkdf2-benchmark branch from 7032d2d to 7751f51 Compare November 25, 2026 21:57
@WebReflection
WebReflection merged commit 1f204b2 into main Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant