What the Elliptic-Curve Diffie-Hellman Key Exchange Is
Elliptic-curve Diffie-Hellman (ECDH) is a method for securely exchanging cryptographic keys over an insecure channel. It uses elliptic curves to generate public and private key pairs, allowing two parties to establish a shared secret without having previously shared any secrets.
In the context of Bluetooth Low Energy (BLE), ECDH ensures that both devices can derive a common session key from their respective private keys, which is used for encrypting subsequent communications.
Why It Happens
The process begins with each device selecting a private scalar value. These values are then used to compute public points on an elliptic curve defined over a finite field (GF(p)). The public points are shared between the devices, and through point addition operations on the curve, both parties can derive the same session key.
This method is chosen for its efficiency and security, especially in resource-constrained environments like smartwatches.
Security Implications
Just Works pairing allows devices to establish a connection without any additional steps. While convenient, it does not provide the same level of security as ECDH because it relies on less secure methods for key exchange.
Numeric Comparison pairing requires users to enter a 6-digit code, which can be intercepted by an attacker in a man-in-the-middle (MitM) scenario. In contrast, ECDH is resistant to such attacks due to the difficulty of reversing the elliptic curve operations.
Real-World Examples
ECDH is widely used in various applications beyond smartwatches, including secure web communications and mobile banking. Its use ensures that sensitive data remains protected during transmission.
In the context of BLE, ECDH helps prevent unauthorized devices from establishing a connection with your smartwatch, thereby enhancing overall security.
Frequently asked questions
What is the difference between Just Works and Numeric Comparison pairing?
Just Works pairing allows for quick device connections without any additional steps but offers less security. Numeric Comparison pairing requires users to enter a 6-digit code, which can be intercepted in a MitM attack.
How does ECDH ensure the security of smartwatch BLE connections?
ECDH uses elliptic curve operations that are computationally difficult to reverse. This ensures that even if an attacker intercepts public keys, they cannot derive the shared session key without knowing one party's private key.
Why is Numeric Comparison pairing less secure than ECDH?
Numeric Comparison pairing can be vulnerable to man-in-the-middle attacks because it relies on a 6-digit code that can be intercepted. ECDH, in contrast, uses elliptic curve cryptography which is resistant to such attacks.
Can an attacker easily break the shared session key generated by ECDH?
No, breaking the shared session key requires solving the discrete logarithm problem on the elliptic curve, which is computationally infeasible with current technology and resources.
Try it live
Everything above runs in your browser — open Smartwatch BLE Pairing & Key Exchange (2D) and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Smartwatch BLE Pairing & Key Exchange (2D) simulation