Lines Matching +full:- +full:m

28      * @param string $clear Clear-Text password
46 if (preg_match('/^\$1\$([^\$]{0,8})\$/', $hash, $m)) {
48 $salt = $m[1];
50 } elseif (preg_match('/^\$apr1\$([^\$]{0,8})\$/', $hash, $m)) {
52 $salt = $m[1];
54 } elseif (preg_match('/^\$S\$(.{52})$/', $hash, $m)) {
56 $salt = $m[1];
58 } elseif (preg_match('/^\$P\$(.{31})$/', $hash, $m)) {
60 $salt = $m[1];
62 } elseif (preg_match('/^\$H\$(.{31})$/', $hash, $m)) {
64 $salt = $m[1];
66 } elseif (preg_match('/^pbkdf2_(\w+?)\$(\d+)\$(.{12})\$/', $hash, $m)) {
68 $magic = ['algo' => $m[1], 'iter' => $m[2]];
69 $salt = $m[3];
70 … } elseif (preg_match('/^PBKDF2(SHA\d+)\$(\d+)\$([[:xdigit:]]+)\$([[:xdigit:]]+)$/', $hash, $m)) {
72 $magic = ['algo' => $m[1], 'iter' => $m[2]];
73 $salt = $m[3];
74 } elseif (preg_match('/^sha1\$(.{5})\$/', $hash, $m)) {
76 $salt = $m[1];
77 } elseif (preg_match('/^md5\$(.{5})\$/', $hash, $m)) {
79 $salt = $m[1];
80 } elseif (preg_match('/^\$2([abxy])\$(.{2})\$/', $hash, $m)) {
92 } elseif (preg_match('/^:B:(.+?):.{32}$/', $hash, $m)) {
94 $salt = $m[1];
95 } elseif (preg_match('/^\$(5|6)\$(rounds=\d+)?\$?(.+?)\$/', $hash, $m)) {
97 $salt = $m[3];
98 $magic = ['prefix' => $m[1], 'rounds' => $m[2]];
99 } elseif (preg_match('/^\$(argon2id?)/', $hash, $m)) {
100 if (!defined('PASSWORD_' . strtoupper($m[1]))) {
101 … throw new \Exception('This PHP installation has no ' . strtoupper($m[1]) . ' support');
122 $newhash = $this->$call($clear, $salt, $magic);
140 $salt .= $chars[$this->random(0, 61)];
158 $salt = $this->gen_salt($len);
185 $this->init_salt($salt, 8);
190 // Fall back to PHP-only implementation
191 return $this->hash_apr1($clear, $salt, '1');
208 $this->init_salt($salt, 8);
229 $this->init_salt($salt, 8);
234 for ($i = $len; $i > 0; $i -= 16) {
301 $this->init_salt($salt, 4);
316 $this->init_salt($salt, 2);
373 $this->init_salt($salt);
390 * maximum is 30 (-> 2^30 = 1_073_741_824). If a higher one is given,
411 $this->init_salt($salt);
429 } while (--$iter);
474 return $this->stretched_hash('md5', $clear, $salt, $magic, $compute);
496 return substr($this->stretched_hash('sha512', $clear, $salt, $magic, $compute), 0, 55);
512 return $this->hash_pmd5($clear, $salt, $magic, $compute);
529 $this->init_salt($salt, 5);
547 $this->init_salt($salt, 5);
570 $this->init_salt($salt, 64);
607 $this->init_salt($salt, 12);
641 return $this->hash_djangopbkdf2($clear, $salt, $opts);
656 return $this->hash_djangopbkdf2($clear, $salt, $opts);
685 $this->gen_salt(22);
703 return 'Bcrypt:' . $this->hash_bcrypt($clear, $salt);
707 * Password hashing method SHA-2
713 * - SHA-2 with 256-bit output for prefix $5$
714 * - SHA-2 with 512-bit output for prefix $6$ (default)
718 …m array $opts ('rounds' => rounds for sha256/sha512, 'prefix' => selected method from SHA-2 family)
740 $this->init_salt($salt, 8, false);
752 return $this->hash_sha2($clear, $salt, $opts);
759 return $this->hash_sha2($clear, $salt, $opts);
776 $this->init_salt($salt, 8, false);
777 return ':B:' . $salt . ':' . md5($salt . '-' . md5($clear));
787 * @link https://www.php.net/manual/de/function.password-hash.php
806 * @link https://www.php.net/manual/de/function.password-hash.php
828 * @link http://php.net/manual/en/function.hash-hmac.php#93440
856 for ($i = 0; $i < strlen($key) - 1; $i++) {
882 throw new \RuntimeException($e->getMessage(), $e->getCode(), $e);