## 3 The Proposed Scheme
### Authentication Phase  
In this phase, access parties (AP) need to be authenticated by the SCC. The AP means any party who wants to access the information of the SCC, for example, the client (C), the IoT main controller ([PERSON]), and security guard (SG). After the verification, the party will get a token and the AP will use the token to access the information of the SCC. Figure 5 is the flowchart of the authentication phase.  
Figure 4: The mechanism in the communication phase.  
Step 1. The \(AP\) selects a random number \(r_{1}\), and computes the following parameter:  
\[R_{AP_{1}}=g^{\gamma_{1}}\text{mod}p \tag{1}\]  
\(AP\) computes the access message:  
\[M_{Access}=(ID_{AP}||Pwd_{AP}||Seq_{i}) \tag{2}\]  
\(AP\) uses the hash function to compute the parameter \(h_{AP_{1}}\):  
\[h_{AP_{1}}=H(R_{AP_{1}}\cdot Puk_{AP}{}^{(M_{Access}+Prk_{AP})}||H(M_{Access})) \tag{3}\]  
and uses its private key \(Prk_{AP}\) and \(M_{Access}\) to compute the signatures as follows:  
\[Sig_{AP_{1}}=1-r_{1}{}^{-1}\cdot Prk_{AP}\cdot H(M_{Access})\text{mod}p \tag{4}\]  
\[Sig_{AP_{2}}=M_{Access}+Prk_{AP}\text{mod}p \tag{5}\]  
After that, \(AP\) uses the \(SCC\)'s public key \(Puk_{SCC}\) to encrypt the message into a ciphertext \(C_{AP_{1}}\):  
\[C_{AP_{1}}=E_{Puk_{SCC}}(T_{1}||R_{AP_{1}}||h_{AP_{1}}||Sig_{AP_{1}}||Sig_{AP_{ 2}}||M_{Access}||H(M_{Access})) \tag{6}\]  
Figure 5: The flowchart of the authentication phase.  
Then, AP sends the \((ID_{AP},C_{AP_{1}})\) to \(SCC\).  
Step 2. Once the \(SCC\) receives the \(AP\)'s \(ID\) and cipher message \(C_{AP_{1}}\) at \(T_{2}\), \(SCC\) uses the private key \(Prk_{SCC}\) to decrypt the message:  
\[(T_{1}||R_{AP_{1}}||h_{AP_{1}}||Sig_{AP_{1}}||Sig_{AP_{2}}||M_{Access}||H(M_{ Access}))=D_{Prk_{SCC}}(C_{AP_{1}}) \tag{7}\]  
Then, \(SCC\) checks the validity of the timestamp:  
\[(T_{2}-T_{1})\stackrel{{?}}{{\leq}}\tau \tag{8}\]  
If the timestamp interval is valid, then \(SCC\) needs to verify \(AP\)'s hash parameter:  
\[h_{AP_{1}}\stackrel{{?}}{{=}}H(R_{AP_{1}}^{Sig_{AP_{1}}}\cdot Puk _{AP}{}^{H(M_{Access})+Sig_{AP_{2}}}||H(M_{Access})) \tag{9}\]  
If Equation (9) holds, the \(SCC\) selects a random number \(r_{2}\), computes the following parameters:  
\[R_{SCC_{1}}=g^{r_{2}}\text{mod}p \tag{10}\]  
\(SCC\) uses the hash function to compute the parameter \(h_{SCC_{1}}\):  
\[h_{SCC_{1}}=H(R_{SCC_{1}}^{r_{2}}\cdot Puk_{SCC}(^{ID_{SCC}+Prk_{SCC}})) \tag{11}\]  
\(SCC\) uses its private key \(Prk_{SCC}\) and \(ID_{SCC}\) to compute the signatures as follows:  
\[Sig_{SCC_{1}}=1-r_{2}{}^{-1}\cdot Prk_{SCC}\text{mod}p \tag{12}\]  
\[Sig_{SCC_{2}}=ID_{SCC}+Prk_{SCC}\text{mod}p \tag{13}\]  
\(SCC\) generates \(Token_{1}\), then \(SCC\) uses the \(AP\)'s public key \(Puk_{AP}\) to encrypt the message into cipher message \(C_{SCC_{1}}\):  
\[C_{SCC_{1}}=E_{Puk_{AP}}(ID_{SCC}||R_{SCC_{1}}||h_{SCC_{1}}||Sig_{SCC_{1}}|| Sig_{SCC_{2}}||Token_{1}||T_{3}||Seq_{i+1}) \tag{14}\]  
Then, \(SCC\) sends the cipher message to \(AP\).  
Step 3. The \(AP\) receives the \(SCC\)'s \(ID_{AP}\) and cipher message \(C_{SCC_{1}}\) at \(T_{4}\), \(AP\) uses its private key \(Prk_{AP}\) to decrypt the messages:  
\[(ID_{SCC}||R_{SCC_{1}}||h_{SCC_{1}}||Sig_{SCC_{1}}||Sig_{SCC_{2}}||Token_{1 }||T_{3})=D_{Puk_{AP}}(C_{SCC_{1}}) \tag{15}\]  
Then, \(AP\) checks the validity of the timestamp:  
\[(T_{4}-T_{3})\stackrel{{?}}{{\leq}}\tau \tag{16}\]  
If the timestamp interval is valid, then \(AP\) needs to verify \(SCC\)'s hash parameter:  
\[h_{SCC_{1}}\stackrel{{?}}{{=}}H(R_{SCC_{1}}^{Sig_{SCC_{1}}}\cdot Puk _{AP}{}^{ID_{SCC}+Sig_{SCC_{2}}}) \tag{17}\]  
If it is valid, \(AP\) gets the \(Token_{1}\) that can access the information of \(SCC\) in other phases.  
In the authentication phase, when any parties need to access the information of \(SCC\), they must send their identity authentication \(Token_{1}\) to the \(SCC\) before communication.