# Energy Efficient Dynamic Symmetric Key Based Protocol for Secure Traffic Exchanges in Smart Homes
## 3 The Proposed Scheme
### Mutual Authentication  
Whenever the SHO wishes to access the SHDs services, the following nine steps are invoked, as discussed below. **Step 1**: The MD generates nonce \(\mathbb{N}_{4}\) before computing security parameter \(\mathbb{R}_{\text{U}}=\mathbb{N}_{4}\oplus ID_{\text{M}}\) and MD's authentication verification beacon \(\text{P}_{\text{U}}=\text{h}\) (\(\mathbb{Q}_{\text{U}}||\mathbb{R}_{\text{U}}||\mathbb{N}_{1}||\mathbb{N}_{4}|| \mathbb{T}_{\text{M}}\)). Next, the computed parameters, together with timestamp \(\text{T}_{1}\) and buffered token \(\mathbb{Q}_{\text{U}}\), are transmitted to the TA together with the MD authentication request, \(MAuth_{Req}\), as evidenced in Figure 4.  
Figure 3: Registration message flows. **Step 2:** On getting these parameters, the TA determines timestamp T\({}_{2}\) and computes \(\Delta\)T = T\({}_{2}\)-T\({}_{1}\) before validating it against some set threshold T\({}_{\text{Th}}\). This step is critical for the prevention of packet replay attacks. If an attacker launches this attack against the proposed protocol using the captured security parameters, the freshness checks of timestamps together with threshold T\({}_{\text{Th}}\) will render this attack futile. **Step 3:** The TA re-computes nonce \(\mathbb{N}_{4}\) = \(\mathbb{R}_{\text{U}}\oplus\) ID\({}_{\text{M}}\) before \(\mathbb{Q}_{\text{U}}\)= D\({}_{\text{U}}\) (_ID\({}_{\text{M}}\)_, ID\({}_{\text{M}}\)_, \(\mathbb{P}_{\text{TA}}\)_, S) is decrypted using \(\psi\) to yield its constituents that are then validated against their buffered equivalents in _Rep_. Here, provided that ID\({}_{\text{M}}\) is not in _Rep_, the request is flagged as an impersonation attempt. Next, TA checks whether T\({}_{\text{M}}\) is within its _Rep_, and if this is the case, it proceeds to retrieve nonce \(\mathbb{N}_{4}\) = \(\mathbb{R}_{\text{U}}\oplus\) ID\({}_{\text{M}}\) before validating the received P\({}_{\text{U}}\) against its buffered value. **Step 4:** To usher in SHD authentication with TA, the verification of P\({}_{\text{U}}\) must be successful.When this happens, SHD's authentication verification beacon P\({}_{\text{S}}\) = h (\(\mathbb{Z}_{\text{S}}||\mathbb{T}_{\text{S}}||\)ID\({}_{\text{TA}}\)) is derived and transmitted to the SHD with TA's authentication request, \(TAull_{Rep}\). **Step 5:** Upon receipt of this beacon, SHD determine the current timestamp T\({}_{4}\) before calculating \(\Delta\)T = T\({}_{4}\)-T\({}_{3}\), which is then validated. Provided that this validation is successful, P\({}^{*}\)= h (\(\mathbb{Z}_{\text{S}}||\mathbb{T}_{\text{S}}||\)ID\({}_{\text{TA}}\)) is re-computed, after which it is validated against its received counterpart P\({}_{\text{S}}\). Here, successful verification leads to the computation of another authentication verification beacon P\({}_{\text{T}}\)= h (\(\mathbb{Z}_{\text{S}}||\mathbb{T}_{\text{S}}||\)ID\({}_{\text{TA}}\)) sent to TA together with timestamp T\({}_{5}\) and TA's authentication response \(TAuth_{Res}\). **Step 6:** After getting these parameters, P\({}^{*}\)T = h (\(\mathbb{Z}_{\text{S}}||\mathbb{T}_{\text{S}}||\)ID\({}_{\text{TA}}\)) is re-calculated before its validation against its received counterpart P\({}_{\text{T}}\). If this verification succeeds, SHD and TA mutual authentication is successful, and they can now trust each other. Next, the deployed parameter T\({}_{\text{M}}\) is refreshed as T\({}_{\text{M}}\)New and buffered to preserve perfect forward key secrecy. **Step 7:** To accomplish TA and MD mutual authentication, TA generates nonce \(\mathbb{N}_{5}\) before refreshing previous parameters with their new values \(\mathbb{P}_{\text{TA}}\)New = h (ID\({}_{\text{U}}||\)ID\({}_{\text{M}}||\mathbb{N}_{5}\)) and \(\mathbb{Q}_{\text{U}}\)New = E\({}_{\text{U}}\) (ID\({}_{\text{U}}\), ID\({}_{\text{M}}\), \(\mathbb{P}_{\text{TA}}\)New, \({}_{\text{TM}}\)New).