Need help of encrypted Password
#1

I am using Raven's Roleplay. And my problem is that the password come in hex/encrypted. How will i decrypted?
================================================== =================================
Reply
#2

I don't think you can/should, if you need to check if a password is correct - hash it (the entered password) then compare that hash to the one thats saved using strcmp.
Reply
#3

do you know how to do it?
Reply
#4

Never used ravens rolplay (or even looked at it) do you know what kind of hash it is? Does it use a plugin or does it have its own hash function?
Reply
#5

it's some kind of num_hash

pawn Код:
if(dialogid == 335)
        {
            if(response)
            {
                strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
                if(!strcmp(Typed[playerid], "None", true))
                {
                    ShowPlayerDialog(playerid, 335, DIALOG_STYLE_INPUT,"Try Again, Please Confirm","You didn't typed a password! \n Type your password below to confirm your identify","Ok","Back");
                }
                else
                {
                    new password2 = num_hash(inputtext);
                    if(PlayerInfo[playerid][pKey] == password2)
                    {
                        strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
                        ShowPlayerDialog(playerid, 336, DIALOG_STYLE_INPUT,"Select your new Password","Type your new password below now","Ok","Back");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY,"* Wrong Password!");
                    }
                }
            }
            else
            {
                ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST,"Select an Item","1\t Change Password \n2\t Increase your Level \n3\t Authorize Upgrades \n4\t Account Information \n5\t Authorize Change Name \n6\t Authorize quit faction.\n7\t Authorize Sell House\n8\t Authorize Sell Bizz","Select","Cancel");
            }
        }
Reply
#6

Here is the num_hash

pawn Код:
stock num_hash(buf[])
 {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++) {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
 }
Reply
#7

I'm not actually %100 sure but try something like this,
pawn Код:
new
    Buff = num_hash(ENTERED_PASSWORD);//swap ENTERED_PASSWORD for the password the player entered (could be inputtext?)

if(Buff != SAVED_PASSWORD)//Swap SAVED_PASSWORD for the hash that is saved. (possibly in a file)
{//password is incorrect
}
else
{//password is correct
}
Comments are important.
Reply
#8

my login system hash's it and i put it on their but forgot how 2 take it off if any1 can help me through teamviewer would be great
Reply
#9

i fixed it on my own thankz guyz

@hadzx I can show you how to do it?
Reply
#10

ok i guess u got msn?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)