Posts Tagged ‘password’

Understanding the Difference Between MD5 and Crypt Functions

Saturday, February 2nd, 2008

If you’re working with a user-management system in PHP (or any scripting language), than you’re likely using either the md5() or crypt() function to encode and store the user’s password.

An oft-asked question - and oft-misunderstood - is what is the difference? Is one better than the other?
(more…)

How to Create a Random Password for Users

Friday, February 1st, 2008

If you’re working on a user-management system, you may find it useful to be able to create a random password for users.

Some systems generate these initially and have the user log in to set a permanent password. You might also have a “Reset” button, where the script generates a random password and e-mails it to the user.

This quick tutorial will show you how to create an 8 character random password containing a mix of letters and numbers. Or, if you’re impatient, jump straight to the function’s source code
(more…)

How to Use the Crypt() Function to Encrypt and Check Passwords

Tuesday, January 22nd, 2008

Every php-script that involves some kind of user login and database interaction has one very important feature - password checking and encryption.

There are a bunch of ways you could create and check passwords - from an insecure string in a database to an encrypted “hash” that you check against user input. This tutorial will show you how to use the crypt() function to store and check passwords in a php script.
(more…)