在Rails 3.1中使用 has_secure_password
时,bcrypt会为每个用户的密码随机生成一个salt . 根据this response,我了解salt是作为密码哈希的一部分存储的 . 是否有可用于分别访问该盐的方法或属性,例如用于编写安全cookie?
在Rails 3.1中使用 has_secure_password
时,bcrypt会为每个用户的密码随机生成一个salt . 根据this response,我了解salt是作为密码哈希的一部分存储的 . 是否有可用于分别访问该盐的方法或属性,例如用于编写安全cookie?
1 回答
如果需要,你将能够得到盐和校验和 .
你的盐和校验和会有所不同 .
更多信息:https://github.com/codahale/bcrypt-ruby