Home
last modified time | relevance | path

Searched refs:salt (Results 1 – 25 of 39) sorted by relevance

12

/PHP-8.1/ext/standard/
H A Dcrypt.c87 if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) { in php_crypt()
97 if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') { in php_crypt()
105 } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { in php_crypt()
120 } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { in php_crypt()
136 salt[0] == '$' && in php_crypt()
137 salt[1] == '2' && in php_crypt()
138 salt[2] != 0 && in php_crypt()
160 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
190 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
213 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION()
[all …]
H A Dconfig.m4137 char salt[15], answer[40];
140 salt[0]='$'; salt[1]='1'; salt[2]='$';
141 salt[3]='r'; salt[4]='a'; salt[5]='s';
142 salt[6]='m'; salt[7]='u'; salt[8]='s';
143 salt[9]='l'; salt[10]='e'; salt[11]='$';
144 salt[12]='\0';
145 strcpy(answer,salt);
180salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]…
182 strcpy(answer,salt);
218 strcpy(answer, salt);
[all …]
H A Dphp_crypt_r.h34 extern char * php_md5_crypt_r(const char *pw, const char *salt, char *out);
35 extern char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
36 extern char * php_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
H A Dcrypt_sha256.c353 salt += sizeof(sha256_salt_prefix) - 1; in php_sha256_crypt_r()
361 salt = endp + 1; in php_sha256_crypt_r()
371 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in php_sha256_crypt_r()
379 if ((uintptr_t)salt % __alignof__(uint32_t) != 0) { in php_sha256_crypt_r()
381 salt = copied_salt = in php_sha256_crypt_r()
395 sha256_process_bytes(salt, salt_len, &ctx); in php_sha256_crypt_r()
406 sha256_process_bytes(salt, salt_len, &alt_ctx); in php_sha256_crypt_r()
457 sha256_process_bytes(salt, salt_len, &alt_ctx); in php_sha256_crypt_r()
591 + (int)strlen(salt) + 1 + 43 + 1); in php_sha256_crypt()
603 return php_sha256_crypt_r(key, salt, buffer, buflen); in php_sha256_crypt()
[all …]
H A Dcrypt_sha512.c386 salt += sizeof(sha512_salt_prefix) - 1; in php_sha512_crypt_r()
395 salt = endp + 1; in php_sha512_crypt_r()
405 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in php_sha512_crypt_r()
414 if ((uintptr_t)salt % __alignof__ (uint64_t) != 0) { in php_sha512_crypt_r()
416salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) - (uintptr_t)tmp % __alignof__(uint64_t), in php_sha512_crypt_r()
429 sha512_process_bytes(salt, salt_len, &ctx); in php_sha512_crypt_r()
440 sha512_process_bytes(salt, salt_len, &alt_ctx); in php_sha512_crypt_r()
492 sha512_process_bytes(salt, salt_len, &alt_ctx); in php_sha512_crypt_r()
629 php_sha512_crypt(const char *key, const char *salt) { in php_sha512_crypt() argument
638 + strlen(salt) + 1 + 86 + 1); in php_sha512_crypt()
[all …]
H A Dcrypt_blowfish.c647 BF_word salt[4]; in BF_crypt() member
680 BF_swap(data.binary.salt, 4); in BF_crypt()
689 L ^= data.binary.salt[i & 2]; in BF_crypt()
690 R ^= data.binary.salt[(i & 2) + 1]; in BF_crypt()
699 L ^= data.binary.salt[(BF_N + 2) & 3]; in BF_crypt()
700 R ^= data.binary.salt[(BF_N + 3) & 3]; in BF_crypt()
705 L ^= data.binary.salt[(BF_N + 4) & 3]; in BF_crypt()
727 tmp1 = data.binary.salt[0]; in BF_crypt()
728 tmp2 = data.binary.salt[1]; in BF_crypt()
729 tmp3 = data.binary.salt[2]; in BF_crypt()
[all …]
H A Dpassword.c183 zend_string *result, *hash, *salt; in php_password_bcrypt_hash() local
205 ZSTR_VAL(salt)[ZSTR_LEN(salt)] = 0; in php_password_bcrypt_hash() local
207 hash = zend_string_alloc(ZSTR_LEN(salt) + hash_format_len, 0); in php_password_bcrypt_hash()
208 sprintf(ZSTR_VAL(hash), "%s%s", hash_format, ZSTR_VAL(salt)); in php_password_bcrypt_hash()
209 ZSTR_VAL(hash)[hash_format_len + ZSTR_LEN(salt)] = 0; in php_password_bcrypt_hash()
211 zend_string_release_ex(salt, 0); in php_password_bcrypt_hash()
308 zend_string *salt, *out, *encoded; in php_password_argon2_hash() local
351 (uint32_t)ZSTR_LEN(salt), in php_password_argon2_hash()
363 ZSTR_VAL(salt), in php_password_argon2_hash()
364 ZSTR_LEN(salt), in php_password_argon2_hash()
[all …]
H A Dcrypt_freesec.c349 setup_salt(uint32_t salt, struct php_crypt_extended_data *data) in setup_salt() argument
354 if (salt == data->old_salt) in setup_salt()
356 data->old_salt = salt; in setup_salt()
362 if (salt & saltbit) in setup_salt()
574 des_cipher(const char *in, char *out, uint32_t salt, int count, in des_cipher() argument
580 setup_salt(salt, data); in des_cipher()
612 uint32_t count, salt, l, r0, r1, keybuf[2]; in _crypt_extended_r() local
646 for (i = 5, salt = 0; i < 9; i++) { in _crypt_extended_r()
650 salt |= value << (i - 5) * 6; in _crypt_extended_r()
684 salt = (ascii_to_bin(setting[1]) << 6) in _crypt_extended_r()
[all …]
H A Dphp_crypt.h22 PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_…
H A Dphp_crypt_r.c101 char * php_md5_crypt_r(const char *pw, const char *salt, char *out) in php_md5_crypt_r() argument
114 sp = salt; in php_md5_crypt_r()
/PHP-8.1/ext/standard/tests/strings/
H A Dbug73058.phpt2 Bug #73058 crypt broken when salt is 'too' long
7 $salt = '$2y$07$usesomesillystringforsalt$';
8 var_dump(crypt($pass, $salt));
10 $salt = '$2y$07$usesomesillystringforsaltzzzzzzzzzzzzz$';
11 var_dump(crypt($pass, $salt));
13 $salt = '$2y$07$usesomesillystringforx';
14 var_dump(crypt($pass, $salt));
H A Dbug50052.phpt5 $salt = '$1$f+uslYF01$';
7 echo $salt . "\n";
8 echo crypt($password,$salt) . "\n";
H A Dcrypt_blowfish_variation1.phpt14 foreach($salts as $i=>$salt) {
15 $crypt = crypt('U*U', $salt);
H A Dcrypt_variation1.phpt2 crypt() function - long salt
/PHP-8.1/ext/standard/tests/password/
H A Dpassword_removed_salt_option.phpt2 Test removed support for explicit salt option
8 var_dump(strlen(password_hash("rasmuslerdorf", PASSWORD_BCRYPT, array("cost" => 7, "salt" => "useso…
10 var_dump(strlen(password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . ch…
15 Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no l…
18 Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no l…
/PHP-8.1/ext/hash/tests/
H A Dhash_pbkdf2_error.phpt6 /* Generate a PBKDF2 hash of the given password and salt
12 $salt = 'salt';
16 var_dump(hash_pbkdf2('foo', $password, $salt, 1));
25 var_dump(hash_pbkdf2('crc32', $password, $salt, 1));
33 var_dump(hash_pbkdf2('md5', $password, $salt, 0));
40 var_dump(hash_pbkdf2('md5', $password, $salt, -1));
48 var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1));
H A Dhash_pbkdf2_basic.phpt8 echo "sha1: " . hash_pbkdf2('sha1', 'password', 'salt', 1, 20)."\n";
9 echo "sha1(no length): " . hash_pbkdf2('sha1', 'password', 'salt', 1)."\n";
10 echo "sha1(raw): " . bin2hex(hash_pbkdf2('sha1', 'password', 'salt', 1, 20, TRUE))."\n";
13 echo "sha256: " . hash_pbkdf2('sha256', 'password', 'salt', 1, 20)."\n";
14 echo "sha256(no length): " . hash_pbkdf2('sha256', 'password', 'salt', 1)."\n";
15 echo "sha256(raw): " . bin2hex(hash_pbkdf2('sha256', 'password', 'salt', 1, 20, TRUE))."\n";
H A Dbug64745.phpt5 $hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0);
6 $rawHash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0, true);
H A Dhash_hkdf_rfc5869.phpt23 echo "Test case 3 (SHA-256 with zero-length salt, info): ",
47 echo "Test case 6 (SHA-1 with zero-length salt, info): ",
55 echo "Test case 7 (SHA-1 with zero-length info, salt not provided): ",
67 Test case 3 (SHA-256 with zero-length salt, info): 8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879e…
70 Test case 6 (SHA-1 with zero-length salt, info): 0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e0…
71 Test case 7 (SHA-1 with zero-length info, salt not provided): 2c91117204d745f3500d636a62f64f0ab3bae…
H A Dmhash_003.phpt24 $salt = str_repeat($hash, 2);
25 $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
/PHP-8.1/ext/openssl/tests/
H A Dopenssl_pbkdf2_basic.phpt10 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1)));
11 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2)));
12 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096)));
16 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216)));
/PHP-8.1/ext/standard/tests/crypt/
H A Dbcrypt_salt_dollar.phpt6 $salt = '$2y$04$' . str_repeat('0', $i) . '$';
7 $result = crypt("foo", $salt);
8 var_dump($salt);
10 var_dump($result === $salt);
/PHP-8.1/ext/sodium/tests/
H A Dpwhash_argon2i.phpt32 $salt = random_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES);
35 ($out_len, $passwd, $salt,
41 ($out_len, $passwd, $salt,
H A Dpwhash_scrypt.phpt24 $salt = random_bytes(SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES);
27 ($out_len, $passwd, $salt,
/PHP-8.1/ext/hash/
H A Dhash.stub.php47 function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0… argument
52 function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""… argument
68 function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {} argument

Completed in 57 milliseconds

12