Lines Matching defs:clear

22      * then the clear text password is crypted using the same method. If both hashs
28 * @param string $clear Clear-Text password
32 public function verify_hash($clear, $hash)
43 $clear = md5($clear);
103 return password_verify($clear, $hash);
122 $newhash = $this->$call($clear, $salt, $magic);
179 * @param string $clear The clear text to hash
183 public function hash_smd5($clear, $salt = null)
188 return crypt($clear, '$1$' . $salt . '$');
191 return $this->hash_apr1($clear, $salt, '1');
202 * @param string $clear The clear text to hash
206 public function hash_lsmd5($clear, $salt = null)
209 return "{SMD5}" . base64_encode(md5($clear . $salt, true) . $salt);
222 * @param string $clear The clear text to hash
227 public function hash_apr1($clear, $salt = null, $magic = 'apr1')
231 $len = strlen($clear);
232 $text = $clear . '$' . $magic . '$' . $salt;
233 $bin = pack("H32", md5($clear . $salt . $clear));
238 $text .= ($i & 1) ? chr(0) : $clear[0];
242 $new = ($i & 1) ? $clear : $bin;
244 if ($i % 7) $new .= $clear;
245 $new .= ($i & 1) ? $bin : $clear;
269 * @param string $clear The clear text to hash
272 public function hash_md5($clear)
274 return md5($clear);
282 * @param string $clear The clear text to hash
285 public function hash_sha1($clear)
287 return sha1($clear);
295 * @param string $clear The clear text to hash
299 public function hash_ssha($clear, $salt = null)
302 return '{SSHA}' . base64_encode(pack("H*", sha1($clear . $salt)) . $salt);
310 * @param string $clear The clear text to hash
314 public function hash_crypt($clear, $salt = null)
317 return crypt($clear, $salt);
327 * @param string $clear The clear text to hash
330 public function hash_mysql($clear)
335 $charArr = preg_split("//", $clear);
351 * @param string $clear The clear text to hash
354 public function hash_my411($clear)
356 return '*' . strtoupper(sha1(pack("H*", sha1($clear))));
367 * @param string $clear The clear text to hash
371 public function hash_kmd5($clear, $salt = null)
376 $hash1 = strtolower(md5($key . md5($clear)));
400 * @param string $clear The clear text to hash
407 protected function stretched_hash($algo, $clear, $salt = null, $magic = 'P', $compute = 8)
426 $hash = hash($algo, $salt . $clear, true);
428 $hash = hash($algo, $hash . $clear, true);
465 * @param string $clear The clear text to hash
472 public function hash_pmd5($clear, $salt = null, $magic = 'P', $compute = 8)
474 return $this->stretched_hash('md5', $clear, $salt, $magic, $compute);
487 * @param string $clear The clear text to hash
494 public function hash_drupal_sha512($clear, $salt = null, $magic = 'S', $compute = 15)
496 return substr($this->stretched_hash('sha512', $clear, $salt, $magic, $compute), 0, 55);
502 * @param string $clear
510 public function hash_hmd5($clear, $salt = null, $magic = 'H', $compute = 8)
512 return $this->hash_pmd5($clear, $salt, $magic, $compute);
523 * @param string $clear The clear text to hash
527 public function hash_djangosha1($clear, $salt = null)
530 return 'sha1$' . $salt . '$' . sha1($salt . $clear);
541 * @param string $clear The clear text to hash
545 public function hash_djangomd5($clear, $salt = null)
548 return 'md5$' . $salt . '$' . md5($salt . $clear);
562 * @param string $clear The clear text to hash
568 public function hash_seafilepbkdf2($clear, $salt = null, $opts = [])
589 $hash = hash_pbkdf2($algo, $clear, hex2bin($salt), $iter, 0);
599 * @param string $clear The clear text to hash
605 public function hash_djangopbkdf2($clear, $salt = null, $opts = [])
625 $hash = base64_encode(hash_pbkdf2($algo, $clear, $salt, $iter, 0, true));
632 * @param string $clear The clear text to hash
638 public function hash_djangopbkdf2_sha256($clear, $salt = null, $opts = [])
641 return $this->hash_djangopbkdf2($clear, $salt, $opts);
647 * @param string $clear The clear text to hash
653 public function hash_djangopbkdf2_sha1($clear, $salt = null, $opts = [])
656 return $this->hash_djangopbkdf2($clear, $salt, $opts);
670 * @param string $clear The clear text to hash
676 public function hash_bcrypt($clear, $salt = null, $compute = 10)
688 return crypt($clear, $salt);
696 * @param $clear
701 public function hash_woltlab($clear, $salt = null)
703 return 'Bcrypt:' . $this->hash_bcrypt($clear, $salt);
716 * @param string $clear The clear text to hash
722 public function hash_sha2($clear, $salt = null, $opts = [])
742 return crypt($clear, '$' . $prefix . '$' . $salt . '$');
744 return crypt($clear, '$' . $prefix . '$' . $rounds . '$' . $salt . '$');
749 public function hash_sha512($clear, $salt = null, $opts = [])
752 return $this->hash_sha2($clear, $salt, $opts);
756 public function hash_sha256($clear, $salt = null, $opts = [])
759 return $this->hash_sha2($clear, $salt, $opts);
770 * @param string $clear The clear text to hash
774 public function hash_mediawiki($clear, $salt = null)
777 return ':B:' . $salt . ':' . md5($salt . '-' . md5($clear));
789 * @param string $clear The clear text to hash
792 public function hash_argon2i($clear)
797 return password_hash($clear, PASSWORD_ARGON2I);
808 * @param string $clear The clear text to hash
811 public function hash_argon2id($clear)
816 return password_hash($clear, PASSWORD_ARGON2ID);