-2

maybe, in the signup process,
( I using express.js, MySQL, Sequelize )

  1. get ID and PW at Front-end
  2. saving ID in DB
  3. hashing the pw with salt
  4. save hashed pw in DB

And,,, can I use salt used before?

when some user log-in this server,
their PW will be hashing and compair with DB data.
but salt is just random..
so I wanna save salt value!

  • How are you hashing the password? Most of the tools I've used (e.g. bcrypt) include the salt in their output already. – jonrsharpe May 20 '22 at 06:39

1 Answers1

0

If you're using bcrypt

const salt = bcrypt.genSaltSync(12)
// Continue whatever user saving happens here with salt

Other libraries may also have these functions, generate a salt, use it as the parameter of hashing

MTN
  • 537
  • 3
  • 10