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

Viewed 17870

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

enter image description here

Thanks for your help

2 Answers

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

Related