public function testDecryptAuthFail() { $this->blockCipher->setKey('test'); $this->blockCipher->setKeyIteration(1000); $encrypted = $this->blockCipher->encrypt($this->plaintext); $this->assertTrue(!empty($encrypted)); // tamper the encrypted data $encrypted = substr($encrypted, -1); $decrypted = $this->blockCipher->decrypt($encrypted); $this->assertTrue($decrypted === false); }
/** * @param integer $keyIteration */ public function setKeyIteration($keyIteration) { $this->blockCipher->setKeyIteration($keyIteration); }