富贵资源网 Design By www.hznty.com

如果你还在用md5加密,建议看看下方密码加密和验证方式。

先看一个简单的Password Hashing例子:

<"htmlcode">
<"Login: ", $this->data->passwordHash, "\n";
    if (password_verify($password, $this->data->passwordHash)) {
      // Success - Now see if their password needs rehashed
      if (password_needs_rehash($this->data->passwordHash, self::HASH, ['cost' => self::COST])) {
        // We need to rehash the password, and save it. Just call setPassword
        $this->setPassword($password);
        $this->save();
      }
      return true; // Or do what you need to mark the user as logged in.
    }
    return false;
  }
}

以上这篇详谈PHP中的密码安全性Password Hashing就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com