private function init()
    {
        $this->module = mcrypt_module_open($this->algorithm, '', MCRYPT_MODE_ECB, '');

        // Create the IV and determine the keysize length
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->module), MCRYPT_RAND);
        $ks = mcrypt_enc_get_key_size($this->module);

        /* Create key */
        $key = substr(md5($this->secretKey), 0, $ks);

        /* Intialize */
        mcrypt_generic_init($this->module, $key, $iv);
    }
private function init()
    {
        $this->module = mcrypt_module_open($this->algorithm, '', MCRYPT_MODE_ECB, '');

        // Create the IV and determine the keysize length
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->module), MCRYPT_RAND);
        $ks = mcrypt_enc_get_key_size($this->module);

        /* Create key */
        $key = substr(md5($this->secretKey), 0, $ks);

        /* Intialize */
        mcrypt_generic_init($this->module, $key, $iv);
    }
private function init ( ) { $ this -> module = mcrypt_module_open ( $ this -> algorithm , '' , MCRYPT_MODE_ECB , '' ) ; // Create the IV and determine the keysize length $ iv = mcrypt_create_iv ( mcrypt_enc_get_iv_size ( $ this -> module ) , MCRYPT_RAND ) ; $ ks = mcrypt_enc_get_key_size ( $ this -> module ) ; /* Create key */ $ key = substr ( md5 ( $ this -> secretKey ) , 0 , $ ks ) ; /* Intialize */ mcrypt_generic_init ( $ this -> module , $ key , $ iv ) ; }
init encryption module
init encryption module