Home
last modified time | relevance | path

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

12

/php-src/ext/standard/
H A Dcrypt.c75 if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) { in php_crypt()
85 if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') { in php_crypt()
93 } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { in php_crypt()
108 } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { in php_crypt()
124 salt[0] == '$' && in php_crypt()
125 salt[1] == '2' && in php_crypt()
126 salt[2] != 0 && in php_crypt()
148 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
178 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
201 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION()
[all …]
H A Dconfig.m4140 char salt[15], answer[40];
143 salt[0]='$'; salt[1]='1'; salt[2]='$';
144 salt[3]='r'; salt[4]='a'; salt[5]='s';
145 salt[6]='m'; salt[7]='u'; salt[8]='s';
146 salt[9]='l'; salt[10]='e'; salt[11]='$';
147 salt[12]='\0';
148 strcpy(answer,salt);
181salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]…
183 strcpy(answer,salt);
217 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.c347 salt += sizeof(sha256_salt_prefix) - 1; in php_sha256_crypt_r()
355 salt = endp + 1; in php_sha256_crypt_r()
365 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in php_sha256_crypt_r()
380 if ((uintptr_t)salt % __alignof__(uint32_t) != 0) { in php_sha256_crypt_r()
382 salt = copied_salt = in php_sha256_crypt_r()
396 sha256_process_bytes(salt, salt_len, &ctx); in php_sha256_crypt_r()
407 sha256_process_bytes(salt, salt_len, &alt_ctx); in php_sha256_crypt_r()
459 sha256_process_bytes(salt, salt_len, &alt_ctx); in php_sha256_crypt_r()
602 + (int)strlen(salt) + 1 + 43 + 1); in php_sha256_crypt()
614 return php_sha256_crypt_r(key, salt, buffer, buflen); in php_sha256_crypt()
[all …]
H A Dcrypt_sha512.c384 salt += sizeof(sha512_salt_prefix) - 1; in php_sha512_crypt_r()
393 salt = endp + 1; in php_sha512_crypt_r()
403 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in php_sha512_crypt_r()
419 if ((uintptr_t)salt % __alignof__ (uint64_t) != 0) { in php_sha512_crypt_r()
421salt = copied_salt = memcpy(tmp_salt + __alignof__(uint64_t) - (uintptr_t)tmp_salt % __alignof__(u… in php_sha512_crypt_r()
434 sha512_process_bytes(salt, salt_len, &ctx); in php_sha512_crypt_r()
445 sha512_process_bytes(salt, salt_len, &alt_ctx); in php_sha512_crypt_r()
498 sha512_process_bytes(salt, salt_len, &alt_ctx); in php_sha512_crypt_r()
644 php_sha512_crypt(const char *key, const char *salt) { in php_sha512_crypt() argument
653 + 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.c180 zend_string *result, *hash, *salt; in php_password_bcrypt_hash() local
202 ZSTR_VAL(salt)[ZSTR_LEN(salt)] = 0; in php_password_bcrypt_hash() local
204 hash = zend_string_alloc(ZSTR_LEN(salt) + hash_format_len, 0); in php_password_bcrypt_hash()
205 sprintf(ZSTR_VAL(hash), "%s%s", hash_format, ZSTR_VAL(salt)); in php_password_bcrypt_hash()
206 ZSTR_VAL(hash)[hash_format_len + ZSTR_LEN(salt)] = 0; in php_password_bcrypt_hash()
208 zend_string_release_ex(salt, 0); in php_password_bcrypt_hash()
305 zend_string *salt, *out, *encoded; in php_password_argon2_hash() local
348 (uint32_t)ZSTR_LEN(salt), in php_password_argon2_hash()
360 ZSTR_VAL(salt), in php_password_argon2_hash()
361 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-src/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-src/ext/standard/tests/password/
H A Dpassword_removed_salt_option.phpt2 Test removed support for explicit salt option
10 var_dump(strlen(password_hash("rasmuslerdorf", PASSWORD_BCRYPT, array("cost" => 7, "salt" => "useso…
12 var_dump(strlen(password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . ch…
17 Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no l…
20 Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no l…
/php-src/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-src/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-src/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-src/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-src/ext/hash/
H A Dhash_arginfo.h73 ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
90 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 0, "\"\"")
109 ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)

Completed in 57 milliseconds

12