Big_Shark писал(а):Выруби mcrypt и все .
а до вызова _add_cipher_noise() данные одинаковые ?
В какой кодировки файлы и строка с которой ты работаешь?
Глянь так что будет
- Код: Выделить всё
$msg = 'My secret message';
$key='dfghsdfgsdg';
$encrypted_string = $this->encrypt->mcrypt_encode($msg,$key);
echo $encrypted_string;
echo $this->encrypt->mcrypt_decode($encrypted_string,$key);
и так, только перед этим поменяй названия функций
_add_cipher_noise=>add_cipher_noise
_remove_cipher_noise=>remove_cipher_noise
- Код: Выделить всё
$msg = 'My secret message';
$key='dfghsdfgsdg';
$encrypted_string = $this->encrypt->add_cipher_noise($msg,$key);
echo $encrypted_string;
echo $this->encrypt->remove_cipher_noise($encrypted_string,$key);
Напиши что вывел код который я тебе отправлял ранее на денвери и на сервере.
function inf()
{ $msg = 'My secret message';
$key='dfghsdfgsdg';
$encrypted_string = $this->encrypt->mcrypt_encode($msg,$key);
echo '$encrypted_string = '.$encrypted_string.'<br>';
echo '$this->encrypt->mcrypt_decode() = '.$this->encrypt->mcrypt_decode($encrypted_string,$key);
echo '<hr>';
$msg = 'My secret message';
$key='dfghsdfgsdg';
$encrypted_string = $this->encrypt->add_cipher_noise($msg,$key);
echo '$this->encrypt->add_cipher_noise() = '.$encrypted_string.'<br>';
echo '$this->encrypt->remove_cipher_noise() = '.$this->encrypt->remove_cipher_noise($encrypted_string,$key);
}$encrypted_string = ������J�"��hSԄAYʹ��"�ѫ�ݮn�'��)�;�
$this->encrypt->mcrypt_decode() = 0
$this->encrypt->add_cipher_noise() = ��P������X���Ւ��
$this->encrypt->remove_cipher_noise() = My secret mess
Dionysius писал(а):Проблема в libmcrypt
Что и требовалось доказать
Отключение libmcrypt в Encrypt.php - т.е. шифровка средствами CI - всё работает.
Буду побывать другие методы шифрования из libmcrypt - может что-то заработает.
function CI_Encrypt()
{
$this->CI =& get_instance();
//$this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
$this->_mcrypt_exists = FALSE;
log_message('debug', "Encrypt Class Initialized");
}
$config['encryption_key'] = "asd9f87asdfj09sd8fhsd8fa";
$config['sess_cookie_name'] = 'documents_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'documents_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['global_xss_filtering'] = TRUE;DEBUG - 2009-02-18 14:35:06 --> Config Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Hooks Class Initialized
DEBUG - 2009-02-18 14:35:06 --> URI Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Router Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Output Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Input Class Initialized
DEBUG - 2009-02-18 14:35:06 --> XSS Filtering completed
DEBUG - 2009-02-18 14:35:06 --> Global POST and COOKIE data sanitized
DEBUG - 2009-02-18 14:35:06 --> Language Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Loader Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Helper loaded: url_helper
DEBUG - 2009-02-18 14:35:06 --> Helper loaded: dknt_helper
DEBUG - 2009-02-18 14:35:06 --> Database Driver Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Session Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Helper loaded: string_helper
DEBUG - 2009-02-18 14:35:06 --> Encrypt Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Session garbage collection performed.
DEBUG - 2009-02-18 14:35:06 --> Session routines successfully run
DEBUG - 2009-02-18 14:35:06 --> Controller Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Helper loaded: form_helper
DEBUG - 2009-02-18 14:35:06 --> Helper loaded: html_helper
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> Model Class Initialized
DEBUG - 2009-02-18 14:35:06 --> File loaded: /var/www/localhost/htdocs/documents/system/application/views/upload_form.php
DEBUG - 2009-02-18 14:35:06 --> Final output sent to browser
DEBUG - 2009-02-18 14:35:06 --> Total execution time: 0.0737
DEBUG - 2009-02-16 13:51:06 --> Config Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Hooks Class Initialized
DEBUG - 2009-02-16 13:51:06 --> URI Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Router Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Output Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Input Class Initialized
DEBUG - 2009-02-16 13:51:06 --> XSS Filtering completed
DEBUG - 2009-02-16 13:51:06 --> Global POST and COOKIE data sanitized
DEBUG - 2009-02-16 13:51:06 --> Language Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Loader Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Helper loaded: url_helper
DEBUG - 2009-02-16 13:51:06 --> Helper loaded: dknt_helper
DEBUG - 2009-02-16 13:51:06 --> Database Driver Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Controller Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Session Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Helper loaded: string_helper
DEBUG - 2009-02-16 13:51:06 --> Encrypt Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Session routines successfully run
DEBUG - 2009-02-16 13:51:06 --> Helper loaded: form_helper
DEBUG - 2009-02-16 13:51:06 --> Helper loaded: cookie_helper
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Model Class Initialized
DEBUG - 2009-02-16 13:51:06 --> Helper loaded: html_helper
DEBUG - 2009-02-16 13:51:06 --> File loaded: /var/www/localhost/htdocs/documents/system/application/views/upload_form.php
DEBUG - 2009-02-16 13:51:06 --> Final output sent to browser
DEBUG - 2009-02-16 13:51:06 --> Total execution time: 0.0709
$session = $this->CI->input->cookie($this->sess_cookie_name);
// No cookie? Goodbye cruel world!...
if ($session === FALSE)
{
log_message('debug', 'A session cookie was not found.');
return FALSE;
} Sam Dark писал(а):Получил подсказку от Павла. Надо попробовать убрать подчёркивание из имени cookie.
Sam Dark писал(а):В общем, с mcrypt последняя ситуация не связана… с чем связана — не очень понятно…
Sam Dark писал(а):Ещё вариант — попробовать отключить хранение кук в БД. Если поможет — есть шанс, что длины поля в базе не хватает для хранения сессии.
$cookie = array(
'name' => 'testcookies',
'value' => 'НЕ ЛАЖА'
);
set_cookie($cookie);
$erf = get_cookie("value");
if ($erf == FALSE) $erf = 'ЛАЖА';Вернуться в Сессии и авторизация
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0