# An Enhanced Lightweight IoT-based Authentication Scheme in Cloud Computing Circumstances
## 2 Review and Security Analysis of [PERSON]'s Scheme
### Authentication Phase  
This phase is divided in the following steps and the details are shown in Figure 1:  
Step 1: This step is invoked by \(U_{i}\), when she/he wants to get access to the service offered by \(S_{j}\). \(U_{i}\) inserts his/her smart card and keys his/her \(ID_{i}\) and \(PW_{i}\). Then, the smart card generates a random number \(\left(r_{U}\right)\) and new pseudo-identity \(\left(PID_{i}^{new}\right)\). After that, \(U_{i}\) computes \(b_{i}=C_{3}\oplus h(ID_{i}\parallel PW_{i})\)\(HP_{i}=h(PW_{i}\parallel b_{i})\), \(C_{1}^{*}=C_{1}\oplus HP_{i}\), \(C_{2}^{*}=C_{2}\oplus h(ID_{i}\parallel HP_{i})\), \(D_{1}=C_{1}^{*}\oplus ru\), \(D_{2}=h(PID_{i}\parallel ID_{CS}\parallel ru)\oplus ID_{i}\), \(D_{3}=C_{2}^{*}\oplus h(ID_{i}\parallel HP_{i})\oplus PID^{new}\oplus h(r_{U }\parallel ID_{i})\), and \(D_{4}=h\big{(}ID_{i}\parallel PID_{i}\parallel PID_{i}^{new}\parallel ru \parallel D_{3}\big{)}\). Then, \(U_{i}\) sends the authentication request message \(M_{5}=\{PID_{i},\ D_{1},\ D_{2},\ D_{3},D_{4}\}\) to \(S_{j}\) through an open communication channel. Step 2: This step is invoked by \(S_{j}\). After receiving the authentication request message \(M_{5}\), \(S_{j}\) selects a new pseudo-identity \(\Big{(}PSID_{j}^{new}\Big{)}\) and a random number \((r_{S})\). Then, \(S_{j}\) computes \(D_{5}=B_{1}\oplus r_{S}\), \(D_{6}=h\Big{(}r_{S}\parallel PSD_{j}\parallel ID_{CS}\big{)}\oplus SID_{j}\), \(D_{7}=B_{2}\oplus PSID_{j}^{new}\oplus h\Big{(}r_{S}\parallel SID_{j}\Big{)}\), and \(D_{8}=h\Big{(}SID_{j}\parallel PSID_{j}\parallel PSD_{j}^{new}\parallel r_{S }\parallel D_{7}\Big{)}\). Finally, \(S_{j}\) sends the authentication request message \(M_{6}=\big{\{}PID_{i},\ D_{1},\ D_{2},\ D_{3},\ D_{4},\ PISID_{j},\ D_{5},\ D_{6},\ D_{7},\ D_{8}\big{\}}\) to \(CS\) through an open communication channel. Step 3: This step is invoked by \(CS\). Upon receiving the authentication request message \(M_{6}\), \(CS\) computes \(r_{U}=D_{1}\oplus h(PID_{i}\parallel ID_{CS}\parallel x)\), \(ID_{i}=D_{2}\oplus h(r_{U}\parallel PID_{i}\parallel ID_{CS})\), and \(PID_{i}^{new}=D_{3}\oplus h(ID_{i}\parallel x)\oplus h(r_{U}\parallel ID_{i})\). Then, \(CS\) checks if \(ID_{i}\) and \(D_{4}\) are valid or not. If the verification process fails, \(CS\) closes the communication. On the other hand, \(CS\) computes \(r_{S}=D_{5}\oplus h\big{(}PSID_{j}\parallel ID_{CS}\parallel x\big{)}\), \(SID_{j}=D_{6}\oplus h\big{(}r_{S}\parallel PSD_{j}\parallel ID_{CS}\big{)}\), and \(PSID_{j}^{new}=D_{7}\oplus h\big{(}SID_{j}\parallel x\big{)}\oplus h\big{(}r _{S}\parallel SID_{j}\big{)}\). Next, \(CS\) checks if \(SID_{j}\) and \(D_{8}\) are valid or not. If the verification process fails, \(CS\) closes the communication. On the other hand, \(CS\) selects a random number \((r_{CS})\) and computes the session key \(SK_{CS}=h(r_{U}\oplus r_{S}\oplus r_{SC})\). Later, \(CS\) computes \(D_{9}=h\Big{(}PSID_{j}^{new}\parallel ID_{CS}\parallel x\big{)}\oplus h\big{(} r_{U}\parallel ID_{CS}\parallel x\big{)}\), and \(PSID_{j}^{new}=D  
\(r_{U}=D_{1}\oplus h(PID_{i}\parallel ID_{CS}\parallel x)\), \(ID_{i}=D_{2}\oplus h(r_{U}\parallel PID_{i}\parallel ID_{CS})\), and \(PID_{i}^{new}=D_{3}\oplus h(ID_{i}\parallel x)\oplus h(r_{U}\parallel ID_{i})\). Step 4: After \(CS\) verifies the authenticity of \(ID_{i}\) and \(D_{4}\), \(CS\) computes and sends \(D_{12}=h(PID_{i}^{new}\parallel ID_{CS}\parallel x)\oplus h(r_{U}\parallel PID _{i}^{new})\), \(D_{13}=h(PID_{i}^{new}\parallel r_{U}\parallel PID_{i})\oplus(r_{S}\oplus r_{ SC})\), and \(D_{14}=h(SK_{CS}\parallel D_{12}\parallel D_{13}\parallel h(ID_{i}\parallel x))\). Step 5: Upon receiving the authentication response message \(M_{8}\), the attacker computes \((r_{S}\oplus r_{SC})=D_{13}\oplus h\big{(}PID_{i}^{new}\parallel r_{U} \parallel PID_{i}\big{)}\) and \(SK_{U}=h(r_{U}\oplus r_{S}\oplus r_{CS})\). As a consequence, the attacker can launch the replay attack successfully.