| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Seasoned Poster
Joined in Jul 2003
36 posts
Gave thanks: 0
Thanked 0 times
|
I have installed the PHP server that is given to everyone by surpass and I want to be able to use the passwords from the accounts on the Forum to be useable on my upload scripts.... But, the passwords are stored as hashes and I am not sure as to how I would go about decoding the hashes to verify that they entered a password correctly for the uploads. Any help will be greatly appretiated. TIA.
-David |
|
|
|
|
#2 (permalink) |
|
Peaches!
Excelling Contributor
Joined in Jul 2003
Lives in Ottawa, Ontario, Canada
Hosted on Jose, Pass19
564 posts
Gave thanks: 0
Thanked 0 times
|
The way most forums hash the passwords is to use the md5() method, and that is almost impossible to decrypt. So, to check it, you can use this:
Code:
if ( md5($_POST['password']) == $row['password'] ) { ...code here... }
Hope that helps. |
|
|
|
|
#3 (permalink) |
|
Registered User
Seasoned Poster
Joined in Jul 2003
36 posts
Gave thanks: 0
Thanked 0 times
|
At that point the user has to input a hash as a password because the password I am comparing it to is a hash right? Do you think it would be possible to change the script in the php forum so that when the user submits his/her information, it sends the user name and password to a seperate database in plain text where it can be accessed from there as well?
|
|
|
|
|
#4 (permalink) | |
|
Peaches!
Excelling Contributor
Joined in Jul 2003
Lives in Ottawa, Ontario, Canada
Hosted on Jose, Pass19
564 posts
Gave thanks: 0
Thanked 0 times
|
You your users don't have to input the hash, that's what md5() does. It converts any string into an md5 hash.
Quote:
|
|
|
|
|
|
#5 (permalink) |
|
the one who was
Super #1
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
|
It's like wbie said. You don't actually ever decrypt the password. There would be no point in doing the encryption in the first place if it were that easy.
You basically get the password from the user at upload time. Take that password, run it through the encryption, and compare the resulting hash to the hash of the database. If they match, the password is the same...
__________________
Patrick Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org |
|
|