gpt4 book ai didi

hash - Firebase 简单登录的盐/哈希?

转载 作者:行者123 更新时间:2023-12-04 23:49:49 26 4
gpt4 key购买 nike

Firebase 提供“简单登录”,其中使用电子邮件/密码进行身份验证。有谁知道 firebase 在存储密码之前是否会加盐和散列密码?我想 firebase 知道的足够多,但我只是想确定一下,因为经过一个小时的搜索后我找不到任何关于此的信息。

预期跟进:如果 firebase 实际上没有对密码进行加盐+散列处理,那么如果我将用户的密码加盐+散列并将其传递到 firebase 进行存储/检查,那么简单登录是否会起作用?

提前致谢!

最佳答案

截至 2016 年

截至 2016 年,Firebase 使用 scrypt 的修改版本来加密密码。用于执行加密的库已在 GitHub 上发布 here .

它同时使用盐和哈希,如示例所示:

# Params from the project's password hash parameters
base64_signer_key="jxspr8Ki0RYycVU8zykbdLGjFQ3McFUH0uiiTvC8pVMXAn210wjLNmdZJzxUECKbm0QsEmYUSDzZvpjeJ9WmXA=="
base64_salt_separator="Bw=="
rounds=8
memcost=14

# Params from the exported account
base64_salt="42xEC+ixf3L2lw=="

# The users raw text password
password="user1password"

# Generate the hash
# Expected output:
# lSrfV15cpx95/sZS2W9c9Kp6i/LVgQNDNC/qzrCnh1SAyZvqmZqAjTdn3aoItz+VHjoZilo78198JAdRuid5lQ==
echo `./scrypt "$base64_signer_key" "$base64_salt" "$base64_salt_separator" "$rounds" "$memcost" -P <<< "$password"`

2016 年之前

根据此页面( http://firebase.com/docs/web/guide/simple-login/password.html )Firebase 使用 bcrypt。

根据 bcrypt ( http://en.wikipedia.org/wiki/Bcrypt ) 上的 wiki 页面,它既散列又使用盐。

关于hash - Firebase 简单登录的盐/哈希?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25170063/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com