Using a hash of what you are hashing as a salt?

前端 未结 6 1837
情话喂你
情话喂你 2021-01-24 19:40

Say a user registers for your site, you hash the password they have chosen then use that hash as a salt and rehash their password with that salt.

Example:



        
6条回答
  •  爱一瞬间的悲伤
    2021-01-24 20:21

    The point of salting is to prevent the use of huge precalculated tables. With this method it is possible to calculate the hash of any password without the need to access your database. You should store a random value and hash the password and that value together.

提交回复
热议问题