How can bcrypt have built-in salts?

前端 未结 4 660
终归单人心
终归单人心 2020-11-22 10:12

Coda Hale\'s article "How To Safely Store a Password" claims that:

bcrypt has salts built-in to prevent rainbow table attacks.

4条回答
  •  粉色の甜心
    2020-11-22 10:56

    To make things even more clearer,

    Registeration/Login direction ->

    The password + salt is encrypted with a key generated from the: cost, salt and the password. we call that encrypted value the cipher text. then we attach the salt to this value and encoding it using base64. attaching the cost to it and this is the produced string from bcrypt:

    $2a$COST$BASE64

    This value is stored eventually.

    What the attacker would need to do in order to find the password ? (other direction <- )

    In case the attacker got control over the DB, the attacker will decode easily the base64 value, and then he will be able to see the salt. the salt is not secret. though it is random. Then he will need to decrypt the cipher text.

    What is more important : There is no hashing in this process, rather CPU expensive encryption - decryption. thus rainbow tables are less relevant here.

提交回复
热议问题