Jump to content

[SOLVED] hash(sha512 ... values not syncing up


Lodius2000

Recommended Posts

Im working on a new user account management system, getting ready to make the login page... but

 

I discovered something wierd.... my hash values are not the same

 

before I post the script a few things:

I created an account, $myhash is what was placed in my database in the password field,

on the registration script the line $hash = hash("sha512",$password.$salt); is copy pasted,

the value of $salt is also copy pasted,

all these lines I made sure use the same style of quotes (single vs double).

the password of 'password' was also copy pasted from this testscript...

 

so here is my test script

 

<?php

$password = 'password';
$salt = 'hashme';
$hash = hash("sha512",$password.$salt);
//myhash comes straight from my database
$myhash = "0aadf252be8f696a28c46f03560f263eb51771d3617f65b06d4b039702cbd706005c41f41978df4bfa1122cf39f29fe41c169c66e4bfbea5b7ee4f44c0220d8d";
print $hash."<BR>";
print $myhash."<BR>";

print strlen($hash)."<BR>";
print strlen($myhash)."<BR>";

?>

 

this prints out

 

3068969b86a9132e08ce488841ef56a734d14278edfdd810ff0ea8ea412963e5f5e7f4358e27c1be4c900724bbb6c09af90c6255395a9baf26f653f6e3e0a774
0aadf252be8f696a28c46f03560f263eb51771d3617f65b06d4b039702cbd706005c41f41978df4bfa1122cf39f29fe41c169c66e4bfbea5b7ee4f44c0220d8d
128
128

 

as you can see, not the same....what gives?

 

EDIT: whoops guess I need to change my hash.... HAHA

//its changed now, but there were a couple of you who saw it

 

 

Link to comment
https://forums.phpfreaks.com/topic/142197-solved-hashsha512-values-not-syncing-up/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.