Skip to content

Commit

Permalink
increase pbkdf2 iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Oct 27, 2024
1 parent 2139fa0 commit 763609a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Unreleased
- Add ``stale_while_revalidate`` and ``stale_if_error`` properties to
``ResponseCacheControl``. :issue:`2948`
- Add 421 ``MisdirectedRequest`` HTTP exception. :issue:`2850`
- Increase default work factor for PBKDF2 to 1,000,000 iterations. :issue:`2969`



Version 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion src/werkzeug/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import secrets

SALT_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
DEFAULT_PBKDF2_ITERATIONS = 600000
DEFAULT_PBKDF2_ITERATIONS = 1_000_000

_os_alt_seps: list[str] = list(
sep for sep in [os.sep, os.path.altsep] if sep is not None and sep != "/"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_scrypt():
def test_pbkdf2():
value = generate_password_hash("secret", method="pbkdf2")
assert check_password_hash(value, "secret")
assert value.startswith("pbkdf2:sha256:600000$")
assert value.startswith("pbkdf2:sha256:1000000$")


def test_salted_hashes():
Expand Down

0 comments on commit 763609a

Please sign in to comment.