Storing password salts separately from password hashes? [duplicate]

戏子无情 提交于 2019-12-13 21:04:44

问题


Possible Duplicate:
what is best possible way of salting and storing salt?
Improve password hashing with a random salt

Assuming that using a correct algorithm for password hashing and generating different salts for each password...

Is it a security risk to store salts separately from password hashes? For ex. in a database table, storing password hashes in one column, and password salts in a separate column?

I saw strategies where the salt is embedded into the password hash itself, by using a specific algorithm. Later on the salt can be extracted from the password hash. Is this more secure?


回答1:


From everything I have ever read and done, there is nothing wrong with storing the password hash and password salt in separate columns, and that is the most common way to do it.

The basic method for authentication should go something like this:

  1. Retrieve user_id and password_salt using user supplied username or email
  2. Concat user supplied password input with retrieved salt
  3. Use hashing algorithm on combined string
  4. Check created hash against the hash in the database


来源:https://stackoverflow.com/questions/13459031/storing-password-salts-separately-from-password-hashes

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