## 3 Proposed Extended Chaotic-Map-Based User-Authentication and Key-Agreement Scheme
### PHI Access Phase  
Figure 4 illustrates the processes of the \(PHI\) access phase of the proposed scheme, which are described as follows. Figure 4: The processes of PHI access phase of the proposed scheme. Step 1: Patient \([PERSON]\) inputs his/her ID and password and computes \(W_{P}=h(ID_{P}\|PW_{P})\); \(X_{P}=Y_{P}\oplus W_{P}\), selects \(R_{P}\), a timestamp \(TS_{1}\), computes \(T_{a}(x)mod\ p,P_{P}=h(W_{P}\|ID_{P}\|ID_{D}\|T_{a}(x))\), \(Cer_{P}=h(T_{r_{P}}(T_{r_{MCS}}(x)mod\ p)\|TS_{1})\), \(C_{P}=Cer_{P}\oplus R_{P}\), \(V_{1}=h(X_{P}\|P_{P}\|Cer_{P}\|R_{P})\), \(SK_{PD}=h(T_{a}(T_{r_{D}}(x)mod\ p))\), \(NID_{PD}=ID_{P}\oplus SK_{PD}\), and sends \(\{NID_{PD},NID_{P},V_{1},V_{2},C_{P},T_{a}(x)\), \(TS_{1}\}\) to the hospital. Step 2: After receiving the messages from \(Pat\), the doctor \(Doc\) checks the timestamp \(TS_{1}\leqq\Delta T\) and computes \(SK_{PD}=h(T_{r_{D}}(T_{a}(x)mod\ p))\), \(ID_{P}=NID_{PD}\oplus SK_{PD}\), \(Cer_{PD}=h(T_{r_{D}}(T_{r_{P}}(x)mod\ p)\|TS_{1})\) and \(V_{2}^{\prime}=h(ID_{P}\|Cer_{PD})\). If \(V_{2}^{\prime}=V_{2}\) does not hold, then \(Doc\) rejects this request; otherwise, \(Doc\) successfully authenticates \(Pat\), selects random numbers \(R_{D},\ b\) and timestamp \(TS_{2}\), and computes \(T_{b}(x)mod\ p\), encrypted session key \(SK_{DMCS}=h(T_{b}(T_{r_{MCS}}(x)mod\ p))\), temporal identity \(NID_{D}=E_{SK_{DMCS}}(ID_{D}\|IND_{PHI})\), \(Cer_{D}=h(T_{r_{D}}(T_{r_{MCS}}(x)mod\ p)\|TS_{2})\) and \(V_{3}=h(ID_{D}\|Cer_{D}\|RD_{D}\|IND_{PHI})\), where \(IND_{PHI}\) is the medical-record number that \(Doc\) requires. Then, \(Doc\) sends \(\{NID_{D},NID_{P},V_{1},V_{3},C_{P},\)\(T_{a}(x),T_{b}(x),TS_{1},TS_{2}\}\) to \(MCS\). Step 3: On receiving the messages from \(Doc\), \(MCS\) checks the timestamp \(TS_{2}\leqq\Delta T\), and computes \(SK_{DMCS}=h(T_{r_{MCS}}(T_{b}(x)mod\ p))\) by using \(r_{MCS}\), \((ID_{D}\|RD_{D}\|IND_{PHI})=D_{SK_{DMCS}}(NID_{D})\), \(Cer_{D}=h(T_{r_{MCS}}(T_{r_{D}}(x)mod\ p)\|TS_{2})\) and \(V_{3}=h(ID_{D}\|Cer_{D}\|RD_{D}\|IND_{PHI})\). If \(V_{3}^{\prime}=V_{3}\) does not hold, then \(MCS\) rejects this service request; otherwise, \(MCS\) successfully authenticates \(Doc\) and computes \((ID_{P}\|W_{P}\|IR_{MCS}\|w)=D_{r_{MCS}}(NID_{P})\), \(Cer_{P}=h(T_{r_{P}}(T_{r_{MCS}}(x)mod\ p)\|TS_{1})\), \(R_{P}=C_{P}\oplus Cer_{P}\), \(P_{P}^{\prime}=h(W_{P}\|ID_{P}\|ID_{D}\|T_{a}(x))\), \(X_{P}^{\prime}=h(ID_{P}\|R_{MCS})\) and \(V_{1}^{\prime}=h(X_{P}^{\prime}\|P_{P}^{\prime}\|Cer_{P}\|R_{P})\). If \(V_{1}^{\prime}=V_{1}\) holds, then \(MCS\) successfully authenticates \(Pat\), and stores \(PHI\) in its database by using \(IND_{PHI}\). Then, \(MCS\) chooses \(R_{new},\ c\) and computes \(T_{c}(x)\), \(SK_{D}=h(T_{c}(T_{b}(x)mod\ p))\), \(D_{PHI}=E_{SK_{D}}(PHI)\), \(V_{4}=h(ID_{D}\|SK_{D}\|RD_{D}\|IND_{PHI}\|h(PHI))\), \(SK_{MCSP}=h(T_{c}(T_{a}(x)mod\ p))\), a new temporal identity \(NID_{P}^{new}=E_{r_{MCS}}(ID_{P}\|W_{P}\|R_{new}\|w)\), \(X_{P}^{new}=h(ID_{P}\|R_{new})\), \(QID_{P}=E_{SK_{MCSP}}(NID_{P}^{new}\|X_{P}^{new})\) and \(V_{5}=h(NID_{P}^{new}\|ID_{P}\|SK_{MCSP}\|R_{P}\|X_{P}^{new})\). Then \(MCS\) sends \(\{QID_{P},V_{4},V_{5},D_{PHI},T_{c}(x)\}\) to \(Doc\). Step 4: On receiving \(\{QID_{P},V_{4},V_{5},T_{c}(x)\}\) from \(MCS\), \(Doc\) computes \(SK_{D}=h(T_{b}(T_{c}(x)mod\ p)),PHI=D_{SK_{D}}(D_{PHI})\), \(V_{4}^{\prime}=h(ID_{D}\|SK_{D}\|R_{D}\|IND_{PHI}\|h(PHI))\) and checks whether \(V_{4}^{\prime}=V_{4}\) holds or not. If unsuccessful, [PERSON] aborts this session. Otherwise, \(Doc\) sends \(\{QID_{P},V_{5},T_{c}(x)\}\) to \(Pat\). Step 5: On receiving \(\{QID_{P},V_{5},T_{c}(x)\}\) from \(Doc\), \(Pat\) computes \(SK_{MCSP}=h(T_{a}(T_{c}(x)mod\ p))\) and decrypts \(QID_{P}\) with \(SK_{MCSP}\) and obtains \((NID_{P}^{new}\|X_{P}^{new})\). Then, \([PERSON]\) computes \(V_{5}^{\prime}=h(NID_{P}^{new}\|ID_{P}\|SK_{MCSP}\|R_{P}\|X_{P}^{new})\) and checks whether \(V_{5}^{\prime}=V_{5}\) holds or not. If unsuccessful, \(Pat\) aborts this request.