---
title: "Password Complexity, Hash Iterations and Entropy"
description: "Neon can safely cut SCRAM-SHA-256 PBKDF2 iterations from 4096 to 1 to reduce connection CPU cost, because its database passwords are randomly generated and dictionary attacks therefore don't apply."
url: "https://swe.quest/articles/password-complexity-hash-iterations-and-entropy-cfe7b612d3cb811d"
canonical: "https://neon.com/blog/password-complexity-hash-iterations-and-entropy"
source: "Neon"
published: "2024-05-21"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 5
tags: ["cryptography","identity-auth","postgres","performance"]
---

# Password Complexity, Hash Iterations and Entropy

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-05-21, 5 min read, Deep dive. Original: [https://neon.com/blog/password-complexity-hash-iterations-and-entropy](https://neon.com/blog/password-complexity-hash-iterations-and-entropy)

## Summary

Neon can safely cut SCRAM-SHA-256 PBKDF2 iterations from 4096 to 1 to reduce connection CPU cost, because its database passwords are randomly generated and dictionary attacks therefore don't apply. Brute-force strength is modeled as password entropy plus log2(iterations), so dropping 4096 iterations costs 12 bits, roughly recovered by adding about two characters and allowing repeated characters (14 chars at 1 iteration ≈ 83 bits vs. 80 bits today). Entropy beyond 256 bits (about 43 alphanumeric characters) adds nothing since the derived ClientKey becomes the target, and the reasoning does not hold for user-chosen passwords.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Cryptography](https://swe.quest/tags/cryptography.md) (Security)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- password hashing basics
- entropy in bits
- PBKDF2

## Keywords

SCRAM-SHA-256, PBKDF2, Neon, OWASP, SHA-256

## Related posts

- [How we avoided side-channels in our new post-quantum Go cryptography libraries](https://swe.quest/articles/how-we-avoided-side-channels-in-our-new-post-quantum-go-cryptography-libraries-8fe38a6e055d44ab.md): Trail of Bits · 2025-11-14 · Hard · 6 min read · Cryptography, Go, Open source
  Trail of Bits released pure-Go, open-source implementations of the NIST post-quantum signature schemes ML-DSA (FIPS-204) and SLH-DSA (FIPS-205), engineered to run in constant time.
- [PVF: A novel metric for understanding AI systems’ vulnerability against SDCs in model parameters](https://swe.quest/articles/pvf-a-novel-metric-for-understanding-ai-systems-vulnerability-against-sdcs-in-0da0e7e605b31ce1.md): Meta Engineering · 2024-06-19 · Hard · 6 min read · Hardware, Inference & serving, Machine learning, Recommendations & ranking
  Parameter vulnerability factor (PVF) is a metric, modeled on the architectural vulnerability factor (AVF), that defines the probability that a corruption in a given model parameter (or group of parameters) produces an incorrect output, estimated through large-scale fault injection.
- [How Meta is improving password security and preserving privacy](https://swe.quest/articles/how-meta-is-improving-password-security-and-preserving-privacy-daa9a84182d0e924.md): Meta Engineering · 2023-08-08 · Medium · 6 min read · Cryptography, Privacy, Identity & auth, Security
  Meta's Private Data Lookup (PDL) checks new passwords against breached-password datasets using Private Set Intersection, so the server learns neither the attempted password nor whether it matched.
- [Bun v0.6.8](https://swe.quest/articles/bun-v0-6-8-d3a463075fc8738e.md): Bun · 2023-06-09 · Medium · 7 min read · JavaScript, Testing, Runtimes & VMs, Cryptography
  Bun v0.6.8 adds a built-in Bun.password API for argon2 (default) and bcrypt password hashing.
- [How Meta built large-scale cryptographic monitoring](https://swe.quest/articles/how-meta-built-large-scale-cryptographic-monitoring-007f3fb06e949eb9.md): Meta Engineering · 2024-11-12 · Medium · 10 min read · Cryptography, Observability, Scaling, C & C++
  Meta logs every operation in FBCrypto, its managed cryptographic library, without sampling by aggregating identical events into per-event counts in an in-process buffer and flushing them periodically to Scribe, with data landing in Scuba and Hive.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
