public static function _encryptRijndael256 ($str, $key, $iv = FALSE)
	{
		
		// If the string is empty
		
		if (empty ($str))
		{
			return '';
		}
		
		// Open the cypher
		
		$cypher		= mcrypt_module_open ('rijndael-256', '', 'ofb', '');
		
		// Create the IV if there is none
		
		if ($iv === FALSE)
		{
			$iv		= self::_genRijndael256IV ($cypher);
		}
		
		// Set Key
		
		$key		= substr ($key, 0, mcrypt_enc_get_key_size ($cypher));
		
		// Initialise encryption
		
		mcrypt_generic_init ($cypher, $key, $iv);
		
		// Encrypt String
		
		$encrypted	= mcrypt_generic ($cypher, $strString);
		
		// Terminate encryption hander
		
		mcrypt_generic_deinit ($cypher);
		
		// Close Module
		
		mcrypt_module_close ($cypher);
		
		// Return encrypted string
		
		return $encrypted;
		
	}
public static function _encryptRijndael256 ($str, $key, $iv = FALSE)
	{
		
		// If the string is empty
		
		if (empty ($str))
		{
			return '';
		}
		
		// Open the cypher
		
		$cypher		= mcrypt_module_open ('rijndael-256', '', 'ofb', '');
		
		// Create the IV if there is none
		
		if ($iv === FALSE)
		{
			$iv		= self::_genRijndael256IV ($cypher);
		}
		
		// Set Key
		
		$key		= substr ($key, 0, mcrypt_enc_get_key_size ($cypher));
		
		// Initialise encryption
		
		mcrypt_generic_init ($cypher, $key, $iv);
		
		// Encrypt String
		
		$encrypted	= mcrypt_generic ($cypher, $strString);
		
		// Terminate encryption hander
		
		mcrypt_generic_deinit ($cypher);
		
		// Close Module
		
		mcrypt_module_close ($cypher);
		
		// Return encrypted string
		
		return $encrypted;
		
	}
public static function _encryptRijndael256 ( $ str , $ key , $ iv = FALSE ) { // If the string is empty if ( empty ( $ str ) ) { return '' ; } // Open the cypher $ cypher = mcrypt_module_open ( 'rijndael-256' , '' , 'ofb' , '' ) ; // Create the IV if there is none if ( $ iv === FALSE ) { $ iv = self :: _genRijndael256IV ( $ cypher ) ; } // Set Key $ key = substr ( $ key , 0 , mcrypt_enc_get_key_size ( $ cypher ) ) ; // Initialise encryption mcrypt_generic_init ( $ cypher , $ key , $ iv ) ; // Encrypt String $ encrypted = mcrypt_generic ( $ cypher , $ strString ) ; // Terminate encryption hander mcrypt_generic_deinit ( $ cypher ) ; // Close Module mcrypt_module_close ( $ cypher ) ; // Return encrypted string return $ encrypted ; }
Encrypt and return a string using the Rijndael 256 cypher
@param string $str String to encrypt
@param string $key Key to encrypt the string
@param string $iv Initialisation vector
@return string
Encrypt and return a string using the Rijndael 256 cypher