I'm using this function to generate a hash for a password and then store it in the database (SQL Server).
The code looks like this:
byte[] saltBytes = new byte[16];
new RNGCryptoServiceProvider ().GetBytes (saltBytes);
string salt = Convert.ToBase64String (saltBytes);
string saltedPasswordHash =
FormsAuthentication.HashPasswordForStoringInConfigFile (password + salt, FormsAuthPasswordFormat.SHA1.ToString ());
Now the question: in what format is the output of HashPasswordForStoringInConfigFile () - do I store it as char(length) or nchar(length)?
Or is there any other preferred way to store the hash, maybe not as a string?
Any input and semi-relevant comments are greatly appreciated.