コード例 #1
0
ファイル: BlockCipherTest.php プロジェクト: pnaq57/zf2demo
 /**
  * @dataProvider zeroValuesProvider
  */
 public function testEncryptDecryptUsingZero($value)
 {
     $this->blockCipher->setKey('test');
     $this->blockCipher->setKeyIteration(1000);
     foreach ($this->blockCipher->getCipherSupportedAlgorithms() as $algo) {
         $this->blockCipher->setCipherAlgorithm($algo);
         $encrypted = $this->blockCipher->encrypt($value);
         $this->assertTrue(!empty($encrypted));
         $decrypted = $this->blockCipher->decrypt($encrypted);
         $this->assertEquals($value, $decrypted);
     }
 }
コード例 #2
0
ファイル: BlockCipherTest.php プロジェクト: necrogami/zf2
 public function testEncryptDecryptUsingBinary()
 {
     $this->blockCipher->setKey('test');
     $this->blockCipher->setKeyIteration(1000);
     $this->blockCipher->setBinaryOutput(true);
     foreach ($this->blockCipher->getCipherSupportedAlgorithms() as $algo) {
         $this->blockCipher->setCipherAlgorithm($algo);
         $encrypted = $this->blockCipher->encrypt($this->plaintext);
         $this->assertTrue(!empty($encrypted));
         $decrypted = $this->blockCipher->decrypt($encrypted);
         $this->assertEquals($decrypted, $this->plaintext);
     }
 }