Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

How Can I Create phpfusions's sha256 password?

Asked Modified Viewed 4,013 times
B
bgencacat
B
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Newbie

Hi, I want to verify phpfusion's password with input $_POST[] password. But I cant do it.
How can i create and verify password?
Thanks...
0 replies

8 posts

K
KasteR
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

To the best of my knowledge, the way it works is that your hash string is what's stored into the database. So to verify, you would compare a newly hashed string, to the existing stored hash from the database.

Here's an example of how to create the hash using sha256 algorithm:
echo hash('sha256', 'Encrypted Password');

Will prodocue:

Quote

bb1faba95e2a6eb5e9550dcd50b4b36e9457104bd16ee41ed059056e8db57576

Perhaps if you elaborate on what you're wanting to accomplish, there may be an easier way to help you.
0 replies
B
bgencacat
B
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

i.imgur.com/rwW0fwi.png
0 replies
D
douwe_yntema
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question
answered
Senior Member

Are you sure your password is not MD5 encrypted.
PF 7.0.2.7 still has the option to use MD5
0 replies
J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

The passwords in PHPFusion are salted, the salt always changes when you login so that password you see stored in the DB will always change.
More details in code https://github.com/PHPFusion/PHPFusion/blob/9.00/includes/classes/PHPFusion/Authenticate.php#L50
0 replies
N
NetriX
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
answered
Senior Member

[size=16]Generate Salt & Password Hash[/size]
$salt = sha1($_POST['password'], substr($_POST['password'], 12));
$password = hash_hmac('sha256', $_POST['password'], $salt);


[size=16]Verify Example[/size]
Authenticate::setUserCookie(USER_ID, $salt, "sha256", $remember, true);
Edited by NetriX on 20-02-2015 07:41,
0 replies
B
bgencacat
B
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

<?php
    $salt = sha1(";5qyg,1y8a5l&", substr(";5qyg,1y8a5l&", 12));
    $password = hash_hmac('sha256', ";5qyg,1y8a5l&", $salt);
    echo $password;
?>

Returns "356ba08930db3166c1f1f31568f16a1ed37159e244f0a32f66cddf84a467c6b8".

My encrypted password is (from phpfusion database): "1406122486491ab69852464d1da21df4f3f1489f2882fe784e3a3ce8175946ac"
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

V9


$my_pass = /PHPFusion/Defender::token('Enter Your Password Here');
$validate = /PHPFusion/Defender::return_token('Enter Your Password Here', $my_pass);

if ($validate) {
// do something
}


return_token function returns true or false (Boolean).
0 replies
N
NetriX
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
answered
Senior Member

Quote


My encrypted password is (from phpfusion database): "1406122486491ab69852464d1da21df4f3f1489f2882fe784e3a3ce8175946ac"
- by bgencacat


For detailed information, you should check out my Register/Login with Facebook Infusion here.

/infusions/connect/index.php has Register/Login/Authentication usage.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 8 posts
  • Votes 0 votes
  • Topic users 6 members

6 participants

N
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
K
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
D
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question
B
B
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet