Password Brute-Force Time Calculator

Choose which of lowercase letters, uppercase letters, digits and symbols a password uses and how long it is, and the tool computes the number of combinations and the entropy, then estimates how long it takes to try them all at different guessing rates. See whether length or character variety matters more, and how much online and offline attacks differ.

Conditions

The string you type is used only inside this page and is never sent anywhere. Even so, do not type a password you actually use.

Result

Character set size N
–
Combinations N^L
–
Entropy (L × log₂N)
–
Time to try everything
–
Average time to a hit (half)
–

This assumes a password of randomly chosen characters attacked by trying every combination. Dictionary words, names and common passwords are cracked far faster than these figures.

Combinations and entropy

A password of length L drawn from N characters has N^L possible values. Eight lowercase letters give 26^8 ≈ 2.09×10^11, and eight characters from upper- and lowercase letters and digits give 62^8 ≈ 2.18×10^14. Expressed as a base-2 logarithm, this is the entropy, L × log₂N bits. Each extra bit doubles the number of combinations, so entropy is used as a measure of resistance to brute force.

Longer or more varied?

Going from 26 to 62 characters raises the entropy per character from about 4.7 to about 5.95 bits, whereas each extra character multiplies the total by N. Twelve lowercase letters already give 26^12 ≈ 9.5×10^16, far more than eight alphanumeric characters (about 2.2×10^14). That is why long passphrases made of several easy-to-remember words are recommended. Note, however, that combinations of meaningful words have fewer possibilities than the same length of random characters.

Online versus offline attacks

When an attacker types guesses into a login page (online), lockouts and rate limits allow only a few attempts per second. In an offline attack on leaked password hashes, the attacker computes hashes locally, and with a fast hash function GPUs can try billions of guesses per second or more. That is why services should store passwords with a salt and a deliberately slow, memory-hard hash such as bcrypt or Argon2, which cuts the guessing rate drastically. Switching the guessing rate in this tool shows how the time for the same password changes by many orders of magnitude.

Attacks beyond brute force, and defenses

Real attackers first try dictionary words, common passwords, names and birthdays, and small variations with digits or symbols added, so non-random passwords fall much sooner than the calculation suggests. Reusing a password leaked from another service also exposes you to credential stuffing. The basic defenses are long random passwords that differ for every service, a password manager to keep track of them, and multi-factor authentication.

Practice information security questions

An 8-character password is searched for by brute force, trying every candidate. If 1×10^10 candidates can be tried per second, which combination is closest to the time needed to try all candidates for a password made only of lowercase letters (26 kinds) and one made of uppercase letters, lowercase letters and digits (62 kinds)?

  1. ALowercase only: about 21 seconds; 62 kinds: about 6 hours
  2. BLowercase only: about 21 seconds; 62 kinds: about 4.7 minutes
  3. CLowercase only: about 3.5 minutes; 62 kinds: about 2.5 days
Show answer and explanation

Answer: A. Lowercase only: about 21 seconds; 62 kinds: about 6 hours

The number of candidates for an 8-character password is the number of usable characters multiplied by itself 8 times. With lowercase letters only it is 26^8 = 208827064576 (about 2.1×10^11), so at 1×10^10 per second all of them are tried in about 2.1×10^11 ÷ 1×10^10 ≈ 21 seconds. With 62 kinds it is 62^8 = 218340105584896 (about 2.2×10^14), which takes about 21834 seconds, or about 6 hours. Increasing the kinds of characters multiplies the number of candidates by the per-character ratio raised to the 8th power, so here it grows about 1000 times. This calculation, however, is only a guide for brute-forcing leaked fast hashes offline. Dictionary words and reused passwords are found far sooner than by brute force, so it is important to use long, random passwords and, on the service side, to combine slow hashing, limits on login attempts and multi-factor authentication.

When a web service stores users' passwords, it adds a random value that differs for each user (a salt) to the password before computing and storing the hash value. What is the main purpose of the salt?

  1. ATo allow the original password to be recovered from the hash value using the salt, so it can be sent to users who forget it
  2. BTo make the stored hash values differ even when users share the same password, making cracking with tables of precomputed hash values difficult
  3. CTo shorten the hash value and save database space
Show answer and explanation

Answer: B. To make the stored hash values differ even when users share the same password, making cracking with tables of precomputed hash values difficult

The basic rule is not to store passwords as they are but to store hash values computed with a hash function. At login, the hash of the entered password is computed and compared with the stored value. If only plain hash values are stored, however, users with the same password have the same hash, and simply looking up a table of precomputed hashes of common passwords (such as a rainbow table) reveals many passwords. A salt is a value generated randomly for each user, added to the password and stored together with the hash. The salt does not need to be secret, but because it differs for each user, the same password gives different hash values and precomputed tables become useless. An attacker has to redo the computation for each user, which greatly increases the effort.

For storing passwords, it is recommended not to use a fast hash function such as SHA-256 directly but a scheme deliberately designed to take time to compute, such as bcrypt or Argon2. Why?

  1. ASlow schemes have longer outputs, so collisions no longer occur
  2. BSpending time on the computation lets only legitimate users recover the original password from the hash value
  3. CIf the stored hash values are leaked, each guess an attacker tries also becomes expensive, greatly increasing the time needed for brute-force and dictionary attacks
Show answer and explanation

Answer: C. If the stored hash values are leaked, each guess an attacker tries also becomes expensive, greatly increasing the time needed for brute-force and dictionary attacks

If password hashes are leaked, attackers can hash candidate passwords one after another on their own computers and look for a match. General-purpose hash functions such as SHA-256 are built to process large amounts of data quickly, so with GPUs and similar hardware an enormous number of candidates can be tried per second. Schemes designed for password storage, such as bcrypt and Argon2, have an adjustable number of iterations (cost) and deliberately make each computation heavy. Making each computation a million times slower, for example, makes a brute-force search take a million times longer as well. A legitimate user logging in needs only one computation, so a delay of around 0.1 seconds is not a problem. Argon2 can also be configured to use a lot of memory, which makes massively parallel computation on GPUs or dedicated circuits difficult. Whichever scheme is used, it is combined with a per-user salt.

FAQ

How many 8-character passwords are there?

It depends on the character set. Lowercase letters alone give 26^8 ≈ 2.09×10^11, upper- and lowercase letters plus digits give 62^8 ≈ 2.18×10^14, and adding 32 symbols for 94 characters gives 94^8 ≈ 6.10×10^15.

How many bits of entropy are enough?

It depends on what you protect and how it can be attacked, but against offline attacks a common rule of thumb is at least about 70 to 80 bits from randomly chosen characters, roughly 12 to 14 characters of mixed-case letters and digits. Passwords people make up are not random and are weaker than their computed bit count.

Is the string I type sent anywhere?

No. The calculation runs only inside this page and the string is never sent. Even so, do not type a password you actually use; only the character sets and the length are used.

Is hashing enough to keep passwords safe?

Hashing alone is not enough. Without a salt, identical passwords produce identical hashes and can be looked up all at once in precomputed tables, and fast hash functions make brute force fast too. Use a salt together with a slow hash function such as bcrypt or Argon2.

Related terms

Hash function Salt Multi-factor authentication Phishing

Related calculators

Semiconductor, Electronics and Computing Calculators →