/php-src/ext/standard/ |
H A D | crypt.c | 75 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() 213 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION() [all …]
|
H A D | config.m4 | 166 salt[0]='$'; salt[1]='1'; salt[2]='$'; 167 salt[3]='r'; salt[4]='a'; salt[5]='s'; 168 salt[6]='m'; salt[7]='u'; salt[8]='s'; 169 salt[9]='l'; salt[10]='e'; salt[11]='$'; 170 salt[12]='\0'; 171 strcpy(answer,salt); 197 salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; 198 salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0'; 200 strcpy(answer,salt); 227 strcpy(answer, salt); [all …]
|
H A D | php_crypt_r.h | 34 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 D | crypt_sha256.c | 347 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 D | crypt_sha512.c | 384 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() 421 …salt = 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 D | crypt_blowfish.c | 647 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 D | password.c | 180 zend_string *result, *hash, *salt; in php_password_bcrypt_hash() local 199 if (!(salt = php_password_get_salt(NULL, Z_UL(22), options))) { in php_password_bcrypt_hash() 202 ZSTR_VAL(salt)[ZSTR_LEN(salt)] = 0; in php_password_bcrypt_hash() local 204 hash = zend_string_concat2(hash_format, hash_format_len, ZSTR_VAL(salt), ZSTR_LEN(salt)); in php_password_bcrypt_hash() 206 zend_string_release_ex(salt, 0); in php_password_bcrypt_hash() 303 zend_string *salt, *out, *encoded; in php_password_argon2_hash() local 337 if (!(salt = php_password_get_salt(NULL, Z_UL(16), options))) { in php_password_argon2_hash() 346 (uint32_t)ZSTR_LEN(salt), in php_password_argon2_hash() 358 ZSTR_VAL(salt), in php_password_argon2_hash() 359 ZSTR_LEN(salt), in php_password_argon2_hash() [all …]
|
H A D | crypt_freesec.c | 349 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 D | php_crypt.h | 22 PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_…
|
H A D | php_crypt_r.c | 101 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 D | bug73058.phpt | 2 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 D | bug50052.phpt | 5 $salt = '$1$f+uslYF01$'; 7 echo $salt . "\n"; 8 echo crypt($password,$salt) . "\n";
|
H A D | crypt_blowfish_variation1.phpt | 14 foreach($salts as $i=>$salt) { 15 $crypt = crypt('U*U', $salt);
|
H A D | crypt_variation1.phpt | 2 crypt() function - long salt
|
/php-src/ext/standard/tests/password/ |
H A D | password_removed_salt_option.phpt | 2 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 D | hash_pbkdf2_error.phpt | 6 /* 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 D | hash_pbkdf2_basic.phpt | 8 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 D | bug64745.phpt | 5 $hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0); 6 $rawHash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0, true);
|
H A D | hash_hkdf_rfc5869.phpt | 23 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 D | mhash_003.phpt | 24 $salt = str_repeat($hash, 2); 25 $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
|
/php-src/ext/openssl/tests/ |
H A D | openssl_pbkdf2_basic.phpt | 10 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/openssl/ |
H A D | openssl_pwhash.c | 92 const unsigned char *salt, size_t salt_len, in php_openssl_argon2_compute_hash() argument 139 unsigned char hash[PHP_OPENSSL_HASH_SIZE+1], salt[PHP_OPENSSL_SALT_SIZE+1]; in php_openssl_argon2_hash() local 148 if (RAND_bytes(salt, PHP_OPENSSL_SALT_SIZE) <= 0) { in php_openssl_argon2_hash() 159 salt64 = php_base64_encode_ex(salt, PHP_OPENSSL_SALT_SIZE, PHP_BASE64_NO_PADDING); in php_openssl_argon2_hash() 173 uint32_t *threads, zend_string **salt, zend_string **hash) in php_openssl_argon2_extract() argument 193 if (salt && hash) { in php_openssl_argon2_extract() 212 *salt = php_base64_decode((unsigned char *)salt64, strlen(salt64)); in php_openssl_argon2_extract() 222 zend_string *salt, *hash, *new; in php_openssl_argon2_verify() local 234 ZSTR_VAL(password), ZSTR_LEN(password), (unsigned char *)ZSTR_VAL(salt), in php_openssl_argon2_verify() 235 ZSTR_LEN(salt), (unsigned char *)ZSTR_VAL(new), ZSTR_LEN(new))) { in php_openssl_argon2_verify() [all …]
|
/php-src/ext/standard/tests/crypt/ |
H A D | bcrypt_salt_dollar.phpt | 6 $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 D | pwhash_argon2i.phpt | 32 $salt = random_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES); 35 ($out_len, $passwd, $salt, 41 ($out_len, $passwd, $salt,
|
H A D | pwhash_scrypt.phpt | 24 $salt = random_bytes(SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES); 27 ($out_len, $passwd, $salt,
|