Who know if this php function works on pawn?
#1

Can i make a inc to use it on my local samp server, instead to use https to call it on a external host server?

I want my login server work even the external host server it's down.

Код:
public function hashPassword($password)
{
       $salt = "$2a$" . SOMETHING . "$" . SOMETHING_ELSE;

        $newPassword = $password;
        for ($i = 0; $i < PASSWORD_SHA512_ITERATIONS; $i++) {
            $newPassword = hash('sha512', $salt.$newPassword.$salt);
        }
        return $newPassword;
}
Ty to see my question.
Reply
#2

Try to search using useful keywords of your issue next time - https://sampforum.blast.hk/showthread.php?tid=188734
Reply
#3

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Try to search using useful keywords of your issue next time - https://sampforum.blast.hk/showthread.php?tid=188734
I used this plugin but it dosn't return the same string.
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
1) Don't invent your own hash system, use the BCrypt plugin.

2) For a hash to be good, it needs to take a long time (so it is hard to bruteforce). This means if you do the hashing in an include you will halt server processing for hundreds of milliseconds, which will cause noticable lag. This is a legitimately worrying amount of time, unlike the tiny bits people normally worry about.

3) Don't call "hash" for multiple rounds in PHP. Not because rounds are a bad idea - they are a great idea; but because PHP's "hash" function is broken when called multiple times. I reported this to them literally years ago and they closed the report as "not a bug", despite me providing clear examples.

4) Don't use a constant salt the same for everyone, that is nearly as bad as no salt, since any attackers can still just precompute common passwords for comparison.

5) Use the BCrypt plugin.

6) Use the BCrypt plugin.

7) Use the BCrypt plugin.
****** ty for ur answer. I have some more questions on ur replays.

2) Should i still use a external host to provide the password hash because the hashing process will lag my server?
3) If PHP "hash" have some bugs when it's called multilpe times, should i call it one tine to avoid bugs and lags?
4) Should I generate a random salt, for each registration, and store it in database? But then... the salt it will be ez avaible when the DB will be broken. I'm thinking to use a static salt(not-stored) and a dynamic salt(stored) in DB, it's this secure and ok?
5), 6), 7) Is it the good BCrypt plugin? (https://sampforum.blast.hk/showthread.php?tid=453544)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)