_key = $key_config['key']; } else { // No default encryption key is provided! throw new Kohana_Exception('No encryption key is defined in the encryption configuration'); } if (isset($key_config['mode'])) { $this->_mode = $key_config['mode']; } // Mode not specified in config array, use argument else if ($mode !== NULL) { $this->_mode = $mode; } if (isset($key_config['cipher'])) { $this->_cipher = $key_config['cipher']; } // Cipher not specified in config array, use argument else if ($cipher !== NULL) { $this->_cipher = $cipher; } } else if (is_string($key_config)) { // Store the key, mode, and cipher $this->_key = $key_config; $this->_mode = $mode; $this->_cipher = $cipher; } else { // No default encryption key is provided! throw new Kohana_Exception('No encryption key is defined in the encryption configuration'); } } abstract public function encrypt($data, $iv); abstract public function decrypt($data); }