The PBKDF2 (Password-based Key Derivation Function 2) SHA-256 algorithm is for generating Encryption Keys from a user’s Master Password. Before being sent to the Locker servers, the Master Password is encrypted with a random value created by using the user’s
email address and the hashing technique, locally on the user’s device. When the Locker servers receive the encrypted Master Password, the password is encrypted again with a secure random value (generated by the Cryptographically Secure Pseudorandom Number Generator) and the hashing technique, and is subsequently stored in the Locker database.
The default number of iterations with the PBKDF2 algorithm is 100,001 on the user’s device, and then an additional 216,000 on the Locker’s servers (for a total of 316,001 iterations by default).
salt : cryptographic salt. Locker uses the user’s email as the first salt.
iter_count : number of iterations.
hash_func : hash function with output of length h_len.
key_len : length of output key.
Key K is divided into blocks of maximum length h_len. For each block KHi,
Use the hash function with iter_count iterations with password and salt as inputs. The first salt is the user’s email and the next salts are the outputs of the previous hashing:
H1=hash_func(password,email)
H2=hash_func(password,H1)
...
Hiter_count=hash_func(password,Hiter_count−1)
Perform XOR operation with all the outputs Hi from step 1: