patch #2242765 [core] Navi panel server links wrong
[phpmyadmin/crack.git] / test / PMA_blowfish_test.php
blob9d7657b031d74d08d013d97c9457324969eea630
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Test for blowfish encryption.
6 * @package phpMyAdmin-test
7 * @version $Id$
8 */
10 /**
11 * Tests core.
13 require_once 'PHPUnit/Framework.php';
15 /**
16 * Include to test.
18 require_once './libraries/blowfish.php';
20 /**
21 * Test java script escaping.
24 class PMA_blowfish_test extends PHPUnit_Framework_TestCase
26 public function testEncryptDecryptNumbers()
28 $secret = '$%ÄüfuDFRR';
29 $string = '12345678';
30 $this->assertEquals($string,
31 PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret));
34 public function testEncryptDecryptChars()
36 $secret = '$%ÄüfuDFRR';
37 $string = 'abcDEF012!"§$%&/()=?`´"\',.;:-_#+*~öäüÖÄÜ^°²³';
38 $this->assertEquals($string,
39 PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret));
42 public function testEncrypt()
44 $secret = '$%ÄüfuDFRR';
45 $decrypted = '12345678';
46 $encrypted = 'p0nz15awFT4=';
47 $this->assertEquals($encrypted, PMA_blowfish_encrypt($decrypted, $secret));
50 public function testDecrypt()
52 $secret = '$%ÄüfuDFRR';
53 $encrypted = 'p0nz15awFT4=';
54 $decrypted = '12345678';
55 $this->assertEquals($decrypted, PMA_blowfish_decrypt($encrypted, $secret));