php源码后台提示音不能播报,wecenter 点管理进入后台的时候 弹出页面提示crypt.php有错误代码...

新安装的

已解决,方法:直接输入地址:你的域名/?/admin/login/

crypt.php 代码:

/*

+--------------------------------------------------------------------------

| WeCenter [#RELEASE_VERSION#]

| ========================================

| by WeCenter Software

| © 2011 - 2014 WeCenter. All Rights Reserved

| [url=http://www.wecenter.com]http://www.wecenter.com[/url]

| ========================================

| Support: WeCenter@qq.com

|

+---------------------------------------------------------------------------

*/

class core_crypt

{

public function __construct()

{

if (!function_exists('mcrypt_module_open'))

{

exit('Error: Mcrypt Module not support');

}

}

public function encode($data, $key = null)

{

$mcrypt = mcrypt_module_open($this->get_algorithms(), '', MCRYPT_MODE_ECB, '');

mcrypt_generic_init($mcrypt, $this->get_key($mcrypt, $key), mcrypt_create_iv(mcrypt_enc_get_iv_size($mcrypt), MCRYPT_RAND));

$result = mcrypt_generic($mcrypt, gzcompress($data));

mcrypt_generic_deinit($mcrypt);

mcrypt_module_close($mcrypt);

return $this->get_algorithms() . '|' . $this->str_to_hex($result);

}

public function decode($data, $key = null)

{

if ($algorithm = strstr($data, '|', true))

{

$data = str_replace($algorithm . '|', '', $data);

$data = $this->hex_to_str($data);

}

else

{

$algorithm = $this->get_algorithms();

$data = base64_decode($data);

}

$mcrypt = mcrypt_module_open($algorithm, '', MCRYPT_MODE_ECB, '');

mcrypt_generic_init($mcrypt, $this->get_key($mcrypt, $key), mcrypt_create_iv(mcrypt_enc_get_iv_size($mcrypt), MCRYPT_RAND));

$result = trim(mdecrypt_generic($mcrypt, $data));

mcrypt_generic_deinit($mcrypt);

mcrypt_module_close($mcrypt);

return gzuncompress($result);

}

private function get_key($mcrypt, $key = null)

{

if (!$key)

{

$key = G_COOKIE_HASH_KEY;

}

return substr($key, 0, mcrypt_enc_get_key_size($mcrypt));

}

private function get_algorithms()

{

$algorithms = mcrypt_list_algorithms();

foreach ($algorithms AS $algorithm)

{

if (strstr($algorithm, '-256'))

{

return $algorithm;

}

}

foreach ($algorithms AS $algorithm)

{

if (strstr($algorithm, '-128'))

{

return $algorithm;

}

}

return end($algorithms);

}

private function str_to_hex($string)

{

for ($i = 0; $i < strlen($string); $i++)

{

$ord = ord($string[$i]);

$hexCode = dechex($ord);

$hex .= substr('0' . $hexCode, -2);

}

return strtoupper($hex);

}

private function hex_to_str($hex)

{

for ($i = 0; $i < strlen($hex)-1; $i += 2)

{

$string .= chr(hexdec($hex[$i] . $hex[$i + 1]));

}

return $string;

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值