BLE Brute-Force Attack Time Calculator
Try Set PIN Digits to 6 and Attempts Before Lockout to 3. Set Lockout Duration (seconds) to 60 and Seconds per Attempt to 1.
Observe With these defaults, Without Rate Limiting shows 5.8 days and With Rate Limiting shows 122 days. Slowdown Factor shows 21.0x.
Explain A 6-digit PIN gives 1,000,000 combinations, and the calculation uses half that many guesses. The limited time adds a lockout delay to each batch of attempts.
Calculate attack time
Reset
Technical boundaries. The model assumes a constant attempt duration and repeating lockouts, with fractional cycles included rather than rounded to whole batches. Controls allow 4–8 PIN digits, 1–10 attempts per batch, 10–300 seconds of lockout, and 0.5–5 seconds per attempt.
Adjust PIN length and rate limiting to see how they affect brute-force attack duration.
viewof pinDigits = Inputs. range ([4 , 8 ], {
value : 6 ,
step : 1 ,
label : "PIN Digits"
})
viewof maxAttempts = Inputs. range ([1 , 10 ], {
value : 3 ,
step : 1 ,
label : "Attempts Before Lockout"
})
viewof lockoutSeconds = Inputs. range ([10 , 300 ], {
value : 60 ,
step : 10 ,
label : "Lockout Duration (seconds)"
})
viewof attemptSpeed = Inputs. range ([0.5 , 5 ], {
value : 1 ,
step : 0.5 ,
label : "Seconds per Attempt"
})
{
const totalCombinations = Math . pow (10 , pinDigits);
const avgToGuess = totalCombinations / 2 ;
// Without rate limiting
const unlimitedTime = avgToGuess * attemptSpeed;
const unlimitedDays = unlimitedTime / 86400 ;
// With rate limiting
const cycleTime = (maxAttempts * attemptSpeed) + lockoutSeconds;
const cycles = avgToGuess / maxAttempts;
const limitedTime = cycles * cycleTime;
const limitedDays = limitedTime / 86400 ;
const slowdownFactor = (limitedTime / unlimitedTime). toFixed (1 );
const color1 = "#2C3E50" ;
const colorLimited = limitedDays > 100 ? "#16A085" : limitedDays > 30 ? "#E67E22" : "#E74C3C" ;
const colorUnlimited = unlimitedDays > 100 ? "#16A085" : unlimitedDays > 30 ? "#E67E22" : "#E74C3C" ;
return html `<div style="background: #f8f9fa; border-radius: 8px; padding: 1.2rem; font-family: Arial, sans-serif;">
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem;">
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid ${ color1} ;">
<div style="font-size: 0.85rem; color: #666;">Total Combinations</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ color1} ;"> ${ totalCombinations. toLocaleString ()} </div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid ${ colorUnlimited} ;">
<div style="font-size: 0.85rem; color: #666;">Without Rate Limiting</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ colorUnlimited} ;"> ${ unlimitedDays < 1 ? (unlimitedTime / 3600 ). toFixed (1 ) + " hours" : unlimitedDays. toFixed (1 ) + " days" } </div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid ${ colorLimited} ;">
<div style="font-size: 0.85rem; color: #666;">With Rate Limiting</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ colorLimited} ;"> ${ limitedDays < 1 ? (limitedTime / 3600 ). toFixed (1 ) + " hours" : limitedDays > 365 ? (limitedDays / 365 ). toFixed (1 ) + " years" : limitedDays. toFixed (0 ) + " days" } </div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid #16A085;">
<div style="font-size: 0.85rem; color: #666;">Slowdown Factor</div>
<div style="font-size: 1.5rem; font-weight: bold; color: #16A085;"> ${ slowdownFactor} x</div>
</div>
</div>
<div style="font-size: 0.8rem; color: #666;">Rate limiting ( ${ maxAttempts} attempts then ${ lockoutSeconds} s lockout) slows brute-force by ${ slowdownFactor} x. A ${ pinDigits} -digit PIN has ${ totalCombinations. toLocaleString ()} combinations.</div>
</div>` ;
}
Back to the chapter