简体   繁体   English

与BCrypt.net合作

[英]working with BCrypt.net

I'm working a custom membership system in ASP.NET MVC3 ( explained here ). 我在ASP.NET MVC3使用自定义成员资格系统( 在此处解释 )。 And I want to use BCrypt . 我想用BCrypt My question is about BCrypt.net arguments range. 我的问题是关于BCrypt.net参数范围。 ie the minimum and maximum length of string that BCrypt can hash it, that min/max length of salt , and also the output string's length. BCrypt可以散列它的字符串的最小最大长度, salt 最小/最大长度,以及输出字符串的长度。 Really I'm creating database now, and I want to know how to set password column in db. 我现在真的在创建数据库,我想知道如何在db中设置密码列。 ie nvarchar(256) or anything else? nvarchar(256)还是其他什么?

The BCrypt algorithm incorporates the salt into the hash so you don't need to have 2 separate columns in your database to store the hash and the password. BCrypt算法将salt合并到哈希中,因此您不需要在数据库中有2个单独的列来存储哈希值和密码。 You may checkout this sample implementation . 您可以查看此示例实现 It produces hashes of length 60 no matter how long the plain text password is. 无论纯文本密码有多长,它都会产生长度为60的哈希值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM