Skip to main content

Module firebase

Module firebase 

Source
Expand description

Firebase’s modified scrypt, as Utopia\Auth\Hashes\ScryptModified computes it: scrypt (N = 16384, r = 8, p = 1, 64 bytes) of the password under the salt and its separator, and the signer key encrypted with AES-256-CTR under the first 32 bytes of that, from a zero IV.

Functions§

aes_256_ctr
openssl_encrypt($data, 'aes-256-ctr', $key, OPENSSL_RAW_DATA, str_repeat("\0", 16)): data XORed with the AES-256 keystream of a big-endian 128-bit counter from zero.
derived_key
scrypt($password, $salt . $separator, 16384, 8, 1, 64), raw: ScryptModified’s derived key. The password is what PHP passes, already through mb_convert_encoding().
hash
ScryptModified::hash()’s value before its base64_encode(): the signer key encrypted under the derived key’s first 32 bytes.