<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Index_perkara{

	function index_no_perkara($encrypt){
	    $kc='9cab17e52b2e8e9ae3f21e08c5952028a2b545723caaf4ac5dce8ec10d967701';
	    $encrypt = serialize($encrypt);
	    $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);
	    $kc = pack('H*', $kc);
	    $mac = hash_hmac('sha256', $encrypt, substr(bin2hex($kc), -32));
	    $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $kc, $encrypt.$mac, MCRYPT_MODE_CBC, $iv);
	    $encoded = base64_encode($passcrypt).'|'.base64_encode($iv);
	    return $encoded;
	}

}