UCP De-hashing Help
#1

Hello Guys i am using SHA256_PassHash to hash the password if a player registers on the server..
i am also working on UCP but there's a problem in Checking the hashed password plzz help me fixing it here's the code below.i am having problem in De-Hashing The Password On The Website For UCP

Код:
<?php
session_start();
include 'dbh.inc.php';

if(isset($_POST['name'], $_POST['password'])) {

	$name = $_POST['name'];
	$password = $_POST['password'];
	$sql = "SELECT * FROM users WHERE Name='$name'";
    $result = $conn->query($sql);
    if (empty($name && $password)) {
    	header("Location: ../page1.php?invalid=empty");
    	exit();
    } else {
        if($result->num_rows < 1) {
		header("Location: ../page1.php?invalid=login");
		exit();
    } else {
    	$row = mysqli_fetch_assoc($result);
		//De-hashing the password
		$salt = "786t!t>D<QW*@!)#$>C)_Agdh";
		$hash1 = hash('sha256', $password . $salt);
		$hash = strtoupper($hash1);
		if ($row['Password'] == $hash) {
			header("Location: ../page1.php?login=success");
			$_SESSION['user-name']= $name;
			$_SESSION['user-password']=$password;
			exit();
		} else { 
			header("Location: ../page1.php?invalid=login");
			exit();
		}
		}
	}
}
?>
Reply


Messages In This Thread
UCP De-hashing Help - by Speaker - 23.02.2018, 07:41
Re: UCP De-hashing Help - by Chocopie - 23.02.2018, 08:05
Re: UCP De-hashing Help - by Speaker - 23.02.2018, 08:13
Re: UCP De-hashing Help - by Logic_ - 23.02.2018, 10:03
Re: UCP De-hashing Help - by Speaker - 23.02.2018, 10:16
Re: UCP De-hashing Help - by rfr - 23.02.2018, 10:19
Re: UCP De-hashing Help - by Speaker - 23.02.2018, 10:29
Re: UCP De-hashing Help - by kingmk - 23.02.2018, 11:09
Re: UCP De-hashing Help - by Speaker - 23.02.2018, 12:18
Re: UCP De-hashing Help - by kingmk - 23.02.2018, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)