{'fraction_non_alphanumeric': 0.035619727849270366, 'fraction_numerical': 0.008250723477618373, 'mean_word_length': 4.498138117806365, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
LAKEE: A Lightweight Authenticated Key Exchange Protocol for Power Constrained Devices

The rapid development of IoT networks has led to a research trend in designing effective security features for them. Due to the power-constrained nature of IoT devices, the security features should remain as lightweight as possible. Currently, most of the IoT network traffic is unencrypted. The leakage of smart devices' unencrypted data can come with the significant cost of a privacy breach. To have a secure channel with encrypted traffic, two endpoints in a network have to authenticate each other and calculate a short-term key. They can then communicate through an authenticated and secure channel. This process is referred to as authenticated key exchange (AKE). Although Datagram Transport Layer Security (DTLS) offers an AKE protocol for IoT networks, research has proposed more efficient and case-specific alternatives. This paper presents LAKEE, a straightforward, lightweight AKE protocol for IoT networks. Our protocol employs elliptic curve cryptography for generating a short-term session key. It reduces the communication and computational overhead of its alternatives while maintaining or improving their security strength. The simplicity and low overhead of our protocol make it a fit for a network of constrained devices.

(TLS) handshake, for example, the server's identity is verified using the server's public key and the digital signature of the SSL certificate authority. In Kerberos, the Authentication Server and the Ticket Granting Server are trusted third parties. [4] Some AKE protocols, such as Google's QUIC protocol, are multi-stage. In these protocols, different runs of the protocol are not independent, and the former keys are used to derive the next key [5]. In some cases, AKE is based on a pre-shared secret between parties. The high entropy pre-shared secret ensures forward secrecy. In this paper, we present LAKEE, an AKE protocol which is certificateless and based on a pre-shared secret. Our protocol avoids the public key infrastructure by using symmetric keys to be as lightweight as possible for employment in IoT networks. [6] We implement our protocol as an application on top of CoAP. Research has an interest in building application layer protocols, such as HTTP [7] and SOAP [8], on top of CoAP. Our practice is the same.
The contributions of the present work can be summarized below.
• We propose a lightweight and effective protocol which guarantees secure communication by establishing a secure session. We have implemented our protocol in Python using the aiocoap [9] library.
• The protocol can easily integrate with the existing system deploying DTLS-PSK without requiring additional code.
• After session establishment, the transport layer can use the generated key to encrypt application layer messages securely. More precisely, the session parameters are mapped to the DTLS session parameters without requiring any modification in the existing session format for DTLS-PSK mode. Thus the transport layer can protect the application layer message using the encryption mechanism of DTLS-PSK.
• We estimate our protocol's communication and computation overhead and compare it with the alternative protocols. We prove that the overhead of the protocol is significantly less than its competitors.
• We verify the security strength of the proposed protocol both by formal logic and simulation tools.

Related Work
Many researchers have focused on balancing the tradeoff between security and overhead of session establishment protocols in the context of IoT devices. Pan et al. [10] offer a lightweight certificateless protocol based on elliptic curves and bilinear pairing. However, a third component, as a key generation center (KGC), is required. The total number of messages for key exchange is also 4, which is more than our proposed protocol. It is not clear which participant is responsible for initiating the protocol.
Kalra et al. [11] and Kumari et al. [12] proposed authentication methods, but they depend on HTTP cookies. Moreover, when the cookie of a user-server connection resets, the number of steps is increased to 5. It is also shown that the Kalra and Kumari protocols are not desirably secure. [12], [13] Shin et al. [14] have proposed a security framework for MQTT, enabling the client and server to come up with a symmetric session key based on the AugPAKE protocol. [15] The protocol proposed by Yeh et al. [16] is a lightweight authentication method which employs elliptic curve cryptography and hashing to provide two endpoints with a session key. Hashing is known to be more efficient than encryption and can therefore benefit IoT networks. However, the method is dependent on a third element called Registration GW-node. Moreover, the login phase has 4 messages. Albalas et al. apply both Rivest-Shamir-Adleman (RSA) and Elliptic Curve Cryptography (ECC) for key generation in CoAP and discuss the advantages of ECC. The session key establishment scheme proposed by Dey and Hossain [17] has 7 steps involving 3 participants; the smart device, the service provider, and the home gateway.
Bhattacharyya et al. [18] have proposed LESS, a simple and lightweight authenticated key exchange protocol for IoT devices. The proposed protocol is implemented on top of the CoAP layer. The main difference between LESS and our protocol is the session key generation. In LESS, the server is responsible for choosing the session keys, which are transferred to the client in the second and fourth messages of the protocol. Majumder et al. [19] have also proposed an authenticated key exchange protocol based on ECC. They verify the security strength of their protocol both formally (using the BAN logic) and practically (using the AVISPA simulation tool). However, their protocol, ECC-CoAP, is not implemented, and its compatibility with CoAP is not verified. For example, CoAP may unexpectedly fragment the messages if they are larger than a limit. Figure 1: CoAP message structure [20] 3 Background

Constrained Application Protocol (CoAP)
CoAP is an application layer protocol for resource-constrained internet devices. For web integration, CoAP can be converted to HTTP. It also meets the fundamental requirements of IoT communication, which are multicast support, low overhead, and simplicity. CoAP is built on top of the User Datagram Protocol (UDP). As UDP is unreliable, unlike Transmission Control Protocol (TCP), an optional request/response layer is included in the messaging. The CoAP message structure is shown in figure 1 CoAP supports four types of messages: Confirmable (CON), Non-Confirmable (NON), Acknowledgement (ACK), and Reset (RST). A confirmable message guarantees reliability. Each confirmable message is replied to with an ACK by the server with the same message ID. Otherwise, it will be retransmitted using a default timeout and exponential back-off between retransmissions. However, non-confirmable messages are unreliable and are not replied to with an ACK. If the recipient cannot process a Non-confirmable message, it may reply with an RST message.

Elliptic Curve Cryptography (ECC)
ECC, proposed by Victor Miller and Neal Koblitz [21], [22], is a key-based cryptography technique based on the algebraic structure of elliptic curves over finite fields. It usually is an alternative to the RSA cryptographic algorithm. ECC features smaller ciphertext, keys, signatures and a faster generation of keys and signatures. The fundamental downside of ECC is that, due to the complexity of its mathematical foundation, it is difficult to implement securely.
An elliptic curve E is defined over a prime finite field F p . This smooth projective curve of genus 1 is denoted as E/F P and holds the following elliptic curve equation: We employ the mathematical operation of scalar point multiplication to perform an Elliptic Curve Diffie-Hellman Key Exchange (ECDH). The security strength of ECC lies in the difficulty of solving the Elliptic Curve Discrete Logarithm Problem (ECDLP). Similar to the Diffie-Helman Problem (DHP), ECDLP is based on the discrete logarithm problem and does not pursue any polynomial-time algorithm.

Datagram Transport Layer Security (DTLS)
IoT applications frequently encounter a variety of communication patterns that the Transmission Control Protocol (TCP) is unable to support effectively. Due to energy constraints, devices may often go into sleep mode; thus, it is infeasible to maintain a long-lived connection in IoT applications. In consequence, IoT networks use UDP as the transport protocol. Therefore, the SSL/TLS protocol, which makes TCP secure, is not applicable to the IoT environment. IoT networks can benefit from DTLS, which is a derivation of TLS protocol and provides the same security services on top of UDP.
CoAP can optionally use DTLS. CoAP defines four security modes.
• NoSec. • RawPublicKey, • Certificate DTLS provides CoAP with a nonoptimal handshake protocol with a long-lived key in the PresharedKey mode. It takes 6 messages (7 steps) to establish a session with this handshake. [23], [24] DTLS handshake protocol which can be used in CoAP for session establishment, is illustrated in figure 2.

Proposed Protocol
In this section, we present the LAKEE protocol completely. X → S : M denotes X sends message M to S. Figure 3 illustrates the protocol, which has 4 steps including 3 messages, while Table I explains the notations used.

Pre-negotiation
Before starting the handshake, the client and server must have agreed upon a prime finite field, an elliptic curve, a generator point, a key derivation function, and the symmetric high-entropy key Y.  an elliptic curve over the finite field F p and cyclic group generator P Y long-term symmetric key between client and server r c random number selected by the client r s random number selected by the server client_rand client's shared data for producing the session key where client_rand = r c .P server_rand server's shared data for producing the session key where server_rand = r s .P [E(.) k ] authenticated encryption of a plaintext using a symmetric key k h(m) unkeyed one-way hash value of message m concatenation #C i client identifier a.P scalar point multiplication; Point P is multiplied by scalar a.

Step 1. Client Challange
At first, the client generates a random number (r c ). It then computes client's challenge as client_rand = r c .P . The client concatenates the hash of its ID, client_rand, and current timestamp and encrypts the outcome with the pre-shared key Y. The client then sends its ID with the encrypted message to the server. The server recognizes the raw identifier, associating this message with a session initiation request. The client reveals his identity in this message. The novelty of our protocol is that the client challenges and authenticates the server first, reducing the required number of messages.

Step 2. Server Response and Challenge
After receiving the session initiation message from the client, the server checks the number of failed session initiation requests within a time frame originating from the message's source IP address. If it's greater than 3, the message is not processed. Otherwise, the server tries to decrypt the message using the pre-shared key. The server records the current time and checks |T 2 − T 1 | ≤ ∆T . If it holds, the shared secret is retrieved, and a random number is generated (r s ). The server then computes the server's challenge as server_rand = r s .P . It decides whether it is time to change the long-term secret (Y). The strategy with which the server chooses the time is out of the scope of the paper and is dependent on the information it stores about the clients. If the server decides to maintain Y, it sums the client's challenge with generator P (client_rand is a point on the curve). It then sends the result alongside its own challenge to the client.
If it decides to change Y during the handshake, it sums the client's challenge with twice the generator (2P) and sends the result alongside its own challenge to the client. When the information in the incoming is irrelevant, the handshake is terminated, and the number of failed attempts from the client's IP range is increased.

Step 3. Server Authentication and Client Response
In this stage, the client decrypts the server's message with the shared secret. It records the current time and checks |T 3 −T 2 | ≤ ∆T . If it holds, the client verifies the server's response provided that the message contains client_rand+P or client_rand + 2P . In the second case, it realizes that it should update Y during this handshake. The client then calculates server_rand + P or server_rand + 2P accordingly. It concatenates it with the current timestamp, encrypts the outcome, and sends the message to the server. The client locally calculates a shared secret which is a point on the elliptic curve. secret = rc.server_rand Using the horizontal position of the secret on the curve and the agreed key derivation function (KDF), the client calculates the session key. session_key = KDF (secret x ) If it also had to update Y, it calculates a new long-term key using the vertical position of the secret on the curve and the KDF.

Step 4. Client Authentication
In this stage, the server decrypts the client's message with the shared secret. It records the current time and checks |T 4 − T 3 | ≤ ∆T . If it holds, the server verifies the client's response the same as the previous step and calculates the session key. secret = rs.client_rand Using the horizontal position of the secret on the curve and the KDF, the server calculates the session key.
If it also had to update Y, it calculates the following.
In contrast with typical Internet users, each IoT device reaches out to a limited number of servers. We assume, as a consequence, that providing each client-server pair with a shared secret is feasible. Our certificateless protocol is independent of any authorities and third parties. Therefore, the proof of the parties' identity relies on the possession of the pre-shared and symmetric secret. As it is certificateless, our protocol with minor changes is employable in mesh IoT networks where any node can act as a client or a server dynamically.

Implementation
We have implemented our protocol on top of CoAP using the aiocoap python library. [9] We aimed to have a reproducible implementation, and it serves only as self-documenting code. We acknowledge that it could be more efficient by employing C++, for example. It is publicly available on Github 1 . The client performs all of the steps sequentially and in a single function. In contrast, the server would not block for an individual client. Therefore, it must store the handshake progress information, such as the challenge it sent to that particular client, and process the corresponding client's response upon reception. The first message (client challenge) is a Confirmable (CON) message. The second message (server response and challenge) is the Acknowledgement (ACK) of the first, and the third message's (client response) type is Non-Confirmable (NON). After sending the third message, the client would not wait for a reply from the server.
We have used the PyCryptodome package for encryption and elliptic curve operations. The AES block cipher is used because it has been standardized and resistant to side-channel attacks. Moreover, there are hardware acceleration mechanisms available for AES. The cipher in the CCM mode calculates a message authentication code (MAC) for each message to verify whether the received data is authentic. We employ the curve edwards448, also known as Ed448-Goldilocks, with the following equation. [25] The curve aims for a 224-bit security level, meaning that it is designed to increase the cost of breaking a discrete logarithm computation to 2 224 bit operations. [26] Daniel J. Bernstein and Tanja Lange have shown that this curve meets the ECDLP and ECC requirements. [27] However, Edwards448 points and scalars are bigger than those of other curves. We use a fixed 128-bit shared secret and the base point of the curve as the generator. PBKDF2 is used with SHA512 for deriving the session keys and new long-term secrets. [28] The ECDH secret has enough entropy for us to derive the keys without a salt and a large iteration number. The iteration number is 16 in the implementation.
The code reports the execution time at the end of the handshake. It varies by the running hardware. Once the key exchange has finished, the responsibility can shift from CoAP to DTLS for providing channel security. With the correct parameters, a DTLS session can be instantiated without having to perform the DTLS_PSK 7-step handshake.
• cipher suite = TLS_PSK_WITH_AES 128 CCM 8 • read state = S_k.x with encryption nonce • write state = S_k.y with encryption nonce Along with the above parameters, one has to instantiate the client and server's initialization vectors, generate a sequence number, and fill other parameters for the desired DTLS session, such as Peer certificate with NULL.

Security Evaluation
In this section, we evaluate the security strength of our protocol.

Properties of the Protocol
The security goals are achieved as stated below.
• Confidentiality: All the secrets, including the timestamps and challenges, are encrypted.
• Integrity: We use the AES-CCM ciphersuite, which performs MAC(message authentication code)-then-Encrypt for every message. The MACs and the hash of the client ID guarantee the integrity of messages.
• Entity Authentication: Instead of digital signatures and certificates, the approach of this protocol for entity authentication is challenge-response. The random numbers used for building the session keys are used as challenges, and the other party needs the pre-shared secret and the negotiated curve to be able to process them.
• Message Authentication: As stated, MACs computed for transmitted messages provide message authentication.
• Non-repudation: As the client is expected to be an IoT device for which there are pre-defined tasks, we do not count non-repudiation as a necessary property for our protocol. Hence, we base our protocol on the pre-shared symmetric key. Also, instead of digital signatures, which provide non-repudiation, we use MACs which provide authentication.
• Perfect Forward Secrecy: In the proposed scheme, if the key Y is compromised and the adversary is able to read client_rand and server_rand, he cannot calculate the session key as he should obtain at least one of the secret randoms. The adversary cannot obtain the secret randoms from client_rand and server_rand due to the hardness of the elliptic curve discrete logarithm problem.

Quantitative Security Analysis
In this part, we discuss the security of our protocol against famous attacks. Table 2 compares the security strength of LAKEE with alternative protocols.

Man-in-the-Middle Attack
The assumption of our scheme is that the pre-shared key (i.e., Y ) remains a secret. Consequently, an adversary would not be able to modify plain messages, including the session initiation message. Besides, the MACs computed for each message make them unforgeable.

Denial-of-Service (DoS) Attack
The number of times an IoT device can attempt to be authenticated is limited within a timeframe. In the session initiation phase of our scheme, if the IoT device fails to be authenticated by the server within 3 attempts, the IoT device will be blocked for a specific period. Hence, an adversary will not be able to send multiple requests (more than 3) to overload the system resource to make the services unavailable to the legitimate client. Thus, our protocol restricts the DoS attack.

Replay Attack
A timestamp is associated with each message. If a participant receives an old message, it is not processed, and the connection is terminated. Hence, an adversary may not be able to use the captured messages to perform a replay attack. The adversary is also not able to change the timestamps as they are encrypted and protected with MAC.

Insider Attack
In this type of attack, an insider of the remote server acts as an adversary after getting some user credentials stored on the remote server. As the session key cannot be computed by acquiring client_rand and _rand and the adversary needs to know at least one of the random secrets, the protocol is safe against insider attack.

User and Server Impersonation Attack
As the attacker is not in possession of key Y, it cannot impersonate either client or server as all the messages include MACs and cannot be forged.

Offline Password Guessing Attack
This attack mainly occurs in password-based authentication schemes, which is also a challenge-response scheme. However, in our proposed scheme, the challenge will differ at each epoch. Hence, the attacker cannot randomly guess the response to authenticate himself.

Known Session Specific Temporary Attack
The session key is calculated at the ends, not transmitted with the messages. Hence, LAKEE is secure against known session specific temporary attack.

Invalid Curve Attack
When the attacker forces the server to compute a common secret using a point outside the defined curve, an invalid curve attack has occurred. As the client and server verify random points they receive, i.e., client_rand and server_rand, they would terminate the connection if each point is in infinity or outside the chosen curve.

The MOV attack
As all the points are transferred encrypted, we would not expect an adversary to obtain the random points (i.e., server_rand, client_rand). If any of the random points are guessed or acquired in polynomial time, there are two ways to prevent the adversary from obtaining the generator point (i.e., P). 1) Keep the embedding degree k greater than 100. 2) If the curve's subgroup divides the curve order, then the embedding degree should be the smallest k ≥ 2 such that n|q k − 1 for all values k from 2 to 100.

AVISPA Tool
In this section, we demonstrate that LAKEE is secure against relevant threats using the Automated Verification Internet Security Protocol and Applications (AVISPA) simulator program.

Introduction to the AVISPA Simulation Tool
AVISPA is a role-based simulator that assigns a specific role to each protocol participant. A specification provided in a supported language is used to verify a protocol. The primary language supported by AVISPA is High-Level Protocol Specification Language (HLPSL). The working structure of AVISPA is depicted in figure 4. HLPSL2IF translates HLPSL specification into an Intermediate Format (IF), where IF is a low-level language. The backends of the AVISPA tool use IF to analyze whether the security and authentication goals written in the specification are satisfied or violated. The AVISPA then produces the output SAFE and UNSAFE, respectively. The current version of the AVISPA tool supports 4 different types of backends.

OFMC
The AVISPA tool includes several backends for analyzing protocols. We use OFMC, a tool for falsification or verification for a bounded number of sessions. OFMC employs the Dolev-Yao intruder model [29] to check several parallel sessions

HLPSL
We now discuss the basics of the AVISPA tool's protocol specification language. HLPSL is a role-based language with which we can specify the actions of each participant in a protocol. For specifying a protocol in the HLPSL language, we have to define the following.
• Basic Roles: For both the client and the server, we have to define a role, including their actions, such as receiving and sending messages in certain formats.
• Transitions: Each transition is the representation of the receipt of a message and the sending of a reply message. Transitions are defined for a certain role.
• Composed Roles: For grouping our basic roles and representing a whole protocol session, we have to define a session role. For storing the global constants and composition of multiple sessions, we have to define an environment role. The intruder can actively take action in this environment. These composed roles do not have a transition section, but they have a composition section in which the basic roles are instantiated.
• Security Goals: In the environment role, we have to declare which parameters are shared secrets and which parameters are used for the authentication of participants.
For more information about the syntax of HLPSL and examples, please refer to the AVISPA manual. [30] Simulation Results We have defined our protocol in HLPSL with the following simplifications. We have not included timestamps and have defined elliptic curve mathematical functions simply as hash functions. In our specification, the client authenticates the server on comprehension of SRand (server_rand), and the server authenticates the client on comprehension of CRand (client_rand). SRand, CRand, Srand (rs), and Crand (rc) are shared secrets. We have not included the session key in shared secrets as it is not transferred in the protocol. We have used the SPAN + AVISPA virtual machine and SPAN graphical tool [31] to parse our specification and the OFMC backend to verify our protocol. The result in figure 5 indicates that our protocol is safe.

Formal Verification Using the SVO Logic
Although Majumder et al. [19] and Mahmood et al. [32] use the BAN logic [33] in order to verify their protocol formally, we firmly believe that BAN logic is not suitable for verifying key exchange protocols. Alternatively, we use the SVO Logic [34]. Syverson and Oorschot [34] revealed that BAN analysis might lead to inappropriate conclusions in some settings. Therefore, they presented a logic capturing the desirable properties of the BAN family of logics, including BAN [33], AT [35], GNY [36], and VO, [37] that is both sound and relatively easy to use

Preliminaries of SVO Logic
In this section, we briefly review the SVO logic, the notations, rules, and axioms. However, we omit some definitions unused in our analysis, such as the concept of public key. [38] Notation The entities' names who want to perform an authenticated key exchange are Client and Server. We have assumed that the Client and Server have shared a long-term key. We use the symbols for Client (C), Server (S), the pre-shared key (Y), and the session key (k).
P believes X : The principal P may act as though X is true.
P received X : The principal P received a message containing X. P can read and repeat X.
P said X : The principal P at some time sent a message including X.
P says X : The principal P must have said X since the beginning of the current protocol run. P has X : X is either, • Initially available to P, • Received by P, • Freshly generated by P, • Constructible by P from the above. P controls X : The principal P has jurisdiction over X. P is an authority on X and should be trusted on this matter.
fresh (X) : X has not been sent in any message prior to the current protocol run. P k ← → Q : P and Q may use the shared key k to communicate. k will never be discovered by any principal but P,Q, or a principal trusted by P or Q. P K δ (P, k) : k is a public key-agreement key of P. A Diffie-Hellman key formed with k is shared with P.
{M } k : Encryption of message M using key k. Encrypted messages are uniquely readable and verifiable as such by holders of the right keys. P k− ← → Q ≡ (P k ← → Q ∧ P has k) : No one aside from P and Q and those they trust knows or could deduce k. While P knows k, Q may or may not. k is said to be P's unconfirmed secret. P k+ ← → Q : P knows k, and has received evidence confirming that Q knows k. No parties other than P and Q and those they trust knows k. k is P's confirmed secret suitable for Q.

SVO Rules
The SVO logic has two inference rules: Modus Ponens : From ϕ and ϕ → ψ infer ψ Necessiation : From ϕ infer P believes ϕ ' ' is a metalinguistic symbol. 'Γ ϕ' means that ϕ is derivable from the set of formulae Γ and the stated axioms using the inference rules. ' ϕ' is a theorem, i.e., derivable from axioms alone without any additional assumptions.
SVO axioms In this part we introduce the SVO axioms.
Belief Axioms 1. ( P believes ϕ ∧ P believes (ϕ → ψ)) → P believes ψ 2. P believes ϕ → P believes (P believes ϕ) implicitly names the (Diffie-Hellman) function that combines k with k − 1 (or, k with k − 1) to form a shared key. This is the axiom the BAN logic lacks.
Receiving Axioms 5. P received (X 1 , ..., X n ) → P received X i , for i = 1,...,n 6. (P received{X} k+ ∧ P has k − ) → P received X Here K + and k − are used to abstractly represent cognate keys, wheter symmetric or assymetric. In the symmetric case, k + = k − = k. In the assymetric case, k + is a public key and k − is the private key. Posession Axioms 7. P received X → P has X 8. P has (X 1 , ..., X n ) → P has X i , for i = 1,...,n 9. (P has X 1 ∧ ... ∧ P has X n ) → P has F (X 1 , ..., X n ) F is a meta-notation for any function computable in practice by P, e.g., encryption.
Comprehension Axiom 10. P believes(P has F (X)) → P believes(P has X) F is meta-notation for any function that is effectively one-one and such that F + or F − is computable in practice by P .

Verification of the Protocol using the SVO Logic
We should meet the goals below to have a secure and authenticated key exchange. G1. Entity authentication: C believes S says F (X, N A ). This goal necessitates that, given N A known to be fresh to C, S recently sent a message F (X, N A ), indicating that S has seen N A and has processed it. G2. Secure key establishment: Participants believe they are in possession of a good key to communicate with each other. The goal can be formulated as: C believes C k−

← → S
It is important to note that in our goals, the session key is an unconfirmed secret. No one knows or could derive k except C and S and those they trust. This notation is different from confirmed secret. If k is a confirmed secret, C knows k and has received evidence that S also knows k. It is apparent that our protocol does not establish a confirmed secret.

Performance Analysis
In this section, we estimate the overhead of our protocol with respect to the arithmetic and cryptographic operations used in our scheme.

Computation Overhead
To calculate the total computational cost of our protocol, we have borrowed the primitive arithmetic and cryptographic operation timings from Kilinc et al. [39], demonstrated in Table 3. The table shows the arithmetic mean and the standard deviation of the following primitive operations for 1000 executions each.  Table 4 shows the efficiency of LAKEE in comparison with other protocols seeking the same goal.  [19] 6T ECP M + 4T E/D(s) + 5T h 28.779ms Dey and Hossain scheme [17] 4T EM od + 6T E/D(s) + 6T h 38.527ms

Communication Overhead
For calculating the communication overhead in bits, we have to specify the length of each element. Ideally, the client ID is 64-bit long, and timestamps are 32 bits long. If we use the curve Ed448, server_rand and client_rand are 224 bits long. If we use other curves with a 128-bit secury level, server_rand and client_rand would normally be 128 bits long. The MAC, which the ciphersuite appends to the plaintext, has a fixed size of 128 bits. We use SHA-1 as a hash function for the client's ID with a 160-bit long output. The ciphertext would be the same size as the plaintext. The message sizes are calculated below.
• first message: 64 + 160 + 224 + 32 + 128 = 608 bits • second message: 224 + 224 + 32 + 128 = 608 bits • third message: 224 + 32 + 128 = 384 bits • total: 1600 bits In practice, each message should include a header not necessarily specified in the protocol. Therefore, besides the size of the messages in bits, the number of messages corresponds to the protocol's efficiency as well. LAKEE requires 3 messages for session key generation and authentication, which is less than its alternatives. Table 5 compares the total number of messages required by LAKEE and its alternatives.

Conclusion
In this paper, we proposed an efficient and lightweight authenticated key exchange protocol for the setting of IoT by employing elliptic curve cryptography. We addressed the performance and security shortcomings of the existing protocols. The results are promising. and our protocol, LAKEE, is proven to be more efficient than alternative protocols. LAKEE is implemented as an application protocol using CoAP. The security of it is analyzed formally and using the AVISPA security tool.