You are here

public function LockrAesCbcKeyWrapperTest::testReencryptsData in Lockr 7.3

@requires function mcrypt_encrypt

File

vendor/lockr/lockr/tests/KeyWrapper/LockrAesCbcKeyWrapperTest.php, line 24

Class

LockrAesCbcKeyWrapperTest

Namespace

Lockr\Tests\KeyWrapper

Code

public function testReencryptsData() {
  $data = KeyWrapper::encrypt('aaaa');
  $wk = $data['encoded'];
  $text = 'abcd';
  $data = KeyWrapper::reencrypt($text, $wk);
  $plaintext = KeyWrapper::decrypt($data['ciphertext'], $wk);
  $this
    ->assertSame($text, $plaintext);
}