Example #1
0
 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);
     }
 }