Of course it is invalid.
That is actually not how bcrypt works, unlike SHA256 and MD5 where you have to hash the actual input so that you can compare passwords.
I'll be explaining how to hash/check passwords
When you show the register dialog for a player. You check if the input is long/short etc. Then you use bcrypt_hash function and pass the playerid argument then you do create a variabe where you will store the hash using bcrpt_get_hash function (Call the variable whatever you want and make sure the variable's size is "BCRYPT_HASH_LENGTH") then you insert it into the database
So if you want to log the player in, If using MySQL plugin, as I stated above, you are doing it wrong because the password is invalid,?you should use?cache_get_value_name or cache_get_field_content depends on your MySQL plugin version to get the password's value and store it in the player Password variable. Then in the login dialog you use bcyrpt_check function and pass playerid as an argument , then in the callback you specified you create a boolean variable that has the value "bcrypt_is_equal" then check if the variable is true or false, and that's it
Hopefully that helps. If you didn't understand yet. I can share a code example
(2021-01-30, 07:19 PM)Manyula Wrote: The whole point of a?hashing algorithm?is to take an input,?manipulate?the data and?output a?unique representation of the original input?(=hash) that cannot be reverted to its original input. If a user now inputs a password, you need to hash it and compare the hash of the user's input against the hash persisted in your database. If both hashes are equal the user has entered the correct password.
If you're looking into hashing passwords or any kind of sensitive data, you might also want to look into salting.
Hope this helps!
That is actually not how bcrypt works, unlike SHA256 and MD5 where you have to hash the actual input so that you can compare passwords.
I'll be explaining how to hash/check passwords
When you show the register dialog for a player. You check if the input is long/short etc. Then you use bcrypt_hash function and pass the playerid argument then you do create a variabe where you will store the hash using bcrpt_get_hash function (Call the variable whatever you want and make sure the variable's size is "BCRYPT_HASH_LENGTH") then you insert it into the database
So if you want to log the player in, If using MySQL plugin, as I stated above, you are doing it wrong because the password is invalid,?you should use?cache_get_value_name or cache_get_field_content depends on your MySQL plugin version to get the password's value and store it in the player Password variable. Then in the login dialog you use bcyrpt_check function and pass playerid as an argument , then in the callback you specified you create a boolean variable that has the value "bcrypt_is_equal" then check if the variable is true or false, and that's it
Hopefully that helps. If you didn't understand yet. I can share a code example