What is the purpose of the encryption_helper.php file?
- 内容介绍
- 文章标签
- 相关推荐
本文共计270个文字,预计阅读时间需要2分钟。
phpencryption->initialize(array( 'cipher'=> 'aes-256', 'mode'=> 'ctr', 'key'=> 'bafc42c3d77e1412c7043ddb57aab8bc7e70a0a3e61bdde1571e35d1a422409c'));$start=TRUE;?>if (is_array($data) || is_object($data)) { // Code here}
load->library('encryption'); $CI->encryption->initialize( array( 'cipher' => 'aes-256', 'mode' => 'ctr', 'key' => 'bafc42c3d77e1412c7043ddb57aab8bc7e70a0a3e61bdde1571e35d1a422409c' ) ); $start = TRUE; } if (is_array($data) || is_object($data)) { foreach ($data as $key => $item) { $value = encrypt($item); (is_array($data) && $data[$key] = $value) || (is_object($data) && $data->$key = $value); } return $data; } else { return $CI->encryption->encrypt($data); } } } if(!function_usable('decrypt')) { /** * 对使用 encrypt() 方法加密的数据进行解密 * 支持 string、array 与 object 类型 * * @param mixed $data 需要解密的内容 * @return mixed */ function decrypt($data) { $CI = get_instance(); static $start; if (!$start) { $CI->load->library('encryption'); $CI->encryption->initialize( array( 'cipher' => 'aes-256', 'mode' => 'ctr', 'key' => 'bafc42c3d77e1412c7043ddb57aab8bc7e70a0a3e61bdde1571e35d1a422409c' ) ); $start = TRUE; } if (is_array($data) || is_object($data)) { foreach ($data as $key => $item) { $value = decrypt($item); (is_array($data) && $data[$key] = $value) || (is_object($data) && $data->$key = $value); } return $data; } else { return $CI->encryption->decrypt($data); } } }
本文共计270个文字,预计阅读时间需要2分钟。
phpencryption->initialize(array( 'cipher'=> 'aes-256', 'mode'=> 'ctr', 'key'=> 'bafc42c3d77e1412c7043ddb57aab8bc7e70a0a3e61bdde1571e35d1a422409c'));$start=TRUE;?>if (is_array($data) || is_object($data)) { // Code here}
load->library('encryption'); $CI->encryption->initialize( array( 'cipher' => 'aes-256', 'mode' => 'ctr', 'key' => 'bafc42c3d77e1412c7043ddb57aab8bc7e70a0a3e61bdde1571e35d1a422409c' ) ); $start = TRUE; } if (is_array($data) || is_object($data)) { foreach ($data as $key => $item) { $value = encrypt($item); (is_array($data) && $data[$key] = $value) || (is_object($data) && $data->$key = $value); } return $data; } else { return $CI->encryption->encrypt($data); } } } if(!function_usable('decrypt')) { /** * 对使用 encrypt() 方法加密的数据进行解密 * 支持 string、array 与 object 类型 * * @param mixed $data 需要解密的内容 * @return mixed */ function decrypt($data) { $CI = get_instance(); static $start; if (!$start) { $CI->load->library('encryption'); $CI->encryption->initialize( array( 'cipher' => 'aes-256', 'mode' => 'ctr', 'key' => 'bafc42c3d77e1412c7043ddb57aab8bc7e70a0a3e61bdde1571e35d1a422409c' ) ); $start = TRUE; } if (is_array($data) || is_object($data)) { foreach ($data as $key => $item) { $value = decrypt($item); (is_array($data) && $data[$key] = $value) || (is_object($data) && $data->$key = $value); } return $data; } else { return $CI->encryption->decrypt($data); } } }

