The Odds a MITM Guesses the Comparison Code

The Odds a MITM Guesses the Comparison Code

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
bluetooth-ble
Ada ADA · CALCULATION AUDIT

The Odds a MITM Guesses the Comparison Code

During Numeric Comparison pairing a smart lock and a phone both display 481923 while a man-in-the-middle can only show its own 775204, so an undetected attack needs the tampered transcript to reproduce the same 6-digit code — 1 in 1,000,000. Even across the 10 retries a user might tolerate, the chapter still puts the risk at 0.001%, essentially zero. This audit re-derives that figure at full precision and asks whether the ten-retry shortcut hides anything, or whether the protection really is the vanishing odds of matching the code.

Companion to the chapter BLE Pairing and MITM Defense — every number here comes from that chapter.

Try

During Numeric Comparison pairing a smart lock and a phone both display 481923 while a man-in-the-middle can only show its own 775204 , so an undetected attack needs the tampered transcript to reproduce the same 6-digit code — 1 in 1,000,000 . Calculate this case.

Observe

This audit re-derives that figure at full precision and asks whether the ten-retry shortcut hides anything, or whether the protection really is the vanishing odds of matching the code. Check shows this.

Explain

The chapter's 10 / 1,000,000 = 0.001% is the union-bound approximation; it overstates the true value by only 4.5 x 10^-11, so to the displayed precision the two agree. The design meaning is that the protection is not the secrecy of the code -- it is shown openly on both screens -- but the vanishing chance that a tampered transcript reproduces it: each retry the user toleratesraises the cumulative chance nearly linearly. Check confirms it.

See the relationship before changing it

The figure reads from left to right. The blue input is pairing attempts. The middle card names the page’s rule. The green output is at-least-one match chance. The arrow matters: change the input, apply the rule once, then read the result with its unit.

Pairing Attempts changes at-least-one match chance A three-part teaching diagram connects pairing attempts, the rule chance = (1 - (1 - 1/1,000,000)^attempts) x 100, and at-least-one match chance. INPUT Pairing attempts APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrow. Each independent retry adds almost one chance in a million.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 10 attempts.

  2. 2

    Name the relationship. chance = (1 - (1 - 1/1,000,000)^attempts) x 100

  3. 3

    Substitute with units. 10 attempts give 0.001000%

  4. 4

    Read the result. Keep the unit beside the value, then use the result only inside the technical boundary below.

Predict, then change pairing attempts

Try Predict how at-least-one match chance responds when pairing attempts moves. Calculate pairing attempts; compare at-least-one match chance with that prediction.

10 attempts
Chapter baseline
At-least-one match chance

Observe Return to 10 attempts. Recheck at-least-one match chance with pairing attempts at its chapter value.

Explain Each independent retry adds almost one chance in a million.

Check yourself

What should you do before trusting a moved-slider result?
Answer: Predict its direction, apply the displayed relationship, keep the units, and compare the reset value with the chapter’s worked baseline.
What does this small model leave out?
Answer: Only pairing attempts moves here. The at-least-one match chance calculation excludes field effects listed below.

Technical boundaries

Outside the fixed “The Odds a MITM Guesses the Comparison Code” arithmetic are human comparison errors, biased random numbers, repeated sessions, protocol implementation flaws, or side-channel leakage; “The Odds a MITM Guesses the Comparison Code” therefore reports only its named fixtures.

Ada: The chapter pins Numeric Comparison’s strength on a 1 in 1,000,000 code match and adds a 10-attempt figure. Let me verify both and be precise about the 10-attempt case, since the ten-retry estimate is a slight shortcut.

A six-digit comparison value has 10^6 = 1,000,000 possibilities, and an active relay that swaps in its own public keys must have its tampered transcript coincidentally produce the same displayed code:

  • One attempt: P = 1 / 1,000,000 = 0.000001 = 0.0001%.
  • Ten independent attempts, the exact probability of at least one match: 1 - (1 - 1/1,000,000)^10 = 9.99996 x 10^-6 = 0.001000%.

The chapter’s 10 / 1,000,000 = 0.001% is the union-bound approximation; it overstates the true value by only 4.5 x 10^-11, so to the displayed precision the two agree. The design meaning is that the protection is not the secrecy of the code – it is shown openly on both screens – but the vanishing chance that a tampered transcript reproduces it: each retry the user tolerates adds only about one in a million, so even ten retries leave the attacker near 0.001%, essentially zero.

Every number above is taken from the chapter’s own material and re-derived step by step.