My initial plan was to use the .NET built in hashing library (SHA512) and store the password along with a salt. I'm familiar with how this can be done.
It has been requested that we should be able to add users along with their passwords manually in a SQL script. I'm familiar with using the HASHBYTES SQL Server to accomplish password hashing and I'm aware with its drawbacks (SHA1 and no salt).
Is there a way I can make the .NET code and the SQL Server HASHBYTES work together? I figure it isn't possible unless I want to drop the salt and use SHA1 as the hashing 开发者_Go百科algorithm in the .NET code.
You could write a CLR stored procedure/function which will use the .NET features and deploy it to the SQL server do do the task. So instead the HASHBYTES you will call directly your .NET code from the SQL server. Here is a link to quick sample of such function
精彩评论