예제 #1
0
파일: crypt.php 프로젝트: poef/ariadne
 public function testNewApiSetKey()
 {
     $text = "testme";
     $key = "frop";
     $salt = sha1("saltgeneration");
     $crypt = new ar_crypt($key, MCRYPT_RIJNDAEL_256, 1);
     $generatedkey = $crypt->pbkdf2($key, $salt);
     $crypt->setKey($generatedkey);
     $encoded = $crypt->crypt($text);
     $decoded = $crypt->decrypt($encoded);
     $this->assertEquals($text, $decoded);
 }