18.01.2016, 23:27
hello guys,
I'm currently working on a small project.
and i want players to be able to change their password ingame if there logged in.
I'm using whirlpool to hash the passwords but i have no idea on how to do this.
would something like..
work or?
also, do i need to dehash the password in order to change it ingame?
since the player has to input his current password, in order to change it.
/changepass currentpass newpass newpass2
Also how would i get it to match newpass and newpass2, like..
Make sure he knows what he's changing his password to for confirmation.
also, i see alot about Salt, what is it?
i take it its not that stuff u cook with?
I'm currently working on a small project.
and i want players to be able to change their password ingame if there logged in.
I'm using whirlpool to hash the passwords but i have no idea on how to do this.
would something like..
Код:
CMD:changepass(playerid, params[]) { new oldpass[24], newpass[24]; if(sscanf(params,"ss",oldpass, newpass)) return SendClientMessage(playerid,-1,"{ff0000}[Server]:{ffffff} /Changepass [currentpass] [newpass] [newpass2]"); oldpass = cache_get_field_content(0, "Password", pData[playerid][Password], mysql, 129); //how would i dehash it? if(newpass > MAX_PLAYER_PASSWORD) return SendClientMessage(playerid, -1, "password can maximal be 16 characters"); if(newpass < MIN_PLAYER_PASSWORD) return SendClientMessage(playerid, -1, "password needs to be atleast 3 characters"); //and here update it with the hashed new password? return 1; }
also, do i need to dehash the password in order to change it ingame?
since the player has to input his current password, in order to change it.
/changepass currentpass newpass newpass2
Also how would i get it to match newpass and newpass2, like..
Make sure he knows what he's changing his password to for confirmation.
also, i see alot about Salt, what is it?
i take it its not that stuff u cook with?