SA-MP Forums Archive
Whirlpool Encryption and PHP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Whirlpool Encryption and PHP (/showthread.php?tid=426360)



Whirlpool Encryption and PHP - Kebab- - 28.03.2013

Hello,
I'd like to ask for support. My server is a MySQL based server and uses Whirlpool encryption. I've made a control panel which doesn't use Whirlpool encryption and uses MD5, SH1 and Salts which are hashed. How would I be able to transfer Whirlpool hash onto my PHP panel? Their databases are already linked, but I am just wondering if it's actually possible to link the server user password and make it able to log onto the control panel using the in-game password?

Website code:
PHP код:
        public function encrypt$string ) {
            
            global 
$vars;
            
//let's md5 that salt and the string.
            
$salt1  md5$params['core']['salt1'] );
            
$salt2  md5$params['core']['salt2'] );
            
$string md5$string );
            
//stick them together.
            
$string $salt1 $salt1 $salt2 $string $salt2 $salt1;
            
//sha1 then md5 them again.
            
$string sha1$string );
            
$string md5$string );
            return 
$string;
        
        } 
SA:MP uses basic whirlpool:

PHP код:
native WP_Hash(buffer[], len, const str[]); 
Many thanks!


Re: Whirlpool Encryption and PHP - InfiniTy. - 28.03.2013

Even though this is not a PHP forum..there you go
PHP код:
public function encrypt$string ) {
    global 
$vars;
    
$string hash('whirlpool',$string);
    return 
$string;

Don't know what's that $vars doing there.. i just left there tho..

Shorter version
PHP код:
public function encrypt$string ) {
    return 
hash('whirlpool',$string);