Home/Computer Science/Brute-Force Key Space Cracking Time Estimate

Formula & Calculator

Brute-Force Key Space Cracking Time Estimate

Estimates the average time required to brute-force a cryptographic key or password of a given bit strength.

Computer ScienceCryptographySecurity

Brute‑Force Cracking Time CalculatorT = 2bits‑1 / G

T = 2bits‑1 / G
bits = key length (bits)  ·  G = guesses per second
⟹ Tbits, G
bits
/s
s
Time unit:
Solve for:
Common key sizes:
Time to Crack
✓ Copied!
Time Category
Instant (<1s) Seconds–Minutes Hours–Days Months–Years Centuries+
Time vs. Key Sizefixed G
T(bits) = 2bits‑1/G Computed point
T = 2bits‑1 / G  ·  Average time to brute‑force a key space

Interpretation

Brute‑force cracking time estimate: Time = 2^(bits−1) / Guesses per Second, assuming on average half the keyspace is searched. Example: 40‑bit key, 1e9 guesses/s → time = 2³⁹ / 1e9 ≈ 549,755,813,888 / 1e9 ≈ 550 seconds (~9 minutes).

Time = 2^(bits-1) / Guesses per Second
Brute-Force Key Space Cracking Time Estimate

Variables

SymbolQuantityUnit
TimeAverage cracking times
bitsKey/password entropybits
Guesses per SecondAttacker's guessing rateguesses/s

What it means

This formula estimates the time required to brute‑force a cryptographic key of a given bit length, given a certain number of guesses per second. On average, the attacker will find the key after searching half of the keyspace, so the time is 2^(bits−1) / guesses_per_second. For a 40‑bit key, which has 2^40 possible combinations, the average search is 2^39. At 1 billion guesses per second, the time is about 550 seconds. This illustrates why modern encryption uses at least 128‑bit keys (2^127 attempts is infeasible). The formula is useful for understanding the security strength of cryptographic systems and for selecting key lengths. It also highlights the importance of using strong, unpredictable keys and high‑entropy passwords. In practice, attackers may use faster hardware (GPUs, ASICs) or parallel computing, so the guess rate can be much higher. The formula is a simplified model; it ignores overhead and assumes exhaustive search is the only attack. It remains a basic tool for security analysis.

Worked example

Brute‑Force Cracking Time – Two Examples

Real‑World
Scenario 1 – 56‑bit Key: A 56‑bit key (DES) is attacked at 10⁹ guesses/sec. What is the average cracking time?
ParameterValue
Bits56
Guesses/sec1×10⁹
1Keyspace = 2⁵⁶; average guesses = 2⁵⁵ ≈ 3.6×10¹⁶
2Time = 3.6×10¹⁶ / 10⁹ = 3.6×10⁷ seconds ≈ 416 days ≈ 1.14 years
Result ≈ 1.14 years ⚠️ Feasible with modern hardware
Scenario 2 – 128‑bit Key: A 128‑bit AES key is attacked at 10¹² guesses/sec. How long to crack?
ParameterValue
Bits128
Guesses/sec1×10¹²
1Average guesses = 2¹²⁷ ≈ 1.7×10³⁸
2Time = 1.7×10³⁸ / 10¹² = 1.7×10²⁶ seconds ≈ 5.4×10¹⁸ years
Result ≈ 5.4×10¹⁸ years ✓ Impossible
Key insight: Each additional bit doubles the key space – 128‑bit keys are effectively unbreakable by brute force.

Common mistakes

  • Factor 2^(bits−1): This assumes on average half the keyspace is searched before finding the key.
  • Guesses per second: Depends on hardware (e.g., GPU, ASIC) and hashing algorithm.
  • Units: Time is in seconds; convert to minutes/hours/days as needed.
  • Key bits: The exponent is bits−1 because the expected search is half the total keys.
  • Parallel attacks: Multiple machines reduce the time proportionally.

Applications

Brute‑force cracking time estimate, given by `Time = 2^(bits−1) / guesses_per_second`, estimates the time required to exhaust half the keyspace in a brute‑force attack. This formula is used to assess the security of cryptographic keys, passwords, and tokens. Engineers use it to set key lengths, to determine the feasibility of attacks, and to compare different encryption algorithms. In practice, it helps in designing systems that are resistant to offline attacks, by ensuring that the cracking time exceeds the useful lifetime of the data. Understanding this estimate is crucial for security professionals in justifying the use of longer keys and stronger algorithms.

  • Cryptographic key length selection
  • Security risk assessment of encryption schemes
  • Design of authentication tokens and session IDs
  • Performance evaluation of hashing algorithms
  • Compliance with security standards (e.g., NIST)

Frequently Asked Questions

Q01What is the formula to estimate the time to brute‑force a cryptographic key or password?
A01

The average time to find a key by brute force (assuming half the key space must be searched) is Time = 2^(bits‑1) / Guesses per second, where bits is the key length in bits, and Guesses per second is the number of keys that can be tested per second by the attacker.

Q02What does the "bits" represent in the formula?
A02

The number of bits is the entropy (or key length) of the secret. For a symmetric key of length 128 bits, the key space is 2^128. The formula uses 2^(bits‑1) because, on average, you find the key after searching half the space.

Q03What are the common mistakes when using the brute‑force time formula?
A03

  • Assuming a linear relationship between bits and time – each additional bit doubles the time (exponential).
  • Using the wrong average factor – the average is 2^(bits‑1), not 2^bits.
  • Not accounting for parallelization – if multiple machines work together, the effective time reduces linearly.
  • Assuming the attacker has maximum speed – in reality, the number of guesses per second depends on hardware (CPU, GPU, ASIC).

Q04How long would it take to crack a 128‑bit key at 10 billion guesses per second?
A04

Time = 2^(128‑1) / 10^10 = 2^127 / 10^10. 2^127 ≈ 1.7×10^38. Dividing by 10^10 gives 1.7×10^28 seconds, which is about 5.4×10^20 years – astronomically long. Thus, 128‑bit keys are currently unbreakable by brute force.

Q05What is the effect of increasing the key length by one bit on the cracking time?
A05

Increasing the key length by one bit doubles the cracking time (on average). For example, from 64 bits to 65 bits, time doubles. This exponential growth is why long keys are secure.

Q06How does the attacker’s hardware affect the time?
A06

The "Guesses per second" can vary widely: a modern CPU might do 10^9 guesses per second for some hashes; a GPU can do 10^10; specialized ASICs (like Bitcoin miners) can do 10^12 or more. The time is inversely proportional to this speed.

Q07What is the difference between a brute‑force attack and a dictionary attack?
A07

Brute force tries every possible combination of characters. Dictionary attack uses a list of likely passwords (common words, variations). Dictionary attacks are much faster if the password is weak. Entropy helps protect against brute force, but not against dictionary attacks if the password is common.

Q08How do salting and hashing affect brute‑force time?
A08

Salting makes pre‑computed rainbow tables useless. Hashing algorithms like bcrypt or PBKDF2 add a work factor (iterations), which increases the time per guess, effectively reducing the "Guesses per second." This makes brute‑force attacks much slower.

Q09What is the cracking time for a 56‑bit key with 1 million guesses per second?
A09

Time = 2^(56‑1) / 10^6 = 2^55 / 10^6 ≈ 3.6×10^16 / 10^6 = 3.6×10^10 seconds ≈ 1140 years. This is why 56‑bit DES is considered insecure; it was broken in 1998 with dedicated hardware.

Q10What are some real‑world examples where this formula is used?
A10

  • Security audits – estimating the strength of encryption.
  • Password policy design – setting minimum length and character requirements.
  • Cryptographic algorithm selection – choosing key lengths (e.g., AES‑128 vs AES‑256).
  • Legal and forensic estimates – estimating time to break encryption.