hash password with md5
#8

Quote:
Originally Posted by Meller
Посмотреть сообщение
I'd suggest you to use SHA256 with a secret HASH, example:

PHP код:
SHA256_PassHash(password[], salt[], ret_hash[], ret_hash_len)
SHA256_PassHash("the input"""ur secret hash/salt", password, sizeof password); 
how i can edit according to this?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
hash password with md5 - by warningCode - 14.09.2017, 13:58
Re: hash password with md5 - by Zeth - 14.09.2017, 14:05
Re: hash password with md5 - by Vince - 14.09.2017, 14:08
Re: hash password with md5 - by warningCode - 14.09.2017, 14:30
Re: hash password with md5 - by warningCode - 15.09.2017, 19:31
Re: hash password with md5 - by Meller - 15.09.2017, 19:37
Re: hash password with md5 - by Whatname - 15.09.2017, 19:51
Re: hash password with md5 - by warningCode - 15.09.2017, 19:52
Re: hash password with md5 - by Meller - 15.09.2017, 19:55
Re: hash password with md5 - by warningCode - 15.09.2017, 20:02

Forum Jump:


Users browsing this thread: 1 Guest(s)