August 2018
Intermediate to advanced
366 pages
10h 14m
English
There are two functions involved here:
hash_password actually does multiple things; it doesn't just hash the password.
The first thing it does is generate some random salt that should be added to the password. That's just the sha256 hash of some random bytes read from os.urandom. It then extracts a string representation of the hashed salt as a set of hexadecimal numbers (hexdigest).
The salt is then provided to pbkdf2_hmac together with the password itself to hash ...