This is a discussion on "double hashing and change password" within the PHP Forum section. This forum, and the thread "double hashing and change password are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
double hashing and change password
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
double hashing and change password
Hi
I'm having a problem with double hashing and changing the password.. my story is the user use 123456 for example to login and this password is not in double hashing form yet! so the user go to change password section and enters his current password twice 123456 and his new password 111222333 then OK and the password became 9898eugeghdgd87d67d6 bluh bluh in the database because it is in double hashing form no body can see what it is then the user use his new password next time to login 111222333 and login successful .. the problem is here he wants to change the password again he goes to change password and the same story again but this time he got the message "invalid previous password" because it is in hashing form and I don't know how to make it understand that the password is the same one he used to login and it's not invalid!! NOTE: I really need to use the double hashing, I know it works without it but I want it. see this code where I used sha1 for double hashing in change password screen, I might need it somewhere else but I don't know where
Thanks |
|
|
|
|||
|
Re: double hashing and change password
You could use ENCODE and DECODE in your MySQL statement. It isn't sha1 but it is easier to use and can be more secure. It would go something like this...
|
|
|||
|
Re: double hashing and change password
that's good..
but, I didn't understand how to generate the key? $key = 'A-r@Nd0m-Str1ng-0f-t3xt'; should I write it like this ? Thanks.. I like your way of encoding and decoding |
|
|||
|
Re: double hashing and change password
Thanks. Glad I can help.
A-r@Nd0m-Str1ng-0f-t3xt literally is a random string of text. Just write anything you want in there. A random jumble of letters or numbers. Anything you want really, just make it hard to guess. Keep in mind that you wouldn't use DECODE for user authentication. Just if you wanted to send a forgot password e-mail. To login you would do something like:
Last edited by Blake121; Jun 5th, 2007 at 06:52. |
![]() |
| Tags |
| change, double, hashing, password |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Forgot password and Change password PHP script | Chono | PHP Forum | 4 | May 16th, 2008 09:13 |
| double click | ahwell | Flash & Multimedia Forum | 3 | Sep 7th, 2007 20:40 |
| Double Down | colinmcgray | Free Web Site Critique | 8 | Jun 14th, 2007 11:40 |
| Double Backgrounds? | Mourning Dove | Web Page Design | 5 | May 27th, 2006 12:42 |