SHA256_PassHash - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SHA256_PassHash (
/showthread.php?tid=661768)
SHA256_PassHash -
CaptainBoi - 14.12.2018
hello guys i am working on a new register/login system but i am confused with a problem i am getting.
i used this
on DIALOG_REGISTER
Код:
SetPVarInt(playerid, "confirmpass", SHA256_PassHash(inputtext, pInfo[playerid][Salt], pInfo[playerid][Password], 10));
but its not working correctly when i am using it on DIALOG_REGISTER_CONFIRM
Код:
if (GetPVarInt(playerid, "confirmpass") != SHA256_PassHash(inputtext, pInfo[playerid][Salt], pInfo[playerid][Password], 10))
help yea
Re: SHA256_PassHash -
CaptainBoi - 14.12.2018
bump need a quick help
Re: SHA256_PassHash -
Banditul18 - 14.12.2018
Because the sha256 function doesnt return any value so its useless to store it
https://sampwiki.blast.hk/wiki/SHA256_PassHash
If you want the player to confirm his password you gonna need to hash the text he input second time and compare with the hash stored in the password variable from the first dialog(using same salt)
Which means when player want to login in the future you gonna need to fetch his hashed password and his salt from the database and compare them with the input he make in the dialog( player saved salt must be used when you hash the dialog input)
Or you can use BCrypt
https://sampforum.blast.hk/showthread.php?tid=453544
Re: SHA256_PassHash -
CaptainBoi - 14.12.2018
thanks, but i wanted the help with sha function because i am done with my system
i am just working on confirm one.