MySQL password hash
#8

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
hash point is to be un reversable, you dont have to see others passwords, to steal their fb account
I don't think he meant it that way.

You can't and don't need to dehash it, only compare

PHP код:
        case DIALOG_LOGIN:
        {
            if(
response)
            {
                new 
query[500], HashedPW[130];
                
WP_Hash(HashedPW, sizeof(HashedPW), inputtext);
                
mysql_format(Database, query, sizeof(query), "SELECT * FROM userdata WHERE User='%e' AND Password='%e'", GetName(playerid), HashedPW);
                
mysql_tquery(Database, query, "OnUserLogin", "d", playerid);
            }
              else
                
Kick(playerid);
            return 
1;
        }
        case 
DIALOG_REGISTER:
        {
            if(
response)
             {
                new 
query[500], HashedPW[130], GPCI[128];
                
gpci(playerid, GPCI, sizeof(GPCI));
                
WP_Hash(HashedPW, sizeof(HashedPW), inputtext);
                
mysql_format(Database, query, sizeof(query), "INSERT INTO `userdata` (`User`,`Password`,`RegisterIP`, `CreatedOn`, `GPCI`) VALUES ('%e', '%e', '%e', NOW(), '%e')", GetName(playerid), HashedPW, Player_IP[playerid], GPCI);
                
mysql_tquery(Database, query, "OnUserRegister", "d", playerid);
            }
            else
                 
Kick(playerid);
            return 
1;
        } 
Reply


Messages In This Thread
MySQL password hash - by Kraeror - 18.05.2018, 12:26
Re: MySQL password hash - by Logic_ - 18.05.2018, 12:27
Re: MySQL password hash - by Kraeror - 18.05.2018, 13:53
Re: MySQL password hash - by Kraeror - 18.05.2018, 14:34
Re: MySQL password hash - by kovac - 18.05.2018, 15:12
Re: MySQL password hash - by Kraeror - 18.05.2018, 15:26
Re: MySQL password hash - by CodeStyle175 - 18.05.2018, 15:38
Re: MySQL password hash - by kovac - 18.05.2018, 15:39
Re: MySQL password hash - by Kraeror - 18.05.2018, 15:41
Re: MySQL password hash - by Kraeror - 18.05.2018, 15:51

Forum Jump:


Users browsing this thread: 1 Guest(s)