MITM Attack Probability Calculator
Try Set Attacker Pairing Attempts to 10 and Devices in Deployment to 100. Increase Devices in Deployment while keeping the attempts unchanged.
Observe At 10 attempts, Just Works displays 100.0% after rounding, while Numeric Comparison displays 0.001000%. With 100 devices, Numeric Comparison shows an expected 0.001000 compromised devices.
Explain Attacker Pairing Attempts sets N in the cumulative probability 1 - (1 - p)^N. Devices in Deployment multiplies that probability to give the expected number of compromised devices.
Calculate illustrative risk
Reset
Technical boundaries. The teaching model assumes independent attempts with fixed success probabilities of 0.75 for Just Works and 0.000001 for both Numeric Comparison and Out-of-Band. These illustrative constants do not represent measured product failure rates.
Interactive: MITM Attack Probability Calculator
Compare an illustrative MITM risk model across pairing methods and attacker attempts. Treat the values as a teaching model, not a measured product failure rate.
viewof numAttempts = Inputs. range ([1 , 100 ], {
value : 10 ,
step : 1 ,
label : "Attacker Pairing Attempts"
})
viewof numDevices = Inputs. range ([1 , 1000 ], {
value : 100 ,
step : 10 ,
label : "Devices in Deployment"
})
{
const codeSpace = 1000000 ; // 6-digit code
const justWorksRate = 0.75 ; // illustrative: timing race is the main barrier
const pNumericPerAttempt = 1 / codeSpace;
const pOobPerAttempt = 0.000001 ; // effectively 0
// Per-device success over N attempts
const pJustWorks = 1 - Math . pow (1 - justWorksRate, numAttempts);
const pNumeric = 1 - Math . pow (1 - pNumericPerAttempt, numAttempts);
const pOob = 1 - Math . pow (1 - pOobPerAttempt, numAttempts);
// Fleet-wide: expected devices compromised
const fleetJW = Math . min (numDevices * pJustWorks, numDevices);
const fleetNC = numDevices * pNumeric;
const fleetOOB = numDevices * pOob;
const color1 = "#2C3E50" ;
const colorJW = "#E74C3C" ;
const colorNC = "#16A085" ;
return html `<div style="background: #f8f9fa; border-radius: 8px; padding: 1.2rem; font-family: Arial, sans-serif;">
<h4 style="margin: 0 0 1rem 0; color: ${ color1} ;">Illustrative per-device MITM risk ( ${ numAttempts} attempts)</h4>
<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 ${ colorJW} ;">
<div style="font-size: 0.85rem; color: #666;">Just Works</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ colorJW} ;"> ${ (pJustWorks * 100 ). toFixed (1 )} %</div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid #E67E22;">
<div style="font-size: 0.85rem; color: #666;">Numeric Comparison</div>
<div style="font-size: 1.5rem; font-weight: bold; color: #E67E22;"> ${ (pNumeric * 100 ). toFixed (6 )} %</div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid ${ colorNC} ;">
<div style="font-size: 0.85rem; color: #666;">Out-of-Band (NFC)</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ colorNC} ;"> ${ (pOob * 100 ). toFixed (8 )} %</div>
</div>
</div>
<h4 style="margin: 1rem 0; color: ${ color1} ;">Illustrative fleet exposure ( ${ numDevices} devices)</h4>
<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 ${ colorJW} ;">
<div style="font-size: 0.85rem; color: #666;">Just Works</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ colorJW} ;"> ${ fleetJW. toFixed (0 )} devices</div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid #E67E22;">
<div style="font-size: 0.85rem; color: #666;">Numeric Comparison</div>
<div style="font-size: 1.5rem; font-weight: bold; color: #E67E22;"> ${ fleetNC. toFixed (6 )} devices</div>
</div>
<div style="background: white; padding: 1rem; border-radius: 6px; border-left: 4px solid ${ colorNC} ;">
<div style="font-size: 0.85rem; color: #666;">Out-of-Band (NFC)</div>
<div style="font-size: 1.5rem; font-weight: bold; color: ${ colorNC} ;"> ${ fleetOOB. toFixed (8 )} devices</div>
</div>
</div>
<div style="font-size: 0.8rem; color: #666;">Just Works has no cryptographic user verification, so this model treats each setup attempt as a timing race. Numeric Comparison uses a 6-digit check value. OOB adds a separate physical or visual channel.</div>
</div>` ;
}
Back to the chapter