What Is a Brute Force Attack?

A brute force attack systematically tries many possible passwords or keys until the correct one is found, rather than exploiting a specific flaw in the syste...

Published November 16, 2026

A brute-force attack tries many passwords or keys until one works. Defend with rate limiting, account lockouts, strong hashing and multi-factor authentication.

The concept

Attackers automate guesses; credential stuffing reuses leaked username/password pairs from other sites. Weak, short passwords fall quickly.

Slow password hashes (bcrypt, Argon2) make each guess expensive offline, while rate limits and MFA stop online attacks.

Guessing speed

fast hash (MD5): billions of guesses / second on a GPU
bcrypt cost 12: a few hundred guesses / second
online login + rate limit: a handful / minute

Practical examples

Rate limit logins (Laravel)

Route::post('/login', ...)->middleware('throttle:5,1');

Slow hashing

$hash = password_hash($pw, PASSWORD_DEFAULT);

Lock after repeated failures

if (fails >= 5) lockUntil = Date.now() + 15 * 60 * 1000

Common mistakes

  • No limit on login attempts.
  • Revealing whether the username or password was wrong.
  • Fast unsalted hashes for passwords.

Key takeaways

  • Many guesses until success.
  • Rate limit, hash slowly, add MFA.
  • Check passwords against breach lists.

FAQ

What is credential stuffing?

Trying leaked credentials from other breaches on your site.

Does a CAPTCHA help?

It slows bots but is not sufficient alone.

More General articles