Welcome Guest, Not a member yet? Register   Sign In
about Encryption Library
#1

Hello, I have 2 function for encode and decode.

So I upgrade php to php7.1 and I can not use encrypt old library.

now I try to using encryption new library.

and I get string / = + after encrypt because / it make can not pass string on url

Pls, I need you help.

PHP Code:
public function encode_me($string$key '') {
        
//$this->load->library('encrypt');
        //return rtrim(strtr(base64_encode($this->encrypt->mcrypt_encode($string, $this->encrypt->get_key($key))), '+/', '-_'), '=');

        
$this->load->library('encryption');
        return 
$this->encryption->encrypt($string);
    }

    public function 
decode_me($string$key '') {
        
//$this->load->library('encrypt');
        //return $this->encrypt->mcrypt_decode(base64_decode(str_pad(strtr($string, '-_', '+/'), strlen($string) % 4, '=', STR_PAD_RIGHT)), $this->encrypt->get_key($key));

        
$this->load->library('encryption');
        return 
$this->encryption->decrypt($string);
    } 
Reply


Messages In This Thread
about Encryption Library - by seasenx6 - 03-12-2017, 02:33 AM
RE: about Encryption Library - by seasenx6 - 03-12-2017, 02:39 AM
RE: about Encryption Library - by Narf - 03-12-2017, 06:45 AM
RE: about Encryption Library - by Narf - 03-12-2017, 06:47 AM
RE: about Encryption Library - by seasenx6 - 03-12-2017, 05:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB