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 “10 in a million” 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.

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 “10 in a million” 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.