## 4 Proposed Methodology and Simulation Scenarios
### ECC-CRT Algorithm  
Observation suggests that any legal but malicious IoT device can reveal the identity of other users. As a result, their method is susceptible to both server spoofing and offline password-guessing attacks. Furthermore, if the malicious patient registers at the same time as other users, she can successfully carry out impersonation, man-in-the-middle, modification, replay, and powerful replay attacks. This paper proposes an improved ECC-based authenticated key agreement mechanism to address these flaws. An ECC is an elliptical curve theory based on a public key encryption technique that can be used to create cryptographic keys that are faster, smaller, and more effective. To obtain exceptionally high primary numbers, the ECC uses the functions of the elliptic curve equation to construct keys rather than the traditional method. This technology supports most public-key encryption algorithms, including SHA and Diffie-Hellman [44]. According to some researchers, ECC can provide the same level of security as other methods that need a 1024-bit key with a 164-bit key. The proposed approach uses ECC methods, which depend on the algebraic structure of the elliptical curves over finite fields, to overcome these limitations, as shown in Figure 5. Internal and public keys are the primary applications of elliptic curves with this method. They are also used when the messages are encrypted and decrypted. This alternative approach used this method to decrease computing power since the key size of the method is the least of many cryptographic algorithms in contrast. Figure 5: Elliptical curves over finite fields. ECC generates two keys: the private key and the public key. The resource directory (RD) public key will be used to encrypt each service agent (SA) sender node post. The RD, in turn, will use its private key to decrypt the message. A random number \(\mathrm{R}\) in a range (n) is then chosen. The following Equation (1) is then used to produce the public key:  
\[\mathrm{PU}=\mathrm{R}*\mathrm{P} \tag{1}\]  
If \(\mathrm{R}\) is a random number between \(1\) and \(\mathrm{n}-1,\mathrm{P}\) is the point in the curve produced by the next Equation (2). Furthermore, \(\mathrm{PU}\) refers to the public key, and \(\mathrm{n}\) to the private key. \[y^{2}=x^{3}+ax+b \tag{2}\]  
Here, the ECC algorithm key generation is given as (shown in Figure 5):  
**For Encryption**  
* \(\mathrm{s}\) is message
* \(\mathrm{K}\) is random number  
\[\mathrm{C}_{1}=\mathrm{K}\times\mathrm{P}\ \&\ \mathrm{C}2=\mathrm{S}+\mathrm{K} \times\mathrm{PU} \tag{3}\]  
**For Decryption**  
* Received encrypted message  
\[\mathrm{S}=\mathrm{C}2-\mathrm{d}\times\mathrm{C}1 \tag{4}\]  
* received original message  
The Chinese remainder theorem is a theorem which gives a unique solution to simultaneous linear congruences with coprime moduli. In its basic form, the Chinese remainder theorem will determine a number \(\mathrm{p}\) that, when divided by some given divisors, leaves given remainders. Many ancient problems involved linear congruences. Such a problem concerned the removal of eggs from a basket 2, 3, 4, 5, and 6 at a time, whereupon 1 egg remained. However, when they were removed 7 at a time, none remained. This may be stated in terms of congruences as follows: \(\mathrm{x}\equiv 1(\mathrm{mod}\ 2)\), \(\mathrm{x}\equiv 1(\mathrm{mod}\ 3)\),..., \(\mathrm{x}\equiv 1(\mathrm{mod}\ 6)\), \(\mathrm{x}\equiv 0(\mathrm{mod}\ 7)\). These are equivalent to the two congruences \(\mathrm{x}\equiv 1(\mathrm{mod}\ 60)\) and \(\mathrm{x}\equiv 0(\mathrm{mod}\ 7)\), which have the solution \(\mathrm{x}\equiv 301(\mathrm{mod}\ 420)\). Problems of this type are found in the works of the Chinese mathematician [PERSON]. When each pair of moduli is relatively prime, the solution is found in the following theorem. Chinese Remainder Theorem. Given the simultaneous congruences \(x\equiv(a_{i}(modm_{i}))\) for \(i=1\), \(2\), \(3\),..., \(n\), where \((m_{i},m_{j})=1\) for all \(i\), \(j\), let \(M=m_{1}m_{2}m_{3........}m_{n}\).