What are Salt Rounds and how are Salts stored in Bcrypt?

后端 未结 2 907
囚心锁ツ
囚心锁ツ 2020-12-24 01:09

I\'m trying to configure Bcrypt for a node app that I\'m making and have several questions about salts that I hope someone here can help kindly answer.

  • What

2条回答
  •  悲哀的现实
    2020-12-24 01:18

    Salt is included in hash only and we need not to remember while comparing.

    var myPlaintextPassword='Saifio';  
    var saltRounds = 10;   
    const hash = bcrypt.hashSync(myPlaintextPassword, saltRounds);
    
    
    $2b$10$nOUIs5kJ7naTuTFkBy1veuK0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa
    

    | | | | | | | hash-value = K0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa | | | | | salt = nOUIs5kJ7naTuTFkBy1veu | | | cost-factor = 10 = 2^10 iterations | hash-algorithm = 2b = BCrypt

提交回复
热议问题