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?

Hash 256

Asked Modified Viewed 4,317 times
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
asked
Senior Member

I am running version 7.02.05 and a few of my members have not logged in since the password hashing was changed from MD5 to sha256. When trying to change it manually (using an online hash256 utility) their password no longer works. Is the hash256 being used hashed twice or something?

I also checked using my password and the code in the users table is not the same as the one generated by the utility.
0 replies

10 posts

C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

You gave yourself problems there. The next time the user logged in it would of changed to sha anyway.
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

Thanks for your response Craig, and I realized that I probably screwed things up. The question is now can it be fixed? Is there a script (or some code) that will change the md5 to the algorithm that is currently used? I noticed in one of the previous posts that this version is using an hmac_sha256 which is why my online sha256 generator did not match.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

To be honest I have no idea about that kind of stuff, password algorithms is something I know little about. Only thing I can suggest is hopefully you have a recent backup you could just restore it.
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

As it is very early in the morning in Europe, I am hopeful that someone may have an idea of some code. Thanks again for your response. Evidently sleep is something that you need very little of as I see your posts at all hours of the day or night.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

F***ing cat woke me up. lol :)
0 replies
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

afoster, MD5 or SHA of any kind is one way encryption. This is the purpose of even using a hash code. If someone has it, they are unable to decrypt, so to say. Although you could compare a hash with another hash, in an effort to retrieve the supporting text.

And doing encryption in PHP is very simple.

MD5:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]hash('md5', 'string text to encrpyt'wink;[/syntaxhighlighter]

SHA256:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]hash('sha256', 'string text to encrpyt'wink;[/syntaxhighlighter]

There are many other ways to encrypt, but for the sake of keeping syntax copacetic, hash function would work great. Craig is right, restoring a recent backup is your best be I believe.
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

Thanks to both of you and I have already restored a backup so everything is cool.

Regarding your code Kaster, since phpfusion seems to use hmac_sha256, would your code work?
0 replies
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

You'll have to forgive my unweaned previous post.

Let's clear this up:

SHA256 is one way encryption that requires a string to be encrypted.

HMAC will require the use of a key, such as a salt. I did not realize this until further research. Honestly I'd have to look into this further. But I have no computer to use at home at the moment, and will not for a while (I now know Craig's pain haha).

The answer is no. This is not the same at all. My code does produce the hashes, but not for what you're needing it for. Sorry bud.

EDIT:

Here's an example, just for the record:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$hmac = hash_hmac( "sha256", utf8_encode("Filename"wink, utf8_encode("123456"wink);[/syntaxhighlighter]
[ulist=circle]The '123456' is being used as a key[/ulist]
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

Thanks again for your response KasteR. Since I have no way of knowing what key is/was used, there is not much I can do. I did learn something about this encryption process though. Thanks again.
0 replies
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

Anytime. And sorry, just really limited at the moment. But at least you got it sorted out.

And also, I believe the key would be the salt, which happens to be a hash as well. Gets pretty complicated. Now you can see why there was a change. A lot more secure.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 10 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
A
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
K
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet