If I make the SALT random for each user, how do I authenticate them?

后端 未结 5 1889
故里飘歌
故里飘歌 2021-02-05 06:27

I\'ve been reading up on the benefits of salting and hashing passwords, but one thing still eludes me...

When I provide a random salt for each user, how do I then know

5条回答
  •  暖寄归人
    2021-02-05 06:48

    Salt is randomly generated for each user but it's saved somewhere in the database. You look up the salt for the particular user and use it to authenticate the user.

    The point is, since salt is different for each user, you cannot use a prebuilt dictionary of hashes to map the hashed passwords to clear text (rainbow attack).

提交回复
热议问题