- substr: documentation ( source)
- base64_decode: documentation ( source)
- sha1: documentation ( source)
- base64_encode: documentation ( source)
<?php
$hash = "{SSHA}j/r2/pEsrmd2fQUkcJ2wDkqhrK9hLmNvbDIxMDY=";
$password = "&'(-_)=~#{[|`\^@]}";
$salt = substr(base64_decode(substr($hash,6)),20);
echo $salt."\n";
$encrypted_password = '{SSHA}' . base64_encode(sha1( $password.$salt, TRUE ). $salt);
echo $encrypted_password."\n";