Jump to content

encrypt string+salt


RobertP

Recommended Posts

any visible issues ?

private function encrypt($string,$salt){
return utf8_encode(hash('sha256',substr($salt,(int)(floor(strlen($salt)/2))).$string.substr($salt,0,(int)((floor(strlen($salt)/2))*-1))));
}

 

edit: example

 

$string = 'password';
$salt = '12345678';
the script will encrypt the password as $string = '1234password5678';

Link to comment
https://forums.phpfreaks.com/topic/254096-encrypt-stringsalt/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.