You are here

private function PHPExcel_Reader_Excel5::_readFilepass in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php \PHPExcel_Reader_Excel5::_readFilepass()

* FILEPASS * * This record is part of the File Protection Block. It * contains information about the read/write password of the * file. All record contents following this record will be * encrypted. * * -- "OpenOffice.org's Documentation of the Microsoft * Excel File Format" * * The decryption functions and objects used from here on in * are based on the source of Spreadsheet-ParseExcel: * http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel/

1 call to PHPExcel_Reader_Excel5::_readFilepass()
PHPExcel_Reader_Excel5::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Loads PHPExcel from file * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php, line 1671

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _readFilepass() {
  $length = self::_GetInt2d($this->_data, $this->_pos + 2);
  if ($length != 54) {
    throw new PHPExcel_Reader_Exception('Unexpected file pass record length');
  }
  $recordData = $this
    ->_readRecordData($this->_data, $this->_pos + 4, $length);

  // move stream pointer to next record
  $this->_pos += 4 + $length;
  if (!$this
    ->_verifyPassword('VelvetSweatshop', substr($recordData, 6, 16), substr($recordData, 22, 16), substr($recordData, 38, 16), $this->_md5Ctxt)) {
    throw new PHPExcel_Reader_Exception('Decryption password incorrect');
  }
  $this->_encryption = self::MS_BIFF_CRYPTO_RC4;

  // Decryption required from the record after next onwards
  $this->_encryptionStartPos = $this->_pos + self::_GetInt2d($this->_data, $this->_pos + 2);
}