You are here

private function PHPExcel_Reader_Excel5::_makeKey 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::_makeKey()

* Make an RC4 decryptor for the given block * * * @var string $valContext MD5 context state * *

Return value

PHPExcel_Reader_Excel5_RC4

2 calls to PHPExcel_Reader_Excel5::_makeKey()
PHPExcel_Reader_Excel5::_readRecordData in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Read record data from stream, decrypting as required * *
PHPExcel_Reader_Excel5::_verifyPassword in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Verify RC4 file password * * * @var string $docid Document id * @var string $salt_data Salt data * @var string $hashedsalt_data Hashed salt data * @var string &$valContext Set to the MD5 context of the value * *

File

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

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _makeKey($block, $valContext) {
  $pwarray = str_repeat("\0", 64);
  for ($i = 0; $i < 5; $i++) {
    $pwarray[$i] = $valContext[$i];
  }
  $pwarray[5] = chr($block & 0xff);
  $pwarray[6] = chr($block >> 8 & 0xff);
  $pwarray[7] = chr($block >> 16 & 0xff);
  $pwarray[8] = chr($block >> 24 & 0xff);
  $pwarray[9] = "";
  $pwarray[56] = "H";
  $md5 = new PHPExcel_Reader_Excel5_MD5();
  $md5
    ->add($pwarray);
  $s = $md5
    ->getContext();
  return new PHPExcel_Reader_Excel5_RC4($s);
}