Whirlpool hash problem
#13

Emh hold on. Found why is still in SHA1.

Login dialog:

pawn Код:
if(dialogid == DIALOG_LOGIN)
    {
        if(!response)
        {
        SendClientMessage(playerid, COLOR_RED, "** To play you must be registered or logged in.");
        KickTimer[playerid] = SetTimerEx("KickPlayer",200,false,"d",playerid);
        }
        if(response)
        {
            new query[200], pname[24], escapepass[100];
            GetPlayerName(playerid, pname, 24);
            mysql_real_escape_string(inputtext, escapepass);
            format(query, sizeof(query), "SELECT `user` FROM playerdata WHERE user = '%s' AND password = SHA1('%s')", pname, escapepass);
            mysql_query(query);
            mysql_store_result();
            new numrows = mysql_num_rows();
            if(numrows == 1) MySQL_Login(playerid);
            if(!numrows)
            {
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""White"Please log-in", ""White"Welcome back to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to log-in!\n\n"White"Please insert "Red"your"White" password below:", "Login", "Cancel");
                GameTextForPlayer(playerid,"~w~Wrong ~r~password.",2000,6);
            }
            mysql_free_result();
        }
    }
And this is register dialog if you need:

pawn Код:
if(dialogid == DIALOG_REGISTER)
    {
        if(response)
        {
            if(CheckInput(inputtext)) return SendClientMessage(playerid, 0x0000ff, "You cannot use this password.");
            if(!strlen(inputtext) || strlen(inputtext) > 100)
            {
                SendClientMessage(playerid,COLOR_RED,"Please enter a password within the length of 1 - 100 characters.");
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""White"Please register",""White"Welcome to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to register!\n\n"White"Please insert a password below:", "Register", "Cancel");
            }
            else if(strlen(inputtext) > 0 && strlen(inputtext) < 100)
            {
                new escpass[100];
                mysql_real_escape_string(inputtext, escpass);
                MySQL_Register(playerid, escpass);
            }
        }
        if(!response)
        {
        SendClientMessage(playerid, COLOR_RED, "** To play you must be registered or logged in.");
        KickTimer[playerid] = SetTimerEx("KickPlayer",200,false,"d",playerid);
        }
    }
@pds2k12: Edited column size.
Reply


Messages In This Thread
Whirlpool hash problem - by Face9000 - 04.01.2014, 21:20
Re: Whirlpool hash problem - by RedFusion - 04.01.2014, 21:28
Re: Whirlpool hash problem - by Face9000 - 04.01.2014, 21:36
Re: Whirlpool hash problem - by RedFusion - 04.01.2014, 21:42
Re: Whirlpool hash problem - by Face9000 - 04.01.2014, 21:44
Re: Whirlpool hash problem - by RedFusion - 04.01.2014, 21:47
Re: Whirlpool hash problem - by Konstantinos - 04.01.2014, 21:50
Re: Whirlpool hash problem - by Face9000 - 04.01.2014, 21:59
Re: Whirlpool hash problem - by Konstantinos - 04.01.2014, 22:08
Re: Whirlpool hash problem - by Face9000 - 04.01.2014, 22:11
Re: Whirlpool hash problem - by Patrick - 04.01.2014, 22:14
Re: Whirlpool hash problem - by Konstantinos - 04.01.2014, 22:15
Re: Whirlpool hash problem - by Face9000 - 04.01.2014, 22:16
Re: Whirlpool hash problem - by Patrick - 04.01.2014, 22:18
Re: Whirlpool hash problem - by Konstantinos - 04.01.2014, 22:19
Re: Whirlpool hash problem - by Face9000 - 04.01.2014, 22:24

Forum Jump:


Users browsing this thread: 3 Guest(s)