Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypting User Passwords - On a User Registration Form

Status
Not open for further replies.

redzonne

Programmer
Feb 20, 2005
27
US
How do apply a one-way cryptographic hash function to the variable '$password'? I want to be able to store the user entered passwords encrypted. Any type of encryption function is fine.


I would like to add the encryotion function on this page

The Journey of a Thousand Miles Begins with the First Step...
 
it's become pretty standard to use md5 hashes of a password and username as generally there is no need to decrypt. this is, of course, more encoding than encryption, but the net result is ok for most applications.
 
Can you give a link to a tutorial maybe?

The Journey of a Thousand Miles Begins with the First Step...
 
to use md5 in php just use:
Code:
$encoded_var = md5($var);

if you're after a more general tutorial on login systems:
i wrote a login handler for a thread a while ago. i also dug out a "remember me" tutorial. both are referenced in a reply by me to a recent post:
thread434-1008119

for a good discussion on php and database security you might check out the php.net site:
hope this helps.
Justin
 
JPADIE, I figured it out. The problem was in my table setting in the Mysql database. The passwords column was set VARCHAR (30) and md5 encryptions assigns encryption string 30 +.

The password encryption was saving a depricated version that ofcourse would never match the full version presented by the login script, so I just increased the VARCHAR to 50 and now the login page validation works.

Thanks lots.... ;)

The Journey of a Thousand Miles Begins with the First Step...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top