Php 更改CodeIgniter encrypt类中的加密密码和方法,是否全局更改设置?

Php 更改CodeIgniter encrypt类中的加密密码和方法,是否全局更改设置?,php,codeigniter,encryption,Php,Codeigniter,Encryption,我在CodeIgniter有以下课程 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class ZoEncryption { public $_CI; public function __construct() { $this->_CI = & get_instance(); $this->_CI->encrypt->set_ciphe

我在CodeIgniter有以下课程

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
class ZoEncryption {

public $_CI;
public function __construct() {
    $this->_CI = & get_instance();
    $this->_CI->encrypt->set_cipher(MCRYPT_BLOWFISH);
    $this->_CI->encrypt->set_mode(MCRYPT_MODE_CBC);
}
function encode($str, $key) {
    return $this->_CI->encrypt->encode($str, $key);
}
function decode($str, $key) {
    return $this->_CI->encrypt->decode($str, $key);
    }
}

?>

不,它不会更改全局设置。它只会影响直接附加到定义它的位置的代码


如果您希望更改是全局性的,您将不得不对核心进行黑客攻击,或者对核心进行黑客攻击。

但正如我所说,它确实改变了一些东西。我将强调我的问题是什么。如果不显式设置密码,模式CI将使用默认值。如果使用默认值对某些内容进行编码,则无法使用其他密码或模式对其进行解码。更可能的情况是,您的库正在破坏内容,而不是您在CI中设置了密码和模式。但是,如果我不在我的顶级控制器中指定模式和密码,库工作正常。它非常著名的lib将5.5密码散列功能带到了旧版本中……如果您使用该库进行加密,为什么CI密码设置为什么很重要?使用库进行加密或使用CI的加密。把这两种东西混在一起是没有意义的……如果你看一看,请看:你会看到这一点的
$CI->encrypt->set_cipher(MCRYPT_BLOWFISH);

$CI->encrypt->set_mode(MCRYPT_MODE_CBC);