Increase PBKDF2 iterations to 600,000

OWASP Cheat Sheet recommends 600,000 iterations.

https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2
This commit is contained in:
JonnyWong16 2024-02-19 17:31:28 -08:00
parent c172965ec8
commit 040972bcba
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -16,7 +16,6 @@
"""
import hashlib
from os import urandom
from base64 import b64encode, b64decode
from hashlib import pbkdf2_hmac
@ -30,7 +29,7 @@ HASH_FUNCTION = 'sha256' # Must be in hashlib.
# Linear to the hashing time. Adjust to be high but take a reasonable
# amount of time on your server. Measure with:
# python -m timeit -s 'import passwords as p' 'p.make_hash("something")'
COST_FACTOR = 10000
COST_FACTOR = 600000
def make_hash(password):