## 3 Proposed Model and Methodology
### Description of the Key Exchange Algorithm and Protocol  
#### 3.3.1 Description of the Algorithm  
Due to the specific resource constraints of IoT networks, the proposed model uses a cryptographic algorithm based on elliptic curves (ECC--elliptic curve cryptography). ECC is preferred due to its efficiency compared to classic cryptographic algorithms, allowing a high level of security even when using smaller keys, which significantly reduces resource consumption. The key exchange algorithm is designed to allow the creation of secure communication sessions between IoT devices with variable capabilities, such as low-power sensors, but also more powerful devices. In order to ensure a secure exchange of keys and to enable efficient data encryption, the proposed algorithm includes the following main steps:  
1. Key generation: Each device \(D_{i}\) generates a pair of keys (public and private) for the initial communication, using an elliptic curve defined by the elliptic curve equation on a finite field \[y^{2}=x^{3}+ax+b\bmod p\] (1)where \(p\) is a large prime number, and \(a\) and \(b\) are coefficients that define the curve and are known by all devices in the network. They are stored in a secure area on the device. 2. Calculation of points on the curve: Device \(D_{i}\) generates its private key \(k_{i}\), a unique random number, and calculates its public key \(P_{i}\) by multiplying \(k_{i}\) by a generating point \(G\) on the curve: \[P_{i}=k_{i}\cdot G\] (2) where \(G\) is a well-defined point on the curve and known by all devices in the network. 3. Distribution of public keys: Each device \(D_{i}\) transmits the public key to the devices it wants to communicate with. This does not reveal the private key and therefore does not compromise security. 4. Calculation of the shared session key: Device \(D_{i}\) can calculate the shared session key \(K_{ij}\) to communicate with another device \(D_{j}\) using its public key \(P_{j}\) and its private key \(k_{i}\): \[K_{ij}=k_{i}\cdot P_{j}\] (3) Device \(D_{j}\) can, in turn, calculate the same value using its private key \(k_{j}\) and public key \(P_{i}\): \[K_{ij}=k_{j}\cdot P_{i}\] (4) Due to the property of elliptic curves, the values obtained by \(D_{i}\) and \(D_{j}\) will be identical and will constitute the session key used to encrypt the messages exchanged between the two devices. Figure 1 visually represents the contraction process, providing a clearer understanding of its application in secure key exchange within IoT environments. The figure represents the mathematical process of parameter contraction over an elliptic curve and its implications for secure key exchange in IoT devices. The elliptic curve is defined by the general equation, which is a commonly used form in cryptographic applications due to its advantageous properties in terms of computational efficiency and security. 1. The Elliptic Curve (Blue Contour): The blue curve illustrates the set of all points \((x,y)(x,y)\) that satisfy the elliptic curve equation. This set forms a group under point addition, a fundamental operation in elliptic curve cryptography (ECC). The elliptic curve provides the mathematical foundation for secure key generation and exchange. 2. Original Points on the Curve (Red Markers): The red points represent specific coordinates on the elliptic curve prior to the contraction process. These points are typically  
Figure 1: Parameter contraction on elliptic curve for secure key exchange in IoT. used as public keys in the ECC key exchange protocol. Their positions are chosen based on the properties of the elliptic curve and the initial parameters. 3. Contracted Points on the Curve (Green Markers): The green points are the result of applying a contraction operation to the original points. The contraction process scales the coordinates of the points (e.g., by a factor of 0.5 in this figure), effectively reducing their spatial distribution on the curve.