md5 hashing using password as salt?

前端 未结 6 859
忘掉有多难
忘掉有多难 2020-12-13 16:17
md5($password.md5($password))

is this good enough for password hashing? I am not asking for comparing this to something like bcrypt.

if it

6条回答
  •  一个人的身影
    2020-12-13 16:42

    MD5 is not secure in itself because it is partially broken (collisions) and is too small of a digest anyway. If one doesn't want to use a proper password derivation function à la bcrypt, scrypt or PBKDF2 you should at least use SHA-256 for new designs (and have a plan to migrate to SHA-3 when it will be out, so be sure to store the scheme you used to hash the password with the result, so both scheme can coexist as you use the new hashing procedure when people change passwords).

    If you intend to sell your program using MD5 in any capacity can be a show stopper for most government sales (e.g. in the US algorithms used must be FIPS 140-2 approved and many other countries got the same kind of requirements).

提交回复
热议问题