Whirlpool HASH
#1

Hello I need some help, with the Hash function from Whirlpool

pawn Code:
case 3895:
            {
                new string[128];
                format(string, sizeof(string), "Accounts/%s.ini", GetName(playerid));
                if(response == 0)
                {
                    Kick(playerid);
                }
                else
                {
                    if(!fexist(string))
                    {
                        if(strlen(inputtext) >= 1)
                        {
                            new pw[128];
                            WP_Hash(pw, sizeof (pw), inputtext);
                            RegisterPlayer(playerid, pw);
                        }
                        else
                        {
                            SendClientMessage(playerid, WHITE, "Must be longer than 1 char.");
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, WHITE, "Your account already exists.");
                    }
                }
            }
Thats the dialogresponce from the register window.

then I got my Register function:

pawn Code:
public RegisterPlayer(playerid, password[])/*register*/
{
    new string[128], Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(string, sizeof(string), "Accounts/%s.ini", Name);
    if(!fexist(string))
    {
        dini_Create(string);
        dini_Set(string, "Password", password);
        format(Player[playerid][Password], 128, "%s", password);
but the file shows:

Code:
Password=
What did I do wrong?
Reply
#2

Set the string size which you're executing in Whirlpool to 129 because thats the size in which Whirlpool performs hashing.
Reply
#3

Quote:
Originally Posted by Lordz™
View Post
Set the string size which you're executing in Whirlpool to 129 because thats the size in which Whirlpool performs hashing.
Quote:
Originally Posted by Y_Less
View Post
Did you try debugging the "RegisterPlayer" function?
Just debugged it with the comment from Lordz, working now thanks

~SOLVED~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)