## 3 The Proposed Scheme
### Event-Trigger Phase  
In this phase, any IoT devices can send trigger signals to the \(IMC\) in the client's house. For example, the client installs some IoT devices (sensors) on doors and windows; when a thief enters the house silently and triggers the sensors, the sensors will send an event signal to the \(IMC\). The event initialization structure and scenarios are presented in Figures 6 and 7, respectively.  
Figure 6: Event initialization structure.  
Figure 7: The flowchart of the event-trigger phase.  
Step 2. The _IMC_ generates a unique event \(ID_{Event}\), to bind the event to record and trace the event status.  
Then, the _IMC_ selects a random number \(r_{3}\), and computes the following parameter:  
\[R_{IMC_{1}}=g^{r_{3}}\text{mod}p \tag{18}\]  
The triggered _IoT_'s _ID_ and _IMC_'s _ID_ is written to the event message with a timestamp \(T_{6}\):  
\[M_{Event_{1}}=(ID_{Event}||ID_{IMC}||ID_{IoT}||T_{5}||T_{6}||Seq_{i}) \tag{19}\]  
The _IMC_ uses the hash function to compute the parameter \(h_{CH_{1}}\):  
\[h_{IMC_{1}}=H(R_{IMC_{1}}{}^{r_{3}}\cdot Puk_{IMC}(M_{Event+Pk_{IMC}})||H(M_{ Event_{1}})) \tag{20}\]  
The _IMC_ uses its private key \(Prk_{IMC}\) and \(M_{Event_{1}}\) to compute the signatures as follows:  
\[Sig_{IMC_{1}}=1-r_{3}{}^{-1}\cdot Prk_{IMC}\cdot H(M_{Event_{1}})\text{mod}p \tag{21}\]  
\[Sig_{IMC_{2}}=M_{Event_{1}}+Prk_{IMC}\text{mod}p \tag{22}\]  
After that, _IMC_ uses the _SCC_'s public key \(Puk_{SCC}\) to encrypt the message into a ciphertext \(C_{CH_{1}}\):  
\[C_{IMC_{1}}=E_{Puk_{SCC}}(T_{6}||R_{IMC_{1}}||h_{IMC_{1}}||Sig_{IMC_{1}}||Sig_{IMC _{2}}||M_{Event_{1}}||H(M_{Event_{1}})) \tag{23}\]  
Then, _IMC_ sends \((ID_{IMC},ID_{IoT},C_{IMC_{1}})\) to _SCC_.  
Step 3. The _SCC_ receives the _IMC_'s _ID_, _IoT_'s _ID_ and cipher message \(C_{IMC_{1}}\) at \(T_{7}\), _SCC_ uses its private key \(Prk_{SCC}\) to decrypt the message:  
\[(T_{6}||R_{IMC_{1}}||h_{IMC_{1}}||Sig_{IMC_{1}}||Sig_{IMC_{2}}||M_{Event}||H(M_ {Event}))=D_{Prk_{SCC}}(C_{IMC_{1}}) \tag{24}\]  
Then, _SCC_ checks the validity of the timestamp:  
\[(T_{7}-T_{6})\overset{?}{\leq}\tau \tag{25}\]  
If the timestamp interval is valid, then _SCC_ needs to verify _IMC_'s hash parameter:  
\[h_{IMC_{1}}\overset{?}{=}H(R_{IMC_{1}}{}^{Sig_{IMC_{1}}}\cdot Puk_{IMC}{}^{H( M_{Event_{1}})+}{}^{Sig_{IMC_{2}}}||H(M_{Event_{1}})) \tag{26}\]  
If Equation (26) holds, _SCC_ will check the situation of the client's house via cameras and sensors; if there is an available incident in the client's house, the next step will be to search for a nearby _SG_ and construct the connection to send the event message to the selected _SG_.  
In the meanwhile, _SCC_ sends and chains \((R_{IMC_{1}},h_{IMC_{1}},Sig_{IMC_{1}},Sig_{IMC_{2}},M_{Event_{1}})\) to _BCC_.  
Step 4. Then, _SCC_ selects a random number \(r_{4}\), and computes the following parameter:  
\[R_{SCC_{2}}=g^{r_{4}}\text{mod}p \tag{27}\]  
The event's _ID_, _IMC_'s _ID_, and _SCC_'s staff _ID_ are written to the event message with a timestamp \(T_{7}\):  
\[M_{Event_{2}}=(ID_{Event}||ID_{IMC}||ID_{SCC}||T_{7}||Seq_{i+1}) \tag{28}\]  
_SCC_ uses the hash function to compute the parameter \(h_{SCC_{2}}\):  
\[h_{SCC_{2}}=H(R_{SCC_{2}}{}^{r_{4}}\cdot Puk_{SCC}(M_{Event_{2}}+Prk_{SCC}) ||H(M_{Event_{2}})) \tag{29}\]SCC uses its private key \(Prk_{SCC}\) and \(M_{Event_{2}}\) to compute the signatures as follows:  
\[Sig_{SCC_{3}}=1-r_{4}{}^{-1}\cdot Prk_{SCC}\cdot H(M_{Event_{2}})\text{mod}p \tag{30}\]  
\[Sig_{SCC_{4}}=M_{Event_{2}}+Prk_{SCC}\text{mod}p \tag{31}\]  
Then, \(SCC\) sends and chains \((R_{SCC_{2}},h_{SCC_{2}},Sig_{SCC_{3}},Sig_{SCC_{4}},M_{Event_{2}})\) to \(BCC\).