## 4 The Proposed Authentication Mechanism
### Authentication Phase  
In traditional power distribution networks, when a fault occurs in any medium voltage power line, a portion of the load will be unsupplied. Therefore, in the SG, to use the property of self-healing, the SB will disconnect automatically and start to inform the CC about its existing status. This needs particular authentication steps between the SB and the CC. Each remote SB that requires communication with the CC must implement and pass the authentication steps. The suggested authentication scheme can be seen in Figure 5. After confirming the sureness of the information from the SB, the CC will send actions to other SBs. This action, which is achieved through the software, is already saved in the CC and has the ability to deal with fault issues automatically. The CC will make its decisions for specific SBs to handover the network branches to maximize the service within acceptable power losses and the voltage profile. Therefore, the CC will send actions to SBs.  
Figure 4: Initialization phase.  
Figure 5: Authentication Scheme SB to CC.  
The steps of the authentication phase in this scenario are outlined in the steps below.  
**Calculation 1**:
**Step 1**: the SB generates an unknown random number \(\alpha_{j}\gets Z^{*}\) then it computes _IDsbwj_:  
\[IDsbw_{j}=IDsb_{j}\ \oplus\ \alpha_{j}\]
**Step 2**: the SB computes _Msbwj_ by coding the _IDsbwj_ via the unknown parameter \(p_{j}\) as the secure key:  
\[Msbw_{j}=E(IDsbw_{j},p_{j})\]
**Step 3**: the SB computes the hash function _IDsbwj_ and concatenates it with \(\alpha_{j}\):  
\[Hsb_{j}=h\ (IDsbw_{j}\ \|\ \alpha_{j})\]  
**Sending 1**, the SB forwards a message authentication to the CC, the message includes (_Hsbj_; _Msbwj_; _IDsbj_).  
**Calculation 2**:
**Step 1**: after receiving the message authentication, the CC decrypts _Msbwj_ to get _IDsbwj_:  
\[IDsbw_{j}=D(Msbw_{j},p_{j})\]
**Step 2**: the CC extracts \(\alpha_{j}\) from _IDsbwj_:  
\[\alpha_{j}=\ IDsbw_{j}\ \oplus\ IDsb_{j}\]
**Step 3**: to confirm the value of \(\alpha_{j}\), the CC calculates the _OHsbj_ of the _IDsbwj_ and concatenates it with \(\alpha_{j}\):  
\[OHsb_{j}=h\ (IDsbw_{j}\ \|\ \alpha_{j})\]  
If _OHsbj_ = _Hsbj_, then the resulting value of \(\alpha_{j}\) is right. Else,  
**Failure Sending 1**, the CC forwards a message of failure to the SB.
**Step 4**: the CC creates a random number \(\beta_{j}\gets Z^{*}\) and then calculates the replay control ID shadow _IDerwj_:  
\[IDerw_{j}=IDsb_{j}\ \oplus\ \beta_{j}\]
**Step 5**: the CC computes _Mcrwj_ by encrypting _IDerwj_ using \(p_{j}\) as the unknown key:  
\[Mcrw_{j}=E(IDerw_{j},p_{j})\]
**Step 6**: the CC calculates the hash value of _IDerwj_ and concatenates it with \(\alpha_{j}\) and \(\beta_{j}\):  
\[Hcr_{j}=h\ (IDcrw_{j}\ \|\ \alpha_{j}\ \|\ \beta_{j})\]  
**Sending 2**, the CC forwards a message of authentication to the SB, which involves (_Hcrj_; _Mcrwj_).  
**Calculation 3**:
**Step 1**: after getting the message of authentication from the CC, the SB decrypts _Mcrwj_ to obtain _IDerwj_:  
\[IDcrw_{j}=D(Mcrw_{j},p_{j})\]  
**Step 2**: the SB extracts \(\beta_{j}\) from \(IDcrw_{j}\) through:  
\[\beta_{j}=IDsb_{j}\ \oplus\ IDcrw_{j}\]
**Step 3**: to confirm the value of \(\beta_{j}\), the SB calculates the hash value of \(IDcrw_{j}\) and concatenates it with \(\alpha_{j}\) and \(\beta_{j}\):  
\[OHcr_{j}=h\ (IDcrw_{j}\ \parallel\alpha_{j}\ \parallel\beta_{j})\]  
If \(OHcr_{j}=Hcrj\), then the resulting value of \(\beta_{j}\) is corrected. Else,  
**Failure Sending 2**, the SB sends a message of failure to the CC.