Login Password Encryption (Technics)

by Ryan.S, Tuesday, December 10, 2013, 03:30 (3762 days ago)

Hi,

I am trying to build my login page to share the same userdata table, but I couldn't figure out the way to encrypt the login password in include/login.inc.php.

It should be some hash function that generate a 50 characters string.

please help!

Thank you!:-)

You're looking in the wrong file

by Bubba @, Tuesday, December 10, 2013, 08:20 (3762 days ago) @ Ryan.S

Actually, if you follow the code, you'll see the functions that are called, however, they aren't in that file.

The functions you want are in functions.inc.php, they are generate_pw_hash, to create the password, and is_pw_correct, to verify it on login. The functions are pretty straight forward and use the php sha1() function. If you've never used it or worked with salted hashes, you should google for a tutorial on salted hashes to get the basic idea of what is being done.

I hope that helps you :-)

Thank You:)

by Ryan.S, Wednesday, December 11, 2013, 07:53 (3761 days ago) @ Bubba

Thanks for your help Bubba!

Did not notice the salted part. Still a long way to go for me:-D

RSS Feed of thread