Question

I'm working a custom membership system in ASP.NET MVC3 (explained here). And I want to use BCrypt. My question is about BCrypt.net arguments range. i.e. 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. Really I'm creating database now, and I want to know how to set password column in db. i.e. nvarchar(256) or anything else?

Was it helpful?

Solution

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. You may checkout this sample implementation. It produces hashes of length 60 no matter how long the plain text password is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top