# Energy Efficient Dynamic Symmetric Key Based Protocol for Secure Traffic Exchanges in Smart Homes
## 3 The Proposed Scheme
### Mutual Authentication
At the same time, P\({}_{\text{TA}}\) = h (\(\mathbb{Q}_{\text{U}}\)New\(||\mathbb{T}_{\text{M}}||\mathbb{N}_{4}||\mathbb{N}_{4}||\mathbb{N}_{4}||\mathbb{N}_{4}|| \mathbb{N}_{4}||\mathbb{N}_{4}||\mathbb{N}_{4}||\mathbb{N}_{4}||\mathbb{N}_{4}||\))  
Figure 4: Mutual authentication message flows. is re-calculated, and additional security token \(\text{B}=\mathbb{Q}_{\text{U}}\text{New}\oplus\text{ID}_{\text{M}}\) is derived. This step is very crucial for the preservation of backward and forward key secrecy. Here, an attacker that has captured \(\mathbb{P}_{\text{TA}}\) and \(\mathbb{Q}_{\text{U}}\) deployed in the current authentication session may attempt to reuse them to determine the previous as well as the subsequent session secret keys \(\{\mathbb{P}_{\text{TA}}\text{Prev},\,\mathbb{Q}_{\text{U}}\text{Prev}\}\) and \(\{\mathbb{P}_{\text{TA}}\text{Next},\,\mathbb{Q}_{\text{U}}\text{Next}\}\) respectively. However, updating these session secret keys incorporates random nonce \(\mathbb{N}_{5}\), rendering them session-specific. Lastly, MD's authentication response \(MAuth_{\text{Res}}\), security parameters \(\text{B}\) and \(\mathbb{P}_{\text{TA}}\), together with timestamp \(\mathbb{T}_{6}\), are sent to the MD. Meanwhile, the TA updates its _Rep_ with these new security parameters \(\mathbb{P}_{\text{TA}}\text{New}\), \(\mathbb{Q}_{\text{U}}\text{New}\), \(\mathbb{N}_{5}\), and \(\mathbb{T}_{\text{M}}\text{New}\). **Step 8**: Upon receipt of these parameters, the MD re-derive \(\mathbb{N}_{4}=\mathbb{R}_{\text{U}}\oplus\text{ID}_{\text{M}}\) before decrypting \(\mathbb{Q}_{\text{U}}=D_{\text{U}}\) (\(ID_{\text{U}}\), \(\text{ID}_{\text{M}}\), \(\mathbb{P}_{\text{TA}}\),\(\mathbb{T}_{\text{M}}\)) to obtain its constituents which are then verified against their buffered counterparts in _Rep_. Provided that this verification is successful, the MD determines \(\mathbb{T}_{7}\) that is employed to derive \(\Delta\Gamma=\mathbb{T}_{7}-\mathbb{T}_{6}\) that is then validated against replay attacks. Next, \(\mathbb{Q}_{\text{U}}\text{New}=\mathbb{B}\oplus\text{ID}_{\text{M}}\) is re-computed for subsequent authentication. **Step 9**: The \(\mathbb{P}_{\text{TA}}\) received from TA is verified such that if this process is successful, the MD and TA have mutually authenticated each other and can trust each other. However, if all the retrieved parameters are in _Rep_ except MD's \(\text{ID}_{\text{M}}\), the implication is that the SHO may be utilizing an MD that is yet to be registered at the TA, and hence its registration is prompted. As shown in Figure 3, 4 messages are exchanged during the AKA phase. All the parameters in message \(\{\text{P}_{\text{U}},\mathbb{Q}_{\text{U}},\,\mathbb{R}_{\text{U}},\,\mathbb{T }_{1}\}\) are sufficiently protected before their transmission over the communication links. For instance, \(\text{P}_{\text{U}}\) is in the hashed format while \(\mathbb{Q}_{\text{U}}\) is in encrypted form using \(\psi\). On the other hand, \(\mathbb{R}_{\text{U}}\) is exposed to XOR operation with nonce \(\mathbb{N}_{4}\) and hence is fairly random. Similarly, message \(\{\text{P}_{\text{S}},\,\mathbb{T}_{3}\}\) is protected since \(\text{P}_{\text{S}}\) is in hashed form and timestamp \(\mathbb{T}_{3}\) is randomly selected. The same applies to message \(\{\text{P}_{\text{T}},\,\mathbb{T}_{5}\}\) sent to TA from SHD. Finally, in message \(\{\text{B},\,\mathbb{P}_{\text{TA}},\mathbb{T}_{6}\}\) sent from the TA to MD is protected through hashing (\(\mathbb{P}_{\text{TA}}\)) and XOR operation (B), while timestamp \(\mathbb{T}_{6}\) is randomly chosen.