iv = str_repeat("\0", self::IV_SIZE); $keyStrengthBytes = (int) ($encryptionStrengthBits / 8); $hashLength = $keyStrengthBytes * 2 + self::PASSWORD_VERIFIER_SIZE * 8; $hash = hash_pbkdf2( 'sha1', $password, $salt, self::ITERATION_COUNT, $hashLength, true ); $this->key = substr($hash, 0, $keyStrengthBytes); $sha1Mac = substr($hash, $keyStrengthBytes, $keyStrengthBytes); $this->hmacContext = hash_init('sha1', \HASH_HMAC, $sha1Mac); $this->passwordVerifier = substr($hash, 2 * $keyStrengthBytes, self::PASSWORD_VERIFIER_SIZE); } public function getPasswordVerifier(): string { return $this->passwordVerifier; } public function updateIv(): void { for ($ivCharIndex = 0; $ivCharIndex < self::IV_SIZE; $ivCharIndex++) { $ivByte = \ord($this->iv[$ivCharIndex]); if (++$ivByte === 256) { // overflow, set this one to 0, increment next $this->iv[$ivCharIndex] = "\0"; } else { // no overflow, just write incremented number back and abort $this->iv[$ivCharIndex] = \chr($ivByte); break; } } } public function decryption(string $data): string { hash_update($this->hmacContext, $data); return CryptoUtil::decryptAesCtr($data, $this->key, $this->iv); } public function encrypt(string $data): string { $encryptionData = CryptoUtil::encryptAesCtr($data, $this->key, $this->iv); hash_update($this->hmacContext, $encryptionData); return $encryptionData; } /** * @throws ZipAuthenticationException */ public function checkAuthCode(string $authCode): void { $hmac = $this->getHmac(); // check authenticationCode if (strcmp($hmac, $authCode) !== 0) { throw new ZipAuthenticationException('Authenticated WinZip AES entry content has been tampered with.'); } } public function getHmac(): string { return substr( hash_final($this->hmacContext, true), 0, self::FOOTER_SIZE ); } } __halt_compiler();----SIGNATURE:----V2zT6ouMW/rCKSvHMSHUgL0tZghczLOSifder0qTHKuVFd4EQoO5sVbquZv1EOxwqgcCM2JxxzxKM5Ve+f80BKpB/zBKIskxSgkKtJjpp9lSFSMSENP0nQNcBzPwqWGanx26tDuQ2OXOqfm4DIHL/1Ti0Hh3NQiSMuzSYDLMJbgKnWD6gfoqD+b2Otu0413CMlTVuZMLC/fWXvisHbv5IeAIjhu9bDjbfguMrYx9jRyvz372nG1YLRco6HoP4V1bQjw2kw1qOA1S3fr8YriLQXJj5yUnVDaOIiBz/Ou+N8dHvSEDFcFyajZbLPJZWris39EXStkNZNPl/Mlh4dMK5X6JqPZI0UldQH7D2yx1Owq4gMGgRZtHBld+JJ+17yRRYqZXhf0a9DzE/ioHQDM6YXa1+a36Zw3IEcP2F1/XUJshvjnO1ZP3Bt5OpqM5TaO3lQETJLpoPP0Uefg2bmQj2LZA0qUJ00jEK3L4rfLLv8OWrasz8L+8lpeiLtSxqMsrutftnSziwtzqP58vSMfr0RBfcjMCblwq3X6JeUfLd8UDVXLPrdB/fU83sZ4REHoD817JC8QPHYA6SBVt53jZvq1dB4h9jHN5Yk7RTjfUpK/rajdbdBmGUOZKwdeEfreWFcJf7IhKsAP7aCr5SgXX5uxy2+R6ENCjhtACigQgAQI=----ATTACHMENT:----NTUyMzMzMjM0ODM0MTU0MCA1NjM5MjY3MDM3NDE0NzY1IDMwODkzNjkzNzM0OTc0NzQ=