blessing-skin-server/libraries/Cipher/CrazyCrypt1.class.php
2016-04-03 17:17:42 +08:00

29 lines
741 B
PHP

<?php
/**
* @Author: printempw
* @Date: 2016-04-03 14:55:38
* @Last Modified by: printempw
* @Last Modified time: 2016-04-03 17:17:06
*/
namespace Cipher;
class CrazyCrypt1 implements EncryptInterface
{
/**
* Fucking CrazyCrypt1
*
* https://github.com/ST-DDT/CrazyLogin/blob/master/php/Encryptors/CrazyCrypt1.php
*/
public function encrypt($raw_passwd, $salt = "") {
// salt is username
$text = "ÜÄaeut//&/=I " . $raw_passwd . "7421€547" . $salt . "__+IÄIH§%NK " . $raw_passwd;
$t1 = unpack("H*", $text);
$t2 = substr($t1[1], 0, mb_strlen($text, 'UTF-8')*2);
$t3 = pack("H*", $t2);
$encrypt = hash("sha512", $t3);
return $encrypt;
}
}