vincenzoaglio
12-04-2014, 10:41 AM
I apologize I posted incorrectly in vbulletin 3 while my version and 4
I ask a moderator to close the same discussion mistakenly posted in section 3 vbulettin
Hello all I hope to explain better my problem.
I'm doing convenient application in Android, with a db on my server where it is housed even vbulettin. I need to introduce the user and password. This request is made by a query sent to the server, where is a php file called login.php which returns the fields in the query, or user, pwd, salt and so far all is well. I read something about how vbulettin translates the password in MD5 and I read this statement:
$ hash = MD5 (MD5 ($ password) + $ salt)
Having said that php does not understand anything but I interpret this statement as follows:
Take the password, turn it into MD5 sum the contents of the "salt" and request a new transformation in MD5.
Unfortunately, everything I do I can not get the same value stored in the password field of vbulettin. Perhaps it would be done directly in php, but unfortunately they are not in the capacity to do so than to send a query and return the required fields as per the following code
<?php
no null string is only for security
$databasehost = "";
$databasename = "";
$databaseusername = "";
$databasepassword = "";
$con = mysql_connect($databasehost,$databaseusername,$dat abasepassword) or die(mysql_error());
mysql_select_db($databasename) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
$query = file_get_contents("php://input");
$sth = mysql_query($query);
if (mysql_errno()) {
header("HTTP/1.1 500 Internal Server Error");
echo $query.'\n';
echo mysql_error();
}
else
{
$rows = array();
while($r = mysql_fetch_assoc($sth)) {
$rows[] = $r;
}
print json_encode($rows);
}
?>
the query is this
Dim myquery As String="SELECT salt FROM user WHERE username ='Enzo'"
It would be appropriate to carry out this conversion directly in php, or send the user field and the password field and return true or false if the conditions are right
Who helps me to do such a thing ???
Sorry for the English, but use the google translator
I ask a moderator to close the same discussion mistakenly posted in section 3 vbulettin
Hello all I hope to explain better my problem.
I'm doing convenient application in Android, with a db on my server where it is housed even vbulettin. I need to introduce the user and password. This request is made by a query sent to the server, where is a php file called login.php which returns the fields in the query, or user, pwd, salt and so far all is well. I read something about how vbulettin translates the password in MD5 and I read this statement:
$ hash = MD5 (MD5 ($ password) + $ salt)
Having said that php does not understand anything but I interpret this statement as follows:
Take the password, turn it into MD5 sum the contents of the "salt" and request a new transformation in MD5.
Unfortunately, everything I do I can not get the same value stored in the password field of vbulettin. Perhaps it would be done directly in php, but unfortunately they are not in the capacity to do so than to send a query and return the required fields as per the following code
<?php
no null string is only for security
$databasehost = "";
$databasename = "";
$databaseusername = "";
$databasepassword = "";
$con = mysql_connect($databasehost,$databaseusername,$dat abasepassword) or die(mysql_error());
mysql_select_db($databasename) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
$query = file_get_contents("php://input");
$sth = mysql_query($query);
if (mysql_errno()) {
header("HTTP/1.1 500 Internal Server Error");
echo $query.'\n';
echo mysql_error();
}
else
{
$rows = array();
while($r = mysql_fetch_assoc($sth)) {
$rows[] = $r;
}
print json_encode($rows);
}
?>
the query is this
Dim myquery As String="SELECT salt FROM user WHERE username ='Enzo'"
It would be appropriate to carry out this conversion directly in php, or send the user field and the password field and return true or false if the conditions are right
Who helps me to do such a thing ???
Sorry for the English, but use the google translator