浏览代码

better password hashing maybe?

devel
Rick Payton 7 年前
父节点
当前提交
da3066e777
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      login.php

+ 2
- 1
login.php 查看文件

@@ -12,7 +12,8 @@ $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
session_start();
$username = mysqli_real_escape_string($con, $_POST['username']);
$password = mysqli_real_escape_string($con, $_POST['password']);
$password = sha1($password);
# $password = sha1($password); //this is the original line of code, just found sha1isn't any better than md5
$password = password_hash($password, PASSWORD_BCRYPT);
if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}


正在加载...
取消
保存