Skip to content
IT glossary
SecurityUpdated December 3, 2026

Brute-force attack

Перебор паролей

A brute-force attack tries to discover a password by testing guesses. In the strict sense, it checks every candidate in a defined set until it finds a match or runs out of candidates.

Also known as: брутфорс

What counts as brute force?

In password security, brute force means trying possible passwords rather than obtaining the password directly. Strictly speaking, exhaustive brute force covers every candidate in a specified search space, such as every six-digit PIN. In everyday security discussions, “brute force” often includes dictionary guessing, which focuses on likely passwords instead of covering every possible combination. Credential stuffing is different: it tries username and password pairs already exposed by another service.

The key distinction: who checks the guess?

In an online attack, an authentication service checks each guess. Because the requests reach the service, it can count failures, slow repeated attempts, and require another factor before granting access. A burst of login failures is a useful signal, but it isn't conclusive: a client repeatedly submitting an expired password can look similar.

In an offline attack, someone who has obtained stored password hashes can test guesses without contacting the service. A guessed password is processed using the salt and hashing parameters for the record, and the result is compared with the stored hash. This is not decrypting a hash. Login rate limits do not apply to these checks, and the service cannot see them in its logs.

Example: search space versus predictability

A four-digit PIN has 10,000 possible values, including those that start with zero. A six-digit PIN has one million: adding two digits makes the full space 100 times larger. But a larger space helps most when the secret is chosen randomly. A predictable six-digit PIN may be guessed much sooner than its search-space size suggests. An attempt limit can also make a short PIN practical in a setting where the same limit cannot be applied to leaked password hashes.

Defenses that match the threat

For online guessing, combine per-account and per-source throttling with multi-factor authentication and monitoring. An IP address is not a reliable stand-in for a person: many legitimate users may share one address, and suspicious requests can come from many addresses. Indefinite account lockouts can let someone deny access to the real owner by repeatedly failing to sign in. Protect recovery flows as well as the main login, and record authentication outcomes without logging password values.

For offline guessing, store passwords with a dedicated password-hashing function such as Argon2id, with a suitable cost setting and a unique random salt per password record. The salt stops a precomputed result for one salt from being reused against another; the function's cost is what makes each guess expensive. Long, randomly generated passwords are harder to guess, and using a different password for each service limits the damage from credential reuse.

How it comes up in interviews

If you're asked how to protect a login endpoint, first say what the attacker has: access to the login form or a copy of the stored hashes. Then explain which controls still work in that scenario. A strong answer also names the trade-off: throttling should slow guessing without making it easy to lock out legitimate users, while password hashing should make leaked records costly to check without making normal sign-ins unacceptably slow.