We want to crypt a password =)

@param $password

@return string
501157
protected function bCrypt($password)
    {
        if ($this->isSamePasswordOption()) {
            $result = $this->gameDataService->hashPassword($password);
        } else {
            $bCrypt = new Bcrypt();
            $result = $bCrypt->create($password);
        }

        return $result;
    }
374277
protected static function validatePassword($password) {
		if (empty($password)) {
			throw new InvalidPasswordException();
		}

		$password = \trim($password);

		if (\strlen($password) < 1) {
			throw new InvalidPasswordException();
		}

		return $password;
	}
581376
public static function password_hash($password, $salt)
    {
        $app_auth_pepper = Config::get('security.auth_pepper', '');
        return sha1($password . $salt . $app_auth_pepper);
    }
255261
public function encodePassword($password)
    {
        $password = '"'.$password.'"';

        $encoded = '';

        $length = strlen($password);

        for ($i = 0; $i < $length; $i++) {
            $encoded .= "{$password{$i}
            }\000";
        }

        return $encoded;
    }
231189
public function hash($password) {
        $salt = \ww_getSalt($this->saltLength);
        $hash = \ww_HashEncode($password.$salt);

        return $salt.'$'.$hash;
    }
700251
protected function encrypt($token)
    {
        // Serialize the token object
        $token = serialize($token);
        
        // Encrypt the token if there is an Encrypter instance
        if ($this->encrypter instanceof Encrypter) {
            $token = $this->encrypter->encrypt($token);
        }
        
        // Return the token
        return $token;
    }
1083907
public function setPassword($password)
    {
        if (mb_strlen($password) == 0) {
            $this->throwError('Password not set');
        }

        $this->password = $password;

        return $this;
    }
1178421
public static function hash($password, $cost = null)
    {
        if ($cost === null) {
            $cost = self::DEFAULT_COST;
        }
        $prefix = sprintf('$%s$%02d$', self::PREFIX, $cost);
        $salt = self::createSalt();
        return crypt($password, $prefix.$salt);
    }
181011
public static function hashPassword($password)
    {
        # Test the message and key for string validity.
        Helpers::isString($password, 'Hash', 'hashPassword');

        return \Sodium\crypto_pwhash_scryptsalsa208sha256_str(
            $password,
            Constants::PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE,
            Constants::PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE
        );
    }
598439
public static function create($password): string
    {
        if (!$password) {
            throw new \RuntimeException('Password hashing failed: no password provided.');
        }

        $hash = password_hash($password, PASSWORD_DEFAULT);

        if (!$hash) {
            throw new \RuntimeException('Password hashing failed: internal error.');
        }

        return $hash;
    }
1368627
public function setChapPassword($password)
    {
        $chapId = $this->getChapId();
        $chapMd5 = $this->getChapPassword($password, $chapId, $this->getRequestAuthenticator());

        $this->setAttribute(3, pack('C', $chapId) . $chapMd5);

        return $this;
    }
560814
public function hash(string $password): string
    {
        if (!empty($this->salt)) {
            if ($this->saltPosition === self::SALT_BEFORE) {
                $password = $this->salt . $password;
            } else {
                $password = $password . $this->salt;
            }
        }

        return $this->callHashFunction($password);
    }
1206823
public function decodeResult($crypt)
	{
		$string = $this->decrypt($crypt);

		return $this->encoder->decodeResult($string);
	}
805051
public static function passwordReHash($password = '', $hash = '')
    {
        if (self::verifyPassword($password, $hash)) {
            if (password_needs_rehash($hash, self::ALGORITHM_DEFAULT)) {
                return self::createPassword($password);
            }
        }

        return NULL;
    }
793837
public function convertPassword($password)
    {
        if (self::TYPE_PASSWORD_DIGEST === $this->getTypeValue()) {
            $password = $this->digestPassword($password);
        }

        return $password;
    }
1201753
public function verifyPasswordHash(string $password, string $hash, string $salt = ''): string
    {
        $password = ($salt ?: self::$salt) . trim($password);

        return password_verify($password, $hash);
    }
301969
protected function setPassword($password) {
        if (!isset($password)) $password = '';
        else if (!is_string($password)) throw new IllegalTypeException('Illegal type of parameter $password: '.gettype($password));

        $this->password = $password;
        return $this;
    }