Function mcrypt_get_iv_size() is deprecated in codeigniter on PHP version 7.1

╄→гoц情女王★ 提交于 2019-12-22 17:49:17

问题


When I encrypt my ID using encrypt library that time it gives me an error like :

Thanks for your help


回答1:


codeigniter already mention it on their official documentation of encrypt Library

This library has been DEPRECATED and is only kept for backwards compatibility. Please use the new Encryption Library.

use new Encryption Library. https://codeigniter.com/userguide3/libraries/encryption.html




回答2:


I'm using php 7.2 and I can solve using the new library encryption recommend.

Example:

// #Encrypt

$this->load->library('encryption');
$to_encrypt="some value";
$this->encryption->initialize(
        array(
                'cipher' => 'aes-256',
                'mode' => 'ctr',
                'key' => $this->config->config['encryption_key']
        )
);
echo $this->encryption->encrypt($to_encrypt);

More Info -> https://codeigniter.com/userguide3/libraries/encryption.html



来源:https://stackoverflow.com/questions/45341314/function-mcrypt-get-iv-size-is-deprecated-in-codeigniter-on-php-version-7-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!