Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 4, No. 3, 2023 20 Analysis and Improvement of Authentication Schemes for Industrial Wireless Sensor Networks with Fog Computing Yuyan Huo 1, Baoyuan Kang 1, Xinyu Zuo 1, Shufang Niu 2, Anqian Li 1 1 School of Software, Tiangong University, Tianjin 300387, China 2 School of Computer Science and Technology, Tiangong University, Tianjin, China Abstract: Cloud computing enables access to needed resources from a shared pool of configurable computing resources anytime, anywhere. Cloud computing offers many benefits, such as security and reliability of data and convenience of resource sharing. But as more and more devices are accessed, the demand for network bandwidth increases and it is because cloud computing centralizes all the resources that risks are also centralized. To overcome the shortcomings of cloud computing, the concept of fog computing has been introduced. Fog computing supports high mobility and has a wide geographical distribution, it also delivers data with very low latency. However, as an extension of cloud computing, fog computing inherits the security and privacy issues of cloud computing. Therefore, identity authentication in a fog computing environment is essential. In 2022, Sahoo et al. proposed an authentication scheme for industrial wireless sensor networks with fog computing. However, we analyze the security of Sahoo et al.’s scheme and find that many places in the data distribution phase are not clearly explained and their scheme is also not resistant to user impersonation attack, tracking attack, denial of service attack and replay attack. In order to overcome the weaknesses of Sahoo et al.’s scheme, this paper proposes an improved scheme by making full use of random numbers and timestamps. After security analysis and comparison with some similar schemes, it is shown that the improved scheme can resist various known attacks and has smaller computational cost. Keywords: Authentication Schemes; Fog Computing; Cloud Computing. 1. Introduction Cloud computing integrates various dispersed computing, storage and application resources, so cloud computing has powerful computing and massive data storage capacity, effectively provides all kinds of resources to users in the form of services [1]. Cloud computing mainly includes the advantages of low cost, high computing efficiency, saving time and high availability. However, cloud computing certainly involves a lot of interactions between the cloud and the edge and this requires a wide enough network bandwidth as well as fast enough network transmission speed, but this will cause many problems, such as network congestion, high latency, low quality of service and large bandwidth usage. In order to address the shortcomings of cloud computing, the concept of fog computing was introduced. Fog computing is an extension and supplement of cloud computing. In fog computing, fog servers are deployed at the edge of the network and close to geographically terminal facilities [2], so some data that is not needed temporarily or urgently can be processed and stored directly in the fog layer. Therefore, fog computing can assist cloud servers to complete data storage and analysis in the locality [3] and can effectively improve the transmission rate and decrease the latency, greatly reducing pressure on the cloud. However, fog nodes are often deployed in remote and unprotected locations [4] and the data transmissions between users and fog servers, fog servers and fog servers, fog servers and cloud servers rely on common channels. Therefore, authentication in fog computing environments is critical. In 1981, Lampot et al. first proposed a remote authentication scheme in insecure environments [5]. Then, many two-factor authentication schemes based on hashes, smart cards, etc. have been proposed [6-9]. However, researches have shown that the majority of two-factor authentication schemes are insecure. As a result, three factor authentication schemes based on identity, password and biometrics [4,10-16] were proposed. In 2019, Jia et al. [4] proposed an authenticated key agreement scheme for fog- driven IoT healthcare system and claimed that their scheme is resistant to various known attacks and has low communication and computational costs. However, Wu et al. [10] pointed out that Jia et al.’s scheme[4] is not resistant to tracking attack, impersonation attack and does not provide user and fog node anonymity. In 2020, Chen et al. [11] proposed a secure authentication and key exchange scheme for fog computing and claimed that their scheme is more effective in performance and security compared to previous schemes. However, after analysis, Rana et al. [12] found that Chen et al.’s scheme does not provide user anonymity and is also not resistant to tamper-proof device stolen attack, user impersonation attack, fog node impersonation attack, insider attack and known session key attack. In 2022, Sahoo et al. [16] proposed an authentication scheme for industrial wireless sensor networks with fog computing and claimed that the proposed scheme ensures the confidentiality of the session key during communication and compared it with the existing schemes in terms of communication cost and storage cost, and results shows that the scheme has good practicality. However, this paper finds that many places in the data distribution phase are not clearly explained and Sahoo et al.’s scheme is also not resistant to user impersonation attack, tracking attack, denial of service attack and replay attack. To address the security issues of Sahoo et al.’s scheme, this paper proposes an improved scheme and performs security analysis on the improved scheme. We also compare the improved scheme with authentication schemes in the same direction in security 21 and computational cost, and the result shows that the improved scheme is effective in ensuring security of the scheme under the conditions of low computational cost. In this paper, Section 2 reviews Sahoo et al.’s scheme, Section 3 analyses the shortcomings of Sahoo et al.’s scheme, Section 4 proposes an improved scheme, Section 5 analyses security of the improved scheme, Section 6 compares the improved scheme with similar directional schemes in safety and computational cost and Section 7 draws conclusions. 2. Review of Sahoo et al.’s Scheme The main problem of Sahoo et al.’s scheme is in the data distribution phase, for the sake of brevity, in this section, we will only review user and fog server registration phase and data distribution phase. The symbols and meanings used in this paper are listed in Table 1. First, CS chooses a base point P on the elliptic curve E(GF(p)) and the order of P is n. Then, CS chooses master keys x, y and computes the public key Pub= y·P. CS keeps {x, y} as private key, making {P, Pub} as public. Table 1. Notations table Notation Description Ui, IDi The ith user and his identity PWi, BMi the ith user’s password and biometric Gen(·),Rep(·) Fuzzy generation and reproduction function θi, ωi Biometric secret key and Public reproduction parameter of EUi FSj, BIDj The jth fog server and its identity SNk,IDSk The kth sensor node and its identity CS cloud server x, y master keys chosen by CS SKuc-cs shared key between user Ui and cloud server CS SKbs-cs shared key between fog server FSj and cloud server CS Ek(·),Dk(·) Symmetric encryption functions and symmetric decryption functions N2,N3,rf,ru,rj random numbers ΔT allowed maximum delay 2.1. Registration Phase In this section, users and fog servers register with the cloud server CS via a secure channel. 2.1.1. Uesr Registration Phase The user registers with the cloud server by the following steps: 1) The user Ui selects his identity IDi, password PWi and extracts biometric BMi. Using fuzzy extractor, Ui calculates Gen(BM ) ( ),i i i= ω ,θ ( )i1 i iPW = h PW ||ω and then sends {IDi, PWi1} to the cloud server CS via a secure channel. 2) Upon receiving the message {IDi, PWi1}, CS calculates ( )i iA = h ID || x , ( )i i i1 iB = h ID || PW || A , ( )i i i1 uc-csC = h ID || PW || SK , ( )i uc-csD = SK h x . Then, CS stores {Bi,Ci,Di,SKuc-cs,h(·)} into a smart card (SC) and sends the SC to user Ui. At the same time, CS stores {Bi,Ci,SKuc-cs} into its database. 3) After receiving the SC from CS, Ui computes = ' uc-cs uc-cs i1SK SK PW , ' i i i iE = B h(ID || PW ) , and replace Bi and SKuc-cs with ' iE and ' uc-csSK . Finally, the SC contains { , , , , ,Rep( ), ( ) ' ' i i i uc-cs iC D E SK θ h }. 2.1.2. Fog Server Registration Phase In this phase, FSj registers with the cloud server via a secure channel. FSj chooses its identity BIDj and sends the sensor identity IDSk and BIDj to the CS. After receiving {BIDj,IDSk}, the cloud server CS computes ( )1 j k bs-csR = h BID || IDS || y || SK , ( )2 1R = h y R , CS stores {R1,SKbs-cs} in its database and sends {R1,R2,SKbs- cs} to the fog server. Then, FSj stores {BIDj, R1,R2,SKbs-cs} in its own database. 2.1.3. Data Distribution Phase In this subsection, user Ui, fog server FSj and cloud server CS authenticate each other and agree on a session key, then user Ui can communicate securely with fog server FSj. The specific steps in this subsection are shown below: 1) Ui inserts his SC into card reader and inputs his identity IDi, password PWi and imprints biometric BMi, SC retrieves ( )i i iω = Rep BM ,θ and calculates ( )* i1 i iPW = h PW ||ω , * ' * uc-cs uc-cs i1SK = SK PW . Further, SC verifies whether ? ( )* * i i i1 uc-csC = h ID || PW || SK holds or not. If the condition fails, the session is aborted. Otherwise, SC generates a random number N2 and current timestamp Tu and calculates = ( )* ' i i i iB E h ID || PW , (ID )* * 3 i uc-cs i 2 uL = h || SK || B || N ||T , ID ( ( ))4 i iL = h C || h x , (ID ) * 5 2 i uc-csL = N h || SK . Then, SC transmits request message{L3,L4,L5,Ci,Tu}to the CS through secure channel. 2) After receiving the message {L3,L4,L5,Ci,Tu}, the CS verifies the freshness of Tu by checking | | s uT -T ΔT ,where Ts is receiving time of the request message. If the verification holds, CS extracts the corresponding Bi and SKuc-cs from database based on Ci and calculates ID = h( || ( ))* i 4 iL C h x , *h(ID || SK )* 2 5 i uc-csN = L , *=h(ID || || || || )* * 3 i uc-cs i 2 uL SK B N T . Comparing * 3L with L3 sent from Ui to see if they are equal. If they are equal, the CS successfully authenticates user Ui. Then, the CS calculates 22 P* 2 2S = N , ( , , , , )bs-cs3 SK i uc-cs 2 2 iS = E ID SK S N B , and sends message {S3,Ts} to fog server FSj. 3) FSj receives the message {S3,Ts} at time Tf and verifies if |T T | Tf s- . If the verification holds, FSj computes bs-csSK uc-csD ( )=(ID ,SK , , ,B ).* 3 i 2 2 iS S N Then, FSj generates a random number N3 and computes 1 uc cs ubM SK P (M ,M ),   x y =h(ID ||M ||T ),2 i x fM 1M ,3 3M = N P, 4 3M N 2S , 3ACK N ( B )* i 2 3SK = h ACK || || N || N . FSj sends message {M2,M3,M4,Tf} to user Ui over public channel. 4) After receiving message {M2,M3,M4,Tf}, user Ui checks the freshness of the message by verifying | T T | T * u f , where * uT is current timestamp. If the verification holds, Ui calculates * * * * 1 uc cs ubM SK P (M ,M )  x y , *=h(ID ||M ||T )* 2 i x fM , and checks whether ? 2M* 2M or not. If equal, Ui successfully authenticates FSj. Then, Ui computes * 1M* 3 3N = M ,  * 2 4ACK N M , ( B )* * i 2 3SK = h ACK || || N || N , *h(ID || B || || ) * 5 i i uM SK T , and sends {M5, * uT } to FSj to complete mutual authentication. 5) After receiving message {M5, * uT }, FSj checks the authenticity of the user by computing ? (ID ||B || ||T )* * 5 i i uM =h SK . If the condition fails, FSj terminates the session. Otherwise, FSj stores the session key SK and sends information to the user Ui. 3. Shortcomings of Sahoo et al.’s Scheme In this section, the drawbacks of Sahoo et al.’s scheme [16] are demonstrated, the following subsections provide a detailed description of drawbacks of Sahoo et al.’s scheme. 3.1. Shortcoming 1 The data distribution phase of Sahoo et al.’s scheme is not well explained in many places. In the data distribution phase, it is mentioned that the SC sends message {L3, L4, L5, Ci, Tu} to the cloud server CS via secure channel and fog server FSj sends message {M2, M3, M4, Tf} to user Ui via public channel. However, it is not clarified whether CS sends message {S3, Ts} and Ui sends message {M5, * uT } via public channel or secure channel. Secondly, SC sends message {L3, L4, L5, Ci,Tu} to cloud server CS over secure channel is not in accordance with the general practice. In general, the process of user and fog server authenticating with each other and agreeing on a session key is performed over public channel. 3.2. Shortcoming 2 User Uk is a registered legitimate user and the cloud server CS saves Uk's value { k k uc csB ,C ,SK k }. If Uk knows his friend Ui’s identity IDi, then Uk can impersonate user Ui by following steps: 1) User Uk chooses a random number Nk and current timestamp Tk and by Uk’s value of { k k uc csB ,C ,SK k } to compute k k k k(ID )3k i uc-csL = h || SK || B || N ||T , kID ( ( ))4k iL = h C || h x , k k (ID )5k i uc-csL = N h || SK . Then, Uk sends the message {L3k,L4k,L5k,Ck,Tk} to the cloud server CS over a secure channel. 2) After receiving message {L3k,L4k,L5k,Ck,Tk}, CS retrieves the corresponding {Bk, k uc csSK  } by Ck and calculates kID = h( || ( ))* i 4kL C h x , * k k h(ID || SK ) uc-cs * 5k iN = L , * k k=h(ID || || || || )uc-cs * * 3k i k kL SK B N T . CS obtains Ui’s identity IDi by L4k and compares * 3kL with L3k sent by Uk. Obviously, the verification holds and CS thinks that it is user Ui who sends the message, then Uk impersonates user Ui successfully. Finally, CS computes P2k kS = N , bs cs ' k( , , , , ) uc-cs3k SK i 2k k kS = E ID SK S N B , and sends message {S3k,Tsk} to fog server FSg. 3) Upon receving message {S3k,Tsk}, FSg decrypts S3k to obtain the values of {IDi, k uc-cs SK ,S2k, Nk, Bk} by SKbs-cs’. Then, FSg generates a random number N3 and calculates uc cs k 1 ubM SK P (M ,M ),   x y 1M ,3 3M = N P, 4 3M N 2kS , 3ACK N * k k( ||B || || )3SK = h ACK N N . Finally, FSg sends message {M3,M4,Tg} to user Uk via public channel. 4) After receiving {M3,M4,Tg}, Uk computes 1 uc cs * k * * ubM SK P (M , M )   x y , 23 * 1M* 3 3N = M ,  k 4ACK N M , k( B )* * k 3SK = h ACK || || N || N . Thus, Uk impersonates Ui and agrees on a session key with fog server FSg. 3.3. Shortcoming 3 After user Ui and fog server FSj complete a mutual authentication process, fog server FSj can obtain user Ui’s IDi, SKuc-cs and Bi by decrypting S3. Then, for the next mutual authentication, when users Ua, Ub and Ui contact other fog servers, users Ua, Ub and Ui respectively send messages 4a ua ' ' ' ' 3aL ,L , },T{ Cia , 4b ub ' ' ' ' 3bL ,L , },T{ Cib , ' ' ' 3 u ' 4L ,L , }C ,T{ i to cloud server CS. Upon receiving the messages, CS authenticates the identities of Ua, Ub and Ui. After calculation, CS sends 3a sa ' 'S ,T{ } , sb ' 3b 'S ,T{ } , 3 s ''S ,T{ } to corresponding fog servers. After receiving message and computing, the corresponding fog servers send messages 2a 3a 4a ' ' ' 'M , M , M ,T{ }fa , 2b 3b 4b ' ' ' 'M , M , M ,T{ }fb , 2 3 4 ' ' ' 'M , M , M ,T{ }f to users Ua, Ub and Ui, respectively. FSj then intercepts messages 2a ' 'M ,T{ }fa , 2 b ' 'M , T{ }fb , 2 ' 'M ,T{ }f to compute 1 uc cs ubM SK P (M ,M ),   x y * '=h(ID ||M ||T ),2a i x faM * '=h(ID ||M ||T ),2b i x fbM * '=h(ID ||M ||T ),2 i x fM FSj verifies ? * 2a ' 2aM M , ? *  ' 2b 2bM M , ? *  ' 2 2M M . Obviously, *  ' 2 2M M . Thus, FSj can track user Ui through M2. 3.4. Shortcoming 4 1) According to subsection 3.3 above, user Ui can be traced. When it is confirmed that the user who sends the message is Ui, fog server FSj intercepts the message 2 3 4 ' ' ' 'M , M , M ,T{ }f sent by fog server FSg to Ui and chooses a random number Nj to calculate 1 uc cs ubM SK P (M ,M ),   x y * =h(ID ||M ||T ),2 i x fM * 1M ,3 jM = N * P 4 jM N . FSj sends message * * * '{ ,T }2 4 f3M ,M ,M to user Ui. 2) After receiving message * * * '{ ,T }2 4 f3M ,M ,M , Ui computes * * * * 1 uc cs ubM SK P (M ,M )   x y , *=h(ID ||M ||T )** 2 i x fM , Ui checks whether ** 2M is equal to the passed * 2M . Obviously, 2 ** * 2M M , Ui thinks that it is fog server FSg that sends the message. Then, Ui calculates * 1M* j 3N = M ,  2 4ACK N M , ( B )* * i 2 jSK = h ACK || || N || N , *h(ID || B || || ) * 5 i i uM SK T , and sends message {M5, * uT }to fog server FSg. 3) After receiving {M5, * uT }, FSg verifies ? (ID ||B || ||T )* * 5 i i uM =h SK , the verification cannot pass, the session key SK* calculated by Ui is different from the session key SK of fog server FSg, thus Ui and FSg cannot agree on a same session key, and it also leads to a waste of network resources. 3.5. Shortcoming 5 1) The attacker intercepts message {S3, Ts} sent from cloud server CS to fog server FSj. After a period of time, the attacker selects the current timestamp Tg and sends message {S3, Tg} to fog server FSj. 2) Upon receiving message {S3, Tg}, FSj checks j|T T | Tg- , where timestamp Tg is valid. FSj then decrypts S3 using shared key SKbs-cs to obtain uc-cs{ID ,SK , ,i 2S ,B }* 2 iN and selects a random number Nf to calculate 1 uc cs ubM SK P (M ,M ),   x y =h(ID ||M ||T ),2 i x jM 1M ,3 3M = N P. 4 fM N As a result, replay attack is successfully performed and also wastes network resources of fog server FSj. 4. Improved Scheme To overcome Sahoo et al.’s scheme [16]’s security problems, an improved scheme is proposed in this paper. The improved scheme includes three participants: user (Ui), cloud server (CS) and fog server (FSj). User and fog server authenticate with each other and agree on a session key with the help of cloud server. The following is a detailed description of the improved scheme. 4.1. Initialization Phase (1) Cloud server CS chooses a base point P on the elliptic curve E(GF(p)) and the order of P is n. Then, CS chooses master keys x, y and computes the public key Pub= y·P. (2) CS selects two hash functions: and keeps {x, y} as private key, making {P, Pub,h(·),h1(·)} as public. 24 4.2. User Registration Phase User Ui registers with the cloud server CS by the following steps: 1) Ui selects his identity IDi, password PWi and extracts his biometric BMi. Using fuzzy extractor, Ui calculates Gen(BM ) ( ),i i i= ω ,θ ( )i i iRPW = h PW ||ω . Then, user sends {IDi,RPWi} to cloud server CS via a secure channel. 2) After receiving message {IDi,RPWi}, the cloud server CS generates a pseudo- identity TIDi for user Ui and calculates A ( )i i= h ID || x , B (ID ||RPW ||A )i i i i= h , C (ID ||RPW || )i i i uc-cs= h SK . Then, CS stores {TIDi,Bi,Ci,SKuc-cs,h(·)} into a smart card(SC) and sends the SC to user Ui, meanwhile CS stores {TIDi, IDi, Bi, SKuc-cs} into its database. 3) After receiving the SC, user calculates SK =SK h(RPW )' uc-cs uc-cs i , E B (ID ||RPW )i i i i= h . user Ui then replaces Bi and SKuc-cs in the SC with , ' i uc-csE SK . At this point, the SC contains { TID , , ,Rep( ), ( ) ' i i i uc-cs i,C ,E SK θ h }. The process of user registration is shown in Figure 1. Figure 1. User registration phase 4.3. Fog Server Registration Phase Fog server registers with the cloud server through the following steps: 1) Fog server FSj selects its own identity BIDj and sends BIDj to cloud server CS via a secure channel. 2) After receiving BIDj, CS selects a random number rf and calculates 1 jR =h(BID || ||SK || )bs-cs fy r , 2 1R =R h( || ) fy r . CS then saves {BIDj,rf,SKbs-cs} into its own database and sends {R1,R2,SKbs-cs} to fog server FSj. 3) After receiving message {R1, R2, SKbs-cs}, FSj saves the message into its own database. The fog server registration process is shown in Figure 2 Figure 2. Fog server registration phase 4.4. Login and Authentication Phase In this phase, if user wants to access fog servers via public channel, cloud server can help user and fog server to authenticate each other and agree on session key. The steps are demonstrated as follows; the detailed process is shown in Figure 3. 1) User inserts his SC into card reader and inputs his identity IDi, password PWi, and biometrics BMi, SC retrieves * *ω =Rep(BM ,θ )i i i and calculates * * *RPW h(PW || ) i i i , * ' *SK SK h(RPW ) uc-cs uc-cs i , * * * *C h(ID || RPW || SK )i i i uc-cs . SC verifies whether ? *C = Ci i holds or not. If the verification holds, it indicates that the user is legitimate holder of SC. The SC then generates a random number ru and current timestamp T1 to calculate *B =E h(ID ||RPW )i i i i , 1h(ID ||SK ||T )1 u i uc-csF = r , *=BID h( ||B )2 j u iF r , * 1=h(BID ||SK ||B || ||T )3 j uc-cs i uF r . Finally, SC sends {TIDi, F1, F2,F3,T1} to the cloud server CS via public channel. 2) After receiving message {TIDi, F1, F2,F3,T1}, CS first validates 2 1| T T | T  , where T2 is current time of CS receiving the message. If the validation holds, CS searches for {IDi,Bi,SKuc-cs} according to TIDi and calculates 1 1= h(ID ||SK ||T )* u i uc-csr F , j *BID = h( ||B ) * 2 u iF r , * j 1=h(BID ||SK ||B || ||T )* * 3 uc-cs i uF r . CS checks wehther ? =* 3 3F F , if the condition fails, CS rejects the session. Otherwise, cloud server CS authenticates the identity of the user Ui. Then, CS retrieves {rf,SKbs-cs} by BIDj and calculates = Pc uR r , j=h(BID || ||SK || )1 bs-cs fR y r , 25 1 2=h(ID || || ||T )i 1 cG R R , 2 SK 1 1G E (ID ,h (SK || ), ,G ) bs-cs i uc-cs u cr R , *TID =TID i i ur . CS replaces TIDi in its own database with *TIDi and sends {G2, T2} to FSj. 3) FSj receives the message from CS at time T3 and verifies 3| T T | T  2 . If the verification holds, FSj decrypts G2 by SKbs-cs to obtain {IDi, h1(SKuc-cs||ru), Rc, G1}, and computes * 1G  1 2h(ID || R || || T )i cR . FSj checks whether ? * 1 1G = G or not. If equal, fog server FSj authenticates the cloud server CS. Then, FSj generates a random number rj and computes 1 ub=h (SK || ) P =(M ,M )1 uc-cs u x yM r , P = Pf jr , = j cACK r R , =h( ||ID ||BID )i jSK ACK , 3=h( ||P ||M ||T )j f xN SK . Now, FSj sends the message {Pf, Nj, T3} to Ui. 4) Ui receives the message and checks the freshness of the message by verifying 4 3| T T | T  . If the verification holds, Ui computes * * * 1 1 ubM =h (SK || ) P (M ,M ) uc-cs u x yr , *ACK = Pu fr , * *SK =h(ACK ||ID ||BID )i j , * * 3=h( ||P ||M ||T )* j f xN SK . Ui checks whether ? *N = Nj j or not. If equal, then user Ui authenticates fog server FSj and Ui saves the session key SK for future communication. Finally, Ui calculates *TID =TID i i ur and replaces TIDi in the SC with *TIDi . Figure 3. Login and authentication phase 26 5. Security Analysis of the Improved Scheme 5.1. Providing User Anonymity In the login and authentication phase of the improved scheme, user does not send his identity directly on the public channel, but sends a pseudo-identity TIDi, the attacker cannot correspond to the user’s identity IDi through the intercepted pseudo- identity TIDi. Therefore, the improved scheme can provide user anonymity. 5.2. Resist Tracking Attack User hides his identity by sending a pseudo-identity TIDi and the user’s pseudo- identity TIDi is updated by *TID =TID i i ur at the end of each session. Since *TID =TID i i ur contains a random number ru, user’s pseudo-identity is different each time. Therefore, an attacker cannot correspond to the user’s identity through the intercepted pseudo-identity TIDi. Furthermore, the request message {TIDi, F1, F2, F3, T1} sent by the user Ui contains a random number ru or a timestamp T1 in F1, F2, F3. Therefore, when the user Ui contacts the fog server again, the values of F1, F2, F3 will be different and the attacker will not be able to trace user through the request message. 5.3. Resist User Impersonation Attack If an attacker tries to impersonate user Ui to cheat the cloud server, then the attacker must construct a correct request message, but according to the analysis in 5.1, the attacker cannot know Ui’s pseudo-identity TIDi. Secondly, attacker also does not know user’s secret value Bi and SKuc-cs, so the attacker cannot construct a valid F3 to pass the authentication of the cloud server. Even if fog server FSj acts as an attacker, FSj can only obtain h1(SKuc-cs||ru) by finishing one authentication, and h1(SKuc-cs||ru) is different for each session. Therefore, FSj is also unable to calculate valid F1, F2, F3 without knowing Bi and SKuc-cs. So, the improved scheme can resist user impersonation attack. 5.4. Resist Replay Attacks An attacker may attempt to perform replay attack by resending an intercepted message to the cloud server after a period of time. However, the improved scheme uses timestamp verification and the past message contains a timestamp that is not in the acceptable range, so resending the past message will result in session termination. Even though the attacker can modify timestamp T1, the attacker does not know Bi and SKuc-cs, then the corresponding F1, F2 and F3 cannot be modified according to the new timestamp. Therefore, the value of F3 sent by the attacker is different from F3 calculated by the cloud server CS and the verification cannot pass. Therefore, the improved scheme is resistant to replay attack. 6. Comparison of the Improved Scheme In this section, the improved scheme is compared with Sahoo et al.’s scheme [16] and two other schemes [11][17] in terms of security features and computational cost. In order to achieve reliable and straightforward evaluation, Table 3 shows the symbols and execution times required for various operations, and these enable us to accurately compare the improved scheme with three similar direction schemes in the computational costs. The comparison results about safety features and computational costs are shown in Tables 2 and 4, respectively. Table 2. Comparison of safety features Schemes F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 Chen et al.’s scheme × √ √ √ √ √ √ √ × √ Ma et al.’s scheme [17] √ √ × × √ √ √ √ √ √ Sahoo et al.’s scheme[16] × √ × × √ √ √ √ √ √ improved scheme √ √ √ √ √ √ √ √ √ √ F1:user anonymity; F2: replay attacks; F3: user untrace ability; F4: impersonation attacks; F5: reach session key; F6: mutual authentication; F7: offline password guessing attacks; F8: denial of service attacks; F9: perfect forward security; F10: man-in-the-middle attacks; Table 3. Symbols represented by various operations and approximately required time Symbols Description ≈Calculation time (ms) H Hash function 0.0023 X XOR operation 0.001 F Fuzzy extractor function 2.226 E Symmetric key encryption/decryption 0.0046 P ECC point multiplication 2.226 27 Table 4. Comparison of calculation costs scheme P1 P2 P3 P4 Chen et al.’s scheme 8H+4X+F 2H+F 22H+24X+5P 32H+28X+5P+2F Ma et al.’s scheme [17] 2H+3P ---- 17H+4X+15P 19H+4X+18P Sahoo et al.’s scheme[16] 8H+4X+F 2H+X+F 14H+8X+2E+6P 24H+13X+2F+2E+6P improved scheme 8H+3X+F 3H+X+F 13H+7x+2E+5P 24H+11X+2F+2E+5P P1: registration phase; P2: login phase; P3: authentication and key agreement phase; P4: total computational cost; From table 2, it is shown that the security of the improved scheme is better than Sahoo et al.’s scheme [16] and other schemes [11][17] and the improved scheme can resist various known attacks. From table 4, the total computational cost of Sahoo et al.’s scheme [16], Chen et al.’s scheme [11], Ma et al.’s scheme [17] and the improved scheme are 17.8854, 15.6836, 40.1157, 15.6574, respectively. The computational cost of the improved scheme is lower than the other three schemes. 7. Conclusion In this paper, we analyse Sahoo et al.’s scheme and find that many areas of their scheme are not clearly explained in the data distribution phase and it also cannot resist user impersonation attack, tracking attack, denial of service attack and replay attack. In order to overcome the shortcomings of Sahoo et al.’s scheme, this paper makes full use of random numbers and timestamps to propose an improved scheme, we compare the improved scheme with existing similar schemes in terms of security features and computational cost and result shows that the improved scheme has higher security, can resist various known attacks and has lightweight features with lower computational cost. The improved scheme is therefore more suitable for applications in fog computing environments. References [1] Yang Xiaodong, An Faying, Yang Ping, et al. Cross-domain identity authentication scheme based on proxy re-signature in cloud environment [J]. Journal of Computers,2019,42(4):756- 771. (in Chinese) [2] M. Wazid, A.K. Das, N. Kumar, A.V. Vasilakos. Design of secure key management and user authentication scheme for fog computing services[J], Future Generation Computer Systems, 2019, 91:475-492. [3] Alrawais A, Alhothaily A, Hu CQ, Cheng XZ. Fog computing for the Internet of Things: Security and privacy issues[J], IEEE Internet Computing, 2017, 21(2): 34–42. [4] Jia X, He D, Kumar N, et al. Authenticated key agreement scheme for fog-driven IoT healthcare system[J]. Wireless Networks, 2019, 25(8): 4737-4750. [5] L. Lamport, Password authentication with insecure communication [J], Communications of the ACM, 1981, 24 (11): 770–772. [6] Hwang M S, Li L H. A new remote user authentication scheme using smartcards[J]. IEEE Transactions on Consumer Electronics, 2000, 46(1):28-30. [7] Juang w S, Efficient multi-Server password authenticated key agreement using smart cards[J]. IEEE Transactions on Consumer Electronics,2004,50(4):251-255. [8] DAS,LAL M. Two-factor user authentication in wireless sensor networks [J]. IEEE Transactions on Wireless Communications, 2009,8(3):1086-1090. [9] Xue K, Ma C,Hong P, et al. A temporal-credential-based mutual authenticationand key agreement scheme for wireless sensor networks[J]. Journal of Network and Computer Applications, 2013, 36(1):316-323. [10] Wu T Y, Yang L, Meng Q, et al. Fog-driven secure authentication and key exchange scheme for wearable health monitoring system[J]. Security and Communication Networks, 2021, 2021: 1-14. [11] Chen, C.M.; Huang, Y.; Wang, K.H.; Kumari, S.; Wu, M.E.A secure authenticated and key exchange scheme for fog computing[J]. Enterprise Information Systems, 2020;15(1):1- 16. [12] Rana M, Mahmood K, Saleem M A, et al. Towards a Provably Secure Authentication Protocol for Fog-Driven IoT-Based Systems[J]. Applied Sciences, 2023, 13(3): 1424. [13] Guo Yimin, Zhang Zhenfeng, Xiong Ping, et al. Lightweight fog assisted iot Authentication Protocol based on PUF [J]. Chinese Journal of Computers,2022,45(7):1412-1430. (in Chinese). [14] Minahil Rana, Khalid Mahmood, Muhammad Asad Saleem, et al. Towards a Provably Secure Authentication Protocol for Fog-Driven IoT-Based Systems[J]. applied sciences,2023, 13(3):1424 [15] Yijian Lin, Xiaoming Wang, Qingqing Gan, and Mengting Yao. A secure cross-domain authentication scheme with perfect forward security and complete anonymity in fog computing[J]. Journal of Information Security and Applications, 2021; 63 (9): 103022. [16] Sahoo S S, Mohanty S , Majhi B. An efficient three-factor user authentication scheme for industrial wireless sensor network with fog computing[J]. International journal of communication systems, 2022(3):35. [17] Ma Mimi, He Debiao, Wang Huaqun, Kumar Neeraj, Choo Kim-Kwang Raymond. An efficient and provably secure authenticated key agreement protocol for fog-based vehicular ad-hoc networks[J]. IEEE Internet Things, 2019;6(5):8065– 8075.