Home
last modified time | relevance | path

Searched refs:iv (Results 1 – 25 of 45) sorted by relevance

12

/PHP-7.0/ext/openssl/tests/
H A Dopenssl_decrypt_basic.phpt12 $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 Dopenssl_decrypt_error.phpt11 $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…
H A Dbug70438.phpt20 openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key), 'sparkles', $iv);
21 openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key), $cipher, $iv);
22 openssl_open($sealed, $decrypted, $ekeys[0], $priv_key, $cipher, $iv);
/PHP-7.0/ext/mcrypt/tests/
H A Dmcrypt_ecb_3des_encrypt.phpt14 * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
36 $iv = b'12345678';
40 var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_ECB, $iv)));
44 echo "\n--- testing different iv lengths\n";
45 foreach ($ivs as $iv) {
46 echo "\niv length=".strlen($iv)."\n";
47 var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_ECB, $iv)));
72 --- testing different iv lengths
74 iv length=4
77 iv length=8
[all …]
H A Dmcrypt_rijndael128_128BitKey.phpt50 $iv = b'1234567890123456';
59 echo "\n--- testing different iv lengths\n";
60 foreach ($ivs as $iv) {
61 echo "\niv length=".strlen($iv)."\n";
62 $res = mcrypt_decrypt($cipher, $key, $res, MCRYPT_MODE_CBC, $iv);
91 --- testing different iv lengths
93 iv length=0
98 iv length=0
103 iv length=8
108 iv length=16
[all …]
H A Dmcrypt_encrypt_3des_cbc.phpt22 //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 Dmcrypt_cbc_3des_encrypt.phpt12 * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv
33 $iv = b'12345678';
37 var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv)));
41 echo "\n--- testing different iv lengths\n";
42 foreach ($ivs as $iv) {
43 echo "\niv length=".strlen($iv)."\n";
44 var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv)));
69 --- testing different iv lengths
71 iv length=4
76 iv length=8
[all …]
H A Dmcrypt_encrypt_3des_ecb.phpt11 … 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 Dbug72535.phpt10 $iv = substr(md5('iv' . $passphrase, true), 0, 8);
13 $opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
H A Dmcrypt_ecb_3des_decrypt.phpt13 /* 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
47 $iv = b'12345678';
51 …cial_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), MCRYPT_MODE_ECB, $iv));
55 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 Dmcrypt_rijndael128_256BitKey.phpt11 … 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 Dmcrypt_cbc_3des_decrypt.phpt11 /* 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
46 $iv = b'12345678';
50 …cial_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), MCRYPT_MODE_CBC, $iv));
54 echo "\n--- testing different iv lengths\n";
86 --- testing different iv lengths
88 iv length=4
93 iv length=8
96 iv length=9
H A Dmcrypt_decrypt_3des_cbc.phpt11 … 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 Dbug37595.phpt16 $iv='';
18 $iv .= chr($s);
35 mcrypt_generic_init($td, $key, $iv);
40 mcrypt_generic_init($td, $key, $iv);
H A Dmcrypt_filters.phpt16 $iv = substr(md5('iv'.$passphrase, true), 0, 8);
19 $opts = array('iv'=>$iv, 'key'=>$key);
H A Dmcrypt_decrypt_3des_ecb.phpt11 … 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 Dmcrypt_decrypt.phpt12 $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 Dmcrypt_ecb.phpt11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);
12 $enc_data = mcrypt_encrypt($cipher, $key, $secret, MCRYPT_MODE_ECB, $iv);
15 echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_ECB, $iv)) . "\n";
H A Dmcrypt_ofb.phpt11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_OFB), MCRYPT_RAND);
12 $enc_data = mcrypt_decrypt($cipher, $key, $secret, MCRYPT_MODE_OFB, $iv);
15 echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_OFB, $iv)) . "\n";
H A Dmcrypt_cbc.phpt11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CBC), MCRYPT_RAND);
12 $enc_data = mcrypt_encrypt($cipher, $key, $secret, MCRYPT_MODE_CBC, $iv);
15 echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CBC, $iv)) . "\n";
H A Dmcrypt_cfb.phpt11 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CFB), MCRYPT_RAND);
12 $enc_data = mcrypt_encrypt($cipher, $key, $secret, MCRYPT_MODE_CFB, $iv);
15 echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CFB, $iv)) . "\n";
H A Dmcrypt_decrypt_error.phpt11 … 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 Dmcrypt_encrypt_error.phpt11 … 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) );
/PHP-7.0/ext/mcrypt/
H A Dmcrypt.c64 ZEND_ARG_INFO(0, iv)
192 ZEND_ARG_INFO(0, iv)
200 ZEND_ARG_INFO(0, iv)
537 char *key, *iv; in PHP_FUNCTION() local
1244 if (!iv) { in php_mcrypt_ensure_valid_iv()
1362 char *iv; in PHP_FUNCTION() local
1383 efree(iv); in PHP_FUNCTION()
1395 efree(iv); in PHP_FUNCTION()
1411 efree(iv); in PHP_FUNCTION()
1422 RETVAL_STRINGL(iv, n); in PHP_FUNCTION()
[all …]
H A Dmcrypt_filter.c158 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_P(tmpzval), iv_len); in php_mcrypt_filter_create()
232 memcpy(iv, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval)); in php_mcrypt_filter_create()
233 memset(iv + Z_STRLEN_P(tmpzval), 0, iv_len - Z_STRLEN_P(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()

Completed in 38 milliseconds

12