private function encrypt($data)
    {
        $bin_key = pack("H*", substr($this->secret_key, 8));
        $aes_key = substr($bin_key, 0, 16);
        $salt = substr($bin_key, 16, 16);
        $iv = openssl_random_pseudo_bytes(16);
        $encrypted = openssl_encrypt($data, 'aes-128-cbc', $aes_key, true, $iv);
        $digest = hash_hmac('sha256', $data . $iv, $salt, true);
        return base64_encode($iv . $digest . $encrypted);
    }