security - MVC 3 Crypto Helper -- Will this add extra shield to make the password more secure? -
a
string salt = crypto.generatesalt(); string saltandpwd = string.concat(originalpassword, salt); string hashedpwd = crypto.hashpassword(saltandpwd);
b
string hashedpwd = crypto.hashpassword(originalpassword);
may know method , method b, more secure ? or correct approach ? reflector, found hash password method in core :
public static string hashpassword(string password) { if (password == null) { throw new argumentnullexception("password"); } return hashwithsalt(password, generatesaltinternal(0x10)); }
as main purpose of using salt defeat rainbow tables, adding additional salt hashpassword
doesn't seem gain benefit, , incur additional overhead (as have store salt generate yourself. hashpassword
builds returned value). reference, hashpassword
does:
the password hash generated rfc 2898 algorithm using 128-bit salt, 256-bit subkey, , 1000 iterations. format of generated hash bytestream {0x00, salt, subkey}, base-64 encoded before returned.
so, in short, what's in framework enough reasonable definition of enough.
Comments
Post a Comment