Is it okay to store salts with hashes?

前端 未结 7 887

My understanding is that a salt is not intended to be secret, it is merely intended to be different from any centralized standard so that you can\'t develop a rainbow table or s

7条回答
  •  悲&欢浪女
    2021-02-01 19:11

    It's perfectly normal to generate a unique salt for each password. The salt may be a product of existing material (such as a UserID, et-al.) or randomly generated. The advantage is that an attack against the encrypted information becomes more impractical as the strength of the salt grows.

    Remember: Every cryptographic algorithm is breakable. Information may only be considered "safe" if cracking the protection (via a rainbow table or otherwise) is more costly than the information is worth.

    edit:

    Presuming you're very new to cryptography, here's a few more tips:

    • Longer salts are better than short ones.
    • The more possible values for a salt, the better. An alpha-numeric salt is better than an numeric one. A binary salt is better than an alpha-numeric one.
    • Salts wont make brute-force attacks less likely against a single password.

提交回复
热议问题