相关疑难解决方法(0)

有人可以解释BCrypt如何验证散列吗?

我正在使用C#和BCrypt.Net来哈希我的密码.

例如:

string salt = BCrypt.Net.BCrypt.GenerateSalt(6);
var hashedPassword = BCrypt.Net.BCrypt.HashPassword("password", salt);

//This evaluates to True. How? I'm not telling it the salt anywhere, nor
//is it a member of a BCrypt instance because there IS NO BCRYPT INSTANCE.
Console.WriteLine(BCrypt.Net.BCrypt.Verify("password", hashedPassword));
Console.WriteLine(hashedPassword);
Run Code Online (Sandbox Code Playgroud)

如果没有在任何地方保存盐,BCrypt如何用哈希验证密码.我唯一的想法是,它以某种方式在哈希的末尾附加盐.

这是正确的假设吗?

c# bcrypt bcrypt.net

27
推荐指数
2
解决办法
1万
查看次数

标签 统计

bcrypt ×1

bcrypt.net ×1

c# ×1