/PHP-5.6/ext/openssl/tests/ |
H A D | openssl_decrypt_basic.phpt | 12 $iv = ''; 14 while(strlen($iv) < $ivlen) $iv .= chr(rand(0,255)); 16 $encrypted = openssl_encrypt($data, $method, $password, 0, $iv); 17 $output = openssl_decrypt($encrypted, $method, $password, 0, $iv); 19 $encrypted = openssl_encrypt($data, $method, $password, OPENSSL_RAW_DATA, $iv); 20 $output = openssl_decrypt($encrypted, $method, $password, OPENSSL_RAW_DATA, $iv); 24 …ed = openssl_encrypt($padded_data, $method, $password, OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING, $iv); 25 …tput = openssl_decrypt($encrypted, $method, $password, OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING, $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, 0, $iv)); 28 Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and n…
|
/PHP-5.6/ext/mcrypt/tests/ |
H A D | mcrypt_ecb_3des_encrypt.phpt | 14 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 40 $iv = b'12345678'; 44 var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $mode, $iv))); 48 echo "\n--- testing different iv lengths\n"; 49 foreach ($ivs as $iv) { 50 echo "\niv length=".strlen($iv)."\n"; 51 var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $mode, $iv))); 78 --- testing different iv lengths 80 iv length=4 83 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"; 84 --- testing different iv lengths 86 iv length=4 91 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))); 76 --- testing different iv lengths 78 iv length=4 81 iv length=8 84 iv length=9
|
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))); 83 --- testing different iv lengths 85 iv length=4 92 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); 113 --- testing different iv lengths 115 iv length=0 125 iv length=0 135 iv length=8 145 iv length=16 [all …]
|
H A D | mcrypt_ecb_3des_decrypt.phpt | 13 /* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) 14 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 51 $iv = b'12345678'; 55 special_var_dump(mcrypt_ecb($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv)); 59 echo "\n--- testing different iv lengths\n"; 93 --- testing different iv lengths 95 iv length=4 98 iv length=8 101 iv length=9
|
H A D | bug72535.phpt | 10 $iv = substr(md5('iv' . $passphrase, true), 0, 8); 13 $opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
|
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_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"; 91 --- testing different iv lengths 93 iv length=4 98 iv length=8 101 iv length=9
|
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_filters.phpt | 16 $iv = substr(md5('iv'.$passphrase, true), 0, 8); 19 $opts = array('iv'=>$iv, 'key'=>$key);
|
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"; 100 --- testing different iv lengths 102 iv length=4 109 iv length=8 114 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"; 90 --- testing different iv lengths 92 iv length=4 95 iv length=8 98 iv length=9
|
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(mcrypt_decrypt(MCRYPT_BLOWFISH, "FooBar", $enc_data, MCRYPT_MODE_CBC, $iv));
|
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_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) );
|
H A D | mcrypt_ecb_error.phpt | 13 /* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) 14 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv 28 $iv = 'string_val'; 30 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_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";
|
/PHP-5.6/ext/mcrypt/ |
H A D | mcrypt.c | 64 ZEND_ARG_INFO(0, iv) 192 ZEND_ARG_INFO(0, iv) 200 ZEND_ARG_INFO(0, iv) 208 ZEND_ARG_INFO(0, iv) 216 ZEND_ARG_INFO(0, iv) 565 char *key, *iv; in PHP_FUNCTION() local 1253 if (!iv) { in php_mcrypt_ensure_valid_iv() 1433 char *iv; in PHP_FUNCTION() local 1454 efree(iv); in PHP_FUNCTION() 1466 efree(iv); in PHP_FUNCTION() [all …]
|