/** * Encrypt a block of data using the supplied string key * * Note that the supplied data should be the same size as the block size of * the cipher being used. * * @param string $data The data to encrypt * * @return string The result encrypted data */ protected function encryptBlockData($data) { $key = $this->key; $this->key = substr($key, 0, 8); $this->initialize(); $data = parent::encryptBlockData($data); $this->key = substr($key, 8, 8); $this->initialize(); $data = parent::decryptBlockData($data); $this->key = substr($key, 16, 8); $this->initialize(); $data = parent::encryptBlockData($data); $this->key = $key; return $data; }