Hashing web user password in ASP.NET vs SQL CLR

岁酱吖の 提交于 2019-12-24 12:27:57

问题


Are there any security concerns in choosing to hash a user password at the application level in ASP.NET vs at the database level in SQL CLR? I'm seen it done both ways.

My thinking is that in the application level, the password is only sent once from the browser to the webserver. In a database implementation, the password is sent a second time to the database for hashing.

In the latter case, someone running SQL Server Profiler would be able to see the password sent to the procedure or function in plaintext. I'm not too familiar with SQL Server Auditing, but if it had the ability to capture similar information it would pose a risk as well.


回答1:


You should hash the password in your application, not in you database. This means that:

  • Browser to application -> password is send in plain text protected by ssl
  • application to database -> password is allways hashed

Now you have no problem with someone running a profiler, because the passwords are hashed. Besides that if someone can run a profiler, he can probably do much more damage then reading the passwords...




回答2:


Hash in the application layer using scrypt or bcrypt, don't depend on general purpose hashing algorithms (MD5, SHA1, SHA512, etc) because of these reasons.

Here are .Net implementations for scrypt and bcrypt.



来源:https://stackoverflow.com/questions/19706624/hashing-web-user-password-in-asp-net-vs-sql-clr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!