![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Oct 2006
Posts: 15
Rep Power: 0
![]() |
Username/Password Authentication In mySql
Hi
Sorry to be filling these boards up with small problems, but I seem to be running into a lot since I'm learning PHP/mySQL while building a rather large website Anyway, I'm implementing a username/password thing. I've got a registration form in which it uses the crypt() function to encrypt their password and store it in the database, like so: [php]$password = crypt($upass);[/php] However, when I ran into problems validating the password when the user logs in, I tested two users with the same password and found out that the digest (or whatever you call the encrypted password) is different each time I've read the online documentation of the crypt() function, but I don't understand the idea of a salt. Should I supply a salt to stop the salt being generated randomly? EDIT: I've supplied a salt as follows: [php]$password = crypt($upass, "*****salt*****");[/php] The salt is 15 characters, and the space for the digest in the database is also 15 characters, if that helps Thanks Banjo Last edited by Satans_Banjo; Jun 29th, 2007 at 4:57 AM. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting MySQL and PHP | titaniumdecoy | PHP | 10 | Feb 25th, 2008 7:47 PM |
| MySQL & Python | snipertomcat | Python | 2 | May 9th, 2007 12:49 PM |
| MySQl simple problem | paulchwd | Other Web Development Languages | 7 | Feb 27th, 2007 10:31 AM |
| MySql | paulchwd | Other Web Development Languages | 8 | Feb 8th, 2007 9:17 PM |
| Tutorial - Using MySQL in C# | Darkhack | C# | 12 | Jan 17th, 2006 9:28 AM |