Esempio n. 1
0
 /**
  * @dataProvider provideTestEncryptVectors
  */
 public function testEncryptThenDecrypt($cipher, $key, $data)
 {
     $cipher = new \CryptLib\Cipher\Block\Cipher\AES($cipher);
     $cipher->setKey(pack('H*', $key));
     $enc = $cipher->encryptBlock(pack('H*', $data));
     $dec = $cipher->decryptBlock($enc);
     $this->assertEquals($data, strtoupper(bin2hex($dec)));
 }