Phone → Headset key/traffic Headset → Phone key/traffic Attacker-relayed traffic

Smart Headphone BLE Pairing Security (2D)

Smart headphones pair with a phone over Bluetooth Low Energy using LE Secure Connections: a real elliptic-curve Diffie-Hellman exchange that keeps the audio and microphone link private from anyone just listening. This 2D canvas simulator runs an actual ECDH exchange — generated live with the browser's WebCrypto API, no toy modulus — between a phone and a headset, then lets you flip on an active man-in-the-middle attacker that performs two genuinely separate ECDH exchanges of its own. Switch between the three real BLE association models — Just Works, Numeric Comparison and Passkey Entry — to see exactly why an unauthenticated Just Works pairing lets the attacker hold two real working keys and decrypt/re-encrypt every relayed packet undetected, while the two authenticated models generate real SHA-256 confirmation codes that mismatch and expose the attack before either device trusts it.