# A Lightweight Chaotic Map-Based Key Agreement Scheme for the Advanced Metering Infrastructure
## 4 Proposed Scheme
### Mutual Authentication and Session Key Agreement  
\(SM_{i}\) and \(DC_{j}\) authenticate and negotiate to establish each other's session key \(SK\).  
(1) The smart meter \(SM_{i}\) selects a random number \(u\in Z_{p}^{*}\) and a current timestamp \(t_{1}\), and calculates  
\[M_{1}=T_{u}(x) \tag{9}\]  
\[M_{2}=T_{u}(T_{s}(x)) \tag{10}\]  
\[M_{3}=(ID_{i}||E_{i})\bigoplus H_{0}(M_{2}) \tag{11}\]  
\[M_{4}=H(ID_{i}||PID_{i}||E_{i}||M_{2}||M_{3}) \tag{12}\]  
Then, \(SM_{i}\) sends \(\{PID_{i},M_{1},M_{3},M_{4},t_{1}\}\) to \(DC_{j}\).  
(2) After receiving \(\{PID_{i},M_{1},M_{3},M_{4},t_{1}\}\), \(DC_{j}\) first verifies the timeliness of the message. If \(|t_{current}-t_{1}|\leq\Delta T\), \(DC_{j}\) performs the next operation. Otherwise, \(DC_{j}\) terminates the session.  
1. After the message's timeliness is verified, \(DC_{j}\) calculates  
\[M_{2}=T_{s}(M_{1}) \tag{13}\]  
\[\left(ID^{\prime}_{i}||E^{\prime}_{i}\right)=M_{3}\bigoplus H_{0}(M_{2}) \tag{14}\]  
\(DC_{j}\) retrieves \(\{ID_{i},r_{i}\}\), and performs the following steps after successful retrieval; otherwise, \(DC_{j}\) terminates the session.  
2. \(DC_{j}\) performs the following calculation:  
\[E_{i}=H(ID_{i}||s||r_{i}||PID_{i}) \tag{15}\]  
and checks whether the equations \(M_{4}=H(ID_{i}||PID_{i}||E_{i}||M_{2}||M_{3})\) and \(E^{\prime}_{i}=E_{i}\) are established. After successful verification, \(DC_{j}\) performs the next operation; otherwise, the session will be terminated.  
3. \(DC_{j}\) selects \(e^{new}_{i}\in Z^{*}_{P}\) and calculates:  
\[PID^{new}_{i}=H(ID_{i}||e^{new}_{i}) \tag{16}\]  
\[E^{new}_{i}=H(ID_{i}||s||r_{i}||PID^{new}_{i}) \tag{17}\]  
4. \(DC_{j}\) selects \(v\in Z^{*}_{P}\) and a current timestamp \(t_{2}\), then computes:  
\[M_{5}=T_{v}(x) \tag{18}\]  
\[M_{6}=T_{v}(M_{1}) \tag{19}\]  
\[M_{7}=(PID^{new}_{i}||E^{new}_{i})\bigoplus H_{0}(M_{6}||E_{i}) \tag{20}\]  
\[SK_{ji}=H(ID_{i}||PID_{i}||E_{i}||E^{new}_{i}||M_{2}||M_{6}) \tag{21}\]  
\[M_{8}=H(ID_{i}||PID_{i}||E_{i}||M_{2}||M_{5}||SK_{ji}) \tag{22}\]  
5. \(DC_{j}\) sends \(\{M_{5},M_{7},M_{8},t_{2}\}\) to \(SM_{i}\).  
(3) After receiving \(\{M_{5},M_{7},M_{8},t_{2}\}\), \(SM_{i}\) first verifies the timeliness of the message. If \(|t_{current}-t_{2}|\leq\Delta T\), \(SM_{i}\) performs the next step. Otherwise, the session will be terminated.  
1. After the message timeliness is verified, \(SM_{i}\) calculates:  
\[M_{6}=T_{u}(M_{5}) \tag{23}\]  
\[(PID^{new}_{i}||E^{new}_{i})=M_{7}\bigoplus H_{0}(M_{6}||E_{i}) \tag{24}\]  
\[SK_{ij}=H(ID_{i}||PID_{i}||E_{i}||E^{new}_{i}||M_{2}||M_{6}) \tag{25}\]  
2. In order to prevent potential attacks, \(SM_{i}\) checks whether the equation \(M_{8}=H(ID_{i}||PID_{i}||E_{i}||M_{2}||M_{3}||SK_{ji})\) is established. After successful verification, \(SM_{i}\) and \(DC_{j}\) share the session key \(SK=SK_{ij}=SK_{ji}\); otherwise, the session will be terminated.  
3. \(SM_{i}\) updates \(\{PID_{i},E_{i}\}\) to \(\{PID^{new}_{i},E^{new}_{i}\}\) for periodic key updates.  
(4) After mutual authentication, the smart meter \(SM\) and data concentrator \(DC\) use the common session key \(SK\) for encrypted communication. DC and MDMS negotiate to establish a secure channel through the same steps. The message transmitted in the communication needs to meet the communication protocol. The information frame in the AMI generally contains seven parts, and each part contains several bytes. The format is shown in Figure 2, where the data domain part is the main body of the communication content that needs to be encrypted.  
The data concentrator receives control instructions from the MDMS through the secure channel, such as tripping and closing, and then transmits them to the corresponding smart meter through the secure channel. The information frame format transmitted in this process is shown in Figure 3, where the address field contains the address of DC and SM, \(PA=98H\) stands for the secret level, and the data field \(N_{1}\sim N_{m}\) will be filled with ciphertext.