<?php
function encrypt($value){  

	
	// Store the cipher method
	$ciphering = "AES-128-CTR";
	  
	// Use OpenSSl Encryption method
	$iv_length = openssl_cipher_iv_length($ciphering);
	$options = 0;
	  
	// Non-NULL Initialization Vector for encryption
	$encryption_iv = '1234567891011121';
	  
	// Store the encryption key
	$encryption_key = "1213212312312312312323";
	  
	// Use openssl_encrypt() function to encrypt the data
	$encryption = openssl_encrypt($value, $ciphering,
				$encryption_key, $options, $encryption_iv);
	  
	// Display the encrypted string
	return $encryption ;
  
  
 }
 
 function decrypt($value){
	 
	 $ciphering = "AES-128-CTR";
	  
	// Use OpenSSl Encryption method
	$iv_length = openssl_cipher_iv_length($ciphering);
	$options = 0;
	
	
	// Non-NULL Initialization Vector for decryption
	$decryption_iv = '1234567891011121';
	  
	// Store the decryption key
	$decryption_key = "1213212312312312312323";
	  
	// Use openssl_decrypt() function to decrypt the data
	$decryption=openssl_decrypt ($value, $ciphering, 
			$decryption_key, $options, $decryption_iv);
	  
	// Display the decrypted string
	return $decryption;
 }
 
 
 
 
 function encrypt_s($original){
	$secure = rand(100,999).base64_encode($original);
	return $secure;
}


function decrypt_s($secure){
	$unsecure = substr($secure,3);
	$unsecure = base64_decode($unsecure);
	//echo $unsecure; // will display 123
	return	$unsecure;
}



?>