function passwords_encrypt_password($password)
{
    if ($GLOBALS['cfg']['passwords_use_bcrypt']) {
        $h = new BCryptHasher();
        return $h->HashPassword($password);
    }
    return hash_hmac("sha256", $password, $GLOBALS['cfg']['crypto_password_secret']);
}
Beispiel #2
0
function passwords_encrypt_password($password, $more = array())
{
    $defaults = array('use_bcrypt' => 1);
    $more = array_merge($defaults, $more);
    if ($GLOBALS['passwords_canhas_bcrypt'] && $more['use_bcrypt']) {
        $h = new BCryptHasher();
        return $h->HashPassword($password);
    }
    return hash_hmac("sha256", $password, $GLOBALS['cfg']['crypto_password_secret']);
}