protected function decrypt($data)
    {
        $data = base64_decode($data);
        $salt = substr($data, 0, 16);
        $data = substr($data, 16);

        $salted = hash('sha512', $this->key . $salt, true);
        $key    = substr($salted, 0, 32);
        $iv     = substr($salted, 32, 16);

        return openssl_decrypt($data, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
    }
protected function decrypt($data)
    {
        $data = base64_decode($data);
        $salt = substr($data, 0, 16);
        $data = substr($data, 16);

        $salted = hash('sha512', $this->key . $salt, true);
        $key    = substr($salted, 0, 32);
        $iv     = substr($salted, 32, 16);

        return openssl_decrypt($data, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
    }
protected function decrypt ( $ data ) { $ data = base64_decode ( $ data ) ; $ salt = substr ( $ data , 0 , 16 ) ; $ data = substr ( $ data , 16 ) ; $ salted = hash ( 'sha512' , $ this -> key . $ salt , true ) ; $ key = substr ( $ salted , 0 , 32 ) ; $ iv = substr ( $ salted , 32 , 16 ) ; return openssl_decrypt ( $ data , 'AES-256-CBC' , $ key , OPENSSL_RAW_DATA , $ iv ) ; }
Decrypt session data

@param  string $data Encrypted session data
@return string
Decrypt session data