SHA256_PassHash
#1

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
Reply
#2

bump need a quick help
Reply
#3

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
Reply
#4

thanks, but i wanted the help with sha function because i am done with my system
i am just working on confirm one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)