/PHP-5.3/ext/mcrypt/tests/ |
H A D | mcrypt_ecb_3des_encrypt.phpt | 12 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 38 $iv = b'12345678'; 42 var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $mode, $iv))); 46 echo "\n--- testing different iv lengths\n"; 47 foreach ($ivs as $iv) { 48 echo "\niv length=".strlen($iv)."\n"; 49 var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $mode, $iv))); 72 --- testing different iv lengths 74 iv length=4 77 iv length=8 [all …]
|
H A D | mcrypt_encrypt_3des_cbc.phpt | 22 //test different lengths of key, iv 23 //test no iv being passed on CBC, ECB 45 $iv = b'12345678'; 49 var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode, $iv))); 53 echo "\n--- testing different iv lengths\n"; 54 foreach ($ivs as $iv) { 55 echo "\niv length=".strlen($iv)."\n"; 80 --- testing different iv lengths 82 iv length=4 87 iv length=8 [all …]
|
H A D | mcrypt_rijndael128_128BitKey.phpt | 50 $iv = b'1234567890123456'; 61 echo "\n--- testing different iv lengths\n"; 62 foreach ($ivs as $iv) { 63 echo "\niv length=".strlen($iv)."\n"; 64 $res = mcrypt_cbc($cipher, $key, $data, $mode, $iv); 93 --- testing different iv lengths 95 iv length=0 103 iv length=0 111 iv length=8 119 iv length=16 [all …]
|
H A D | mcrypt_cbc_3des_encrypt.phpt | 12 * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv 37 $iv = b'12345678'; 41 var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $iv))); 45 echo "\n--- testing different iv lengths\n"; 46 foreach ($ivs as $iv) { 47 echo "\niv length=".strlen($iv)."\n"; 48 var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $iv))); 71 --- testing different iv lengths 73 iv length=4 78 iv length=8 [all …]
|
H A D | mcrypt_encrypt_3des_ecb.phpt | 11 … Prototype : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv) 12 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 45 echo "\n--- testing different iv lengths\n"; 46 foreach ($ivs as $iv) { 47 echo "\niv length=".strlen($iv)."\n"; 48 var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode, $iv))); 72 --- testing different iv lengths 74 iv length=4 77 iv length=8 80 iv length=9
|
H A D | mcrypt_rijndael128_256BitKey.phpt | 11 … Prototype : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv) 12 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 16 … Prototype : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv) 17 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 21 /* Prototype : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv) 22 * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv 26 /* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) 27 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 47 $iv = b'1234567890123456'; 52 $res = mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv); [all …]
|
H A D | mcrypt_ecb_3des_decrypt.phpt | 11 /* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) 12 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 49 $iv = b'12345678'; 53 special_var_dump(mcrypt_ecb($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv)); 57 echo "\n--- testing different iv lengths\n"; 87 --- testing different iv lengths 89 iv length=4 92 iv length=8 95 iv length=9
|
H A D | mcrypt_decrypt_3des_cbc.phpt | 11 … Prototype : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv) 12 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 49 $iv = b'12345678'; 53 special_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv)); 57 echo "\n--- testing different iv lengths\n"; 87 --- testing different iv lengths 89 iv length=4 94 iv length=8 97 iv length=9
|
H A D | mcrypt_cbc_3des_decrypt.phpt | 11 /* Prototype : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv) 12 * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv 50 $iv = b'12345678'; 54 special_var_dump(mcrypt_cbc($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv)); 58 echo "\n--- testing different iv lengths\n"; 88 --- testing different iv lengths 90 iv length=4 95 iv length=8 98 iv length=9
|
H A D | mcrypt_ofb.phpt | 11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); 12 $enc_data = mcrypt_ofb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); 15 echo trim(mcrypt_ofb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n"; 18 mcrypt_ofb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv);
|
H A D | mcrypt_decrypt_3des_ecb.phpt | 11 … Prototype : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv) 12 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 56 echo "\n--- testing different iv lengths\n"; 86 --- testing different iv lengths 88 iv length=4 91 iv length=8 94 iv length=9
|
H A D | mcrypt_filters.phpt | 16 $iv = substr(md5('iv'.$passphrase, true), 0, 8); 19 $opts = array('iv'=>$iv, 'key'=>$key);
|
H A D | bug37595.phpt | 16 $iv=''; 18 $iv .= chr($s); 35 mcrypt_generic_init($td, $key, $iv); 40 mcrypt_generic_init($td, $key, $iv);
|
H A D | mcrypt_decrypt.phpt | 12 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, $mode), MCRYPT_RAND); 13 $enc_data = mcrypt_encrypt($cipher, $key, $secret, $mode, $iv); 16 echo trim(mcrypt_decrypt($cipher, $key, $enc_data, $mode, $iv)) . "\n"; 21 var_dump(strpos(mcrypt_decrypt(MCRYPT_BLOWFISH, "FooBar", $enc_data, MCRYPT_MODE_CBC, $iv), "Testfe…
|
H A D | mcrypt_ecb.phpt | 11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); 12 $enc_data = mcrypt_ecb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); 15 echo trim(mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n";
|
H A D | mcrypt_cbc.phpt | 11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); 12 $enc_data = mcrypt_cbc($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); 15 echo trim(mcrypt_cbc($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n";
|
H A D | mcrypt_cfb.phpt | 11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CFB), MCRYPT_RAND); 12 $enc_data = mcrypt_cfb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); 15 echo trim(mcrypt_cfb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n";
|
H A D | mcrypt_ecb_error.phpt | 11 /* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) 12 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 26 $iv = 'string_val'; 28 var_dump( mcrypt_ecb($cipher, $key, $data, $mode, $iv, $extra_arg) );
|
H A D | mcrypt_encrypt_error.phpt | 11 … Prototype : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv) 12 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 26 $iv = 'string_val'; 28 var_dump( mcrypt_encrypt($cipher, $key, $data, $mode, $iv, $extra_arg) );
|
H A D | mcrypt_cbc_error.phpt | 11 /* Prototype : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv) 12 * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv 26 $iv = 'string_val'; 28 var_dump( mcrypt_cbc($cipher, $key, $data, $mode, $iv, $extra_arg) );
|
H A D | mcrypt_decrypt_error.phpt | 11 … Prototype : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv) 12 * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv 26 $iv = 'string_val'; 28 var_dump( mcrypt_decrypt($cipher, $key, $data, $mode, $iv, $extra_arg) );
|
/PHP-5.3/ext/openssl/tests/ |
H A D | 011.phpt | 12 $iv = ''; 14 while(strlen($iv) < $ivlen) $iv .= chr(rand(0,255)); 16 $encrypted = openssl_encrypt($data, $method, $password, false, $iv); 17 $output = openssl_decrypt($encrypted, $method, $password, false, $iv); 19 $encrypted = openssl_encrypt($data, $method, $password, true, $iv); 20 $output = openssl_decrypt($encrypted, $method, $password, true, $iv);
|
H A D | openssl_decrypt_error.phpt | 11 $iv = str_repeat("\0", openssl_cipher_iv_length($method)); 14 var_dump($encrypted); /* Not passing $iv should be the same as all-NULL iv, but with a warning */ 15 var_dump(openssl_encrypt($data, $method, $password, false, $iv)); 28 Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and n…
|
/PHP-5.3/ext/mcrypt/ |
H A D | mcrypt.c | 63 ZEND_ARG_INFO(0, iv) 191 ZEND_ARG_INFO(0, iv) 199 ZEND_ARG_INFO(0, iv) 207 ZEND_ARG_INFO(0, iv) 215 ZEND_ARG_INFO(0, iv) 322 zval **iv 585 char *key, *iv; in PHP_FUNCTION() local 1375 char *iv; in PHP_FUNCTION() local 1396 efree(iv); in PHP_FUNCTION() 1407 efree(iv); in PHP_FUNCTION() [all …]
|
H A D | mcrypt_filter.c | 158 char *iv = NULL, *key = NULL; in php_mcrypt_filter_create() local 228 iv = emalloc(iv_len + 1); in php_mcrypt_filter_create() 230 memcpy(iv, Z_STRVAL_PP(tmpzval), iv_len); in php_mcrypt_filter_create() 232 memcpy(iv, Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval)); in php_mcrypt_filter_create() 233 memset(iv + Z_STRLEN_PP(tmpzval), 0, iv_len - Z_STRLEN_PP(tmpzval)); in php_mcrypt_filter_create() 236 result = mcrypt_generic_init(mcrypt_module, key, key_len, iv); in php_mcrypt_filter_create() 237 efree(iv); in php_mcrypt_filter_create()
|