|
|
@ -1064,21 +1064,23 @@ class rcmail
|
|
|
|
mcrypt_generic_deinit($td);
|
|
|
|
mcrypt_generic_deinit($td);
|
|
|
|
mcrypt_module_close($td);
|
|
|
|
mcrypt_module_close($td);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (function_exists('des'))
|
|
|
|
else {
|
|
|
|
{
|
|
|
|
@include_once('lib/des.inc');
|
|
|
|
define('DES_IV_SIZE', 8);
|
|
|
|
|
|
|
|
$iv = '';
|
|
|
|
if (function_exists('des')) {
|
|
|
|
for ($i = 0; $i < constant('DES_IV_SIZE'); $i++)
|
|
|
|
$des_iv_size = 8;
|
|
|
|
$iv .= sprintf("%c", mt_rand(0, 255));
|
|
|
|
$iv = '';
|
|
|
|
$cipher = $iv . des($this->config->get_crypto_key($key), $clear, 1, 1, $iv);
|
|
|
|
for ($i = 0; $i < $des_iv_size; $i++)
|
|
|
|
}
|
|
|
|
$iv .= sprintf("%c", mt_rand(0, 255));
|
|
|
|
else
|
|
|
|
$cipher = $iv . des($this->config->get_crypto_key($key), $clear, 1, 1, $iv);
|
|
|
|
{
|
|
|
|
}
|
|
|
|
raise_error(array(
|
|
|
|
else {
|
|
|
|
'code' => 500, 'type' => 'php',
|
|
|
|
raise_error(array(
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'code' => 500, 'type' => 'php',
|
|
|
|
'message' => "Could not perform encryption; make sure Mcrypt is installed or lib/des.inc is available"
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
), true, true);
|
|
|
|
'message' => "Could not perform encryption; make sure Mcrypt is installed or lib/des.inc is available"
|
|
|
|
|
|
|
|
), true, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $base64 ? base64_encode($cipher) : $cipher;
|
|
|
|
return $base64 ? base64_encode($cipher) : $cipher;
|
|
|
@ -1110,20 +1112,22 @@ class rcmail
|
|
|
|
mcrypt_generic_deinit($td);
|
|
|
|
mcrypt_generic_deinit($td);
|
|
|
|
mcrypt_module_close($td);
|
|
|
|
mcrypt_module_close($td);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (function_exists('des'))
|
|
|
|
else {
|
|
|
|
{
|
|
|
|
@include_once('lib/des.inc');
|
|
|
|
define('DES_IV_SIZE', 8);
|
|
|
|
|
|
|
|
$iv = substr($cipher, 0, constant('DES_IV_SIZE'));
|
|
|
|
if (function_exists('des')) {
|
|
|
|
$cipher = substr($cipher, constant('DES_IV_SIZE'));
|
|
|
|
$des_iv_size = 8;
|
|
|
|
$clear = des($this->config->get_crypto_key($key), $cipher, 0, 1, $iv);
|
|
|
|
$iv = substr($cipher, 0, $des_iv_size);
|
|
|
|
}
|
|
|
|
$cipher = substr($cipher, $des_iv_size);
|
|
|
|
else
|
|
|
|
$clear = des($this->config->get_crypto_key($key), $cipher, 0, 1, $iv);
|
|
|
|
{
|
|
|
|
}
|
|
|
|
raise_error(array(
|
|
|
|
else {
|
|
|
|
'code' => 500, 'type' => 'php',
|
|
|
|
raise_error(array(
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'code' => 500, 'type' => 'php',
|
|
|
|
'message' => "Could not perform decryption; make sure Mcrypt is installed or lib/des.inc is available"
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
), true, true);
|
|
|
|
'message' => "Could not perform decryption; make sure Mcrypt is installed or lib/des.inc is available"
|
|
|
|
|
|
|
|
), true, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*-
|
|
|
|
/*-
|
|
|
|