Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Password encryption help

$
0
0
How would I make my script work with this php encryption :?

Code:

                public function encrypt( $string, $encryption_key )
                {

                        $password = hash( 'sha256', $string );
                        $length  = strlen( $password ) / 2;

                        if ( strlen( $password ) % 2 ) {
                                $length++;
                        }

                        $passSplit = str_split( $password, $length );
                        $saltSplit = str_split( $encryption_key, 3 );

                        $string  = $saltSplit[0] . $passSplit[0] . $saltSplit[1] . $passSplit[1] . $saltSplit[2];
                        $encrypt = hash( 'whirlpool', $string );

                        return $encrypt;
                }

                public function encryption_key()
                {

                        $numbers = array( 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60 );

                        return substr( sha1( rand( $numbers[0], $numbers[count( $numbers ) - 1] ) ), 0, $numbers[rand( 0, count( $numbers ) - 1 )] );
                }


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>