Is time() a good salt?

后端 未结 9 1014
灰色年华
灰色年华 2020-12-02 05:40

I\'m looking at some code that I have not written myself. The code tries to hash a password with SHA512 and uses just time() as the salt. Is time()

9条回答
  •  时光取名叫无心
    2020-12-02 06:38

    Salt is use to prevent rainbow attacks by breaking the match between the password and precomputed hash. So the main task for a salt is to be different for each user/password record. Quality of randomization of the salt doesn't matter much as long as the salt is different for different users.

提交回复
热议问题