/** * @dataProvider provideTestEncryptVectors * @group Vectors */ public function testDecrypt($key, $expected, $data) { $cipher = new \CryptLib\Cipher\Block\Cipher\TripleDES('tripledes'); $cipher->setKey(pack('H*', $key)); $enc = $cipher->decryptBlock(pack('H*', $data)); $this->assertEquals($expected, strtoupper(bin2hex($enc))); }
/** * @expectedException InvalidArgumentException */ public function testDecryptFailure() { $cipher = new \CryptLib\Cipher\Block\Cipher\TripleDES('tripledes'); $cipher->setKey(str_repeat(chr(0), 8)); }