## 3 Proposed Extended Chaotic-Map-Based User-Authentication and Key-Agreement Scheme
### PHI Uploading Phase  
Figure 3 illustrates the processes of the _PHI_ uploading phase of the proposed scheme, which are described as follows. Step 1: Patient _[PERSON]_ inputs his/her identity \(ID_{P}\) and password \(PW_{P}\) and computes \(W_{P}=h(ID_{P}\|PW_{P})\); \(X_{P}=Y_{P}\oplus W_{P}\), selects random numbers \(R_{P}\) and \(a\), 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_{rp}(T_{r_{\text{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}\), \(Cer_{PD}=h(T_{rp}(T_{r_{D}}(x)mod\ p)\|TS_{1})\), \(V_{2}=h(ID_{P}\|Cer_{PD})\) and sends \(\{NID_{PD},NID_{P},V_{1},V_{2},C_{P},T_{a}(x),TS_{1}\}\) to the hospital. Figure 2: The processes of registration phase of the proposed scheme. Step 2: After receiving the messages from \(Pat\), the doctor \(Doc\) checks the timestamp \(TS_{1}\leq\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_{D}}(x)mod\ p))\|TS_{1})\) and \(V^{\prime}_{2}=h(ID_{P}\|Cer_{PD})\). If \(V^{\prime}_{2}=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)\), encrypted session key \(SK_{DMCS}=h(T_{b}(T_{r_{MCS}}(x)mod\ p))\), temporal identity \(NID_{D}=E_{SK_{DMCS}}(ID_{D}\|R_{D})\), \(Cer_{D}=h(T_{r_{D}}(T_{r_{MCS}}(x)mod\ p)\|TS_{2})\), \(D_{PHI}=Cer_{D}\oplus PHI\) and \(V_{3}=h(ID_{D}\|Cer_{D}\|PHI\|_{D})\). Then, \(Doc\) sends \(\{NID_{D},NID_{P},V_{1},V_{3},C_{P},D_{PHI},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}\leq\Delta T\), and computes \(SK_{DMCS}=h(T_{r_{MCS}}(T_{b}(x)mod\ p))\), \((ID_{D}\|R_{D})=D_{SK_{DMCS}}(NID_{D})\), \(Cer_{D}=h(T_{r_{MCS}}(T_{r_{D}}(x)mod\ p)\|TS_{2})\), \(PHI=D_{PHI}\oplus Cer_{D}\), \(V_{3}=h(ID_{D}\|Cer_{D}\|PHI\|_{D})\). If \(V^{\prime}_{3}=V_{3}\) does not hold, then \(MCS\) rejects this service request; otherwise, \(MCS\) successfully authenticates the doctor \(Doc\), computes \((ID_{P}\|W_{P}\|R_{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^{\prime}_{p}=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 the patient \(Pat\), and stores \(PHI\) into its database. Then \(MCS\) chooses \(R_{new},~{}c\), and computes \(T_{c}(x)mod~{}p\), \(SK_{MCSP}=h(T_{c}(T_{a}(x)mod~{}p))\), a new temporal identity \(NID_{P}^{new}=E_{T_{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})\), \(V_{4}=h(ID_{D}\|R_{D})\) and \(V_{5}=h\big{(}NID_{P}^{new}\|ID_{P}\|SK_{MCSP}\|R_{P}\|X_{P}^{new}\big{)}\). Then \(MCS\) sends \(\{QID_{P},V_{4},V_{5},T_{c}(x)\}\) to \(Doc\). Step 4: On receiving \(\{QID_{P},V_{4},V_{5},T_{c}(x)\}\) from \(MCS\), \(Doc\) computes \(V_{4}^{\prime}=h(ID_{D}\|R_{D})\) and checks whether \(V_{4}^{\prime}=V_{4}\) holds or not. If unsuccessful, \(D\) 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\), \([PERSON]\) computes \(SK_{MCSP}=h(T_{a}(T_{c}(x)mod~{}p))\), decrypts \(QID_{P}\) with \(SK_{MCSP}\) and obtains \((NID_{P}^{new}\|X_{P}^{new})\). Then, \([PERSON]\) computes \(V_{5}^{\prime}=h\big{(}NID_{P}^{new}\|ID_{P}\|SK_{MCSP}\|R_{P}\|X_{P}^{new} \big{)}\) and checks whether \(V_{5}^{\prime}=V_{5}\) holds or not. If unsuccessful, \([PERSON]\) aborts this request. Otherwise, \([PERSON]\) computes \(Y_{P}^{new}=X_{P}^{new}\oplus W_{P}\) and replaces \(\{NID_{P},Y_{P}\}\) as \(\{NID_{P}^{new},Y_{P}^{new}\}\) in SC.