## 4 Identity Management and Access Control Based on Blockchain under Edge Computing for IIoT
### Lightweight Key Exchange Based on Self-Certified Public Key
** Key duplication attack: Makes two mismatched sessions calculate the same session key value and obtains this session key value by querying another session key value. The input of the function is the script record of the session. Because it is a random language machine, and each session has a different temporary private key, the probability that two non-matching sessions have the same participants and the same transient public key can be ignored. Therefore, the probability of successfully performing a key replication attack is negligible. Below, we mainly analyze counterfeit attacks. We define three conditions that exist when forging attacks:  
Case 1: There is an honest entity \(\hat{B}\), that does the query \(H_{1}(\overline{y},b_{1},b_{2})\) before doing a Static-Key Reveal (\(\hat{B}\)), query (Static-Key Reveal ( ) query is not required at this time). Case 2: Case 1 does not occur. The test session has a matching session. Case 3: Case 1 does not occur. The test session does not have a match in session. If Case 1, Case 2, or Case 3 occurs with a non-negligible probability, a counterfeit attack will be successfully performed with non-negligible advantages. We will analyze these three situations separately. **Case 1. **_In the \(n(\lambda)\) party, randomly select one party \(\hat{B}\) and set its long-term public key to \(B_{1}=V\), \(B_{2}=\frac{S\mathbb{P}}{r\hat{V}}\), where \(s,r\in Z_{q}\). At this point, \(S\) does not know the long-term private key of \(\hat{B}\), and the remaining long-term private key of \(n(\lambda)-1\) is randomly assigned. When \(M\) queries all parties except \(\hat{B}\), because \(S\) knows its long-term private key, it can answer correctly. Below we will explain how to simulate \(\hat{B}\), as well as other oracles such as \(H_{1}\) and \(H_{2}\) queries._  
_(a) Simulation of (\(\hat{B}\)). When the incoming message is \(\big{(}\hat{B},\hat{A}\big{)}\) or \(\big{(}\hat{B},\hat{A},X\big{)}\), select \(\overline{y}\in\{0,1\}^{\lambda}y\in Z_{q}\), calculate \(Y=yP\), generate a new session identifier and return a message: For \(1\)\(\big{(}\hat{B},\hat{A}\big{)}\), the identifier is \(1\)\(\big{(}\hat{B},\hat{A},Y,X\big{)}\), return \(\big{(}\hat{A},\hat{B},Y\big{)}\), for \(\big{(}\hat{B},\hat{A},X\big{)}\), the identifier is \(\big{(}\hat{B},\hat{A},Y,X\big{)}\), return \(\big{(}\hat{A},\hat{B},X,Y\big{)}\). If the incoming message is \(\big{(}\hat{B},\hat{A},Y,X\big{)}\), check if \(S\) has a session \(\big{(}\hat{B},\hat{A},Y,X\big{)}\). Terminate if there is no, otherwise the updated ID is \(\big{(}\hat{B},\hat{A},Y,X\big{)}\)._  
_(b) \(H_{1}(\overline{y},b_{1},b_{2})\). \(S\) checks if it is \(b_{1}P=V\) or \(b_{2}P=s\frac{P}{r\hat{V}}\). If yes, Solves the ECDH problem for \(b_{1}P=V\), \(\mathsf{ECDH}(U,V)=b_{1}U\) and \(b_{2}P=s\frac{P}{r\hat{V}}\), \(\mathsf{ECDH}(U,V)=(b_{2}-s)rU\), respectively. All other cases return normally (for new queries, a random value of \(Z_{q}\) is returned, and a consistent value is returned for the query that was done)._  
_(c) Ephemeral-Key Reveal (sid): For the session sid, \(S\) return the short-term private key \(\overline{y}\)._  
_(d) Static-Key Reveal (\(\hat{A}\)): If \(\hat{A}=\hat{B}\), \(S\) terminates. Otherwise, the two long-term private keys of \(\hat{A}\) returned normally._  
_(e) Session-Key Reveal(sid): \(S\) return the session key \(SK_{sid}\) as follows:_  
_I. If sid is not owned by \(\hat{B}\), \(\big{(}Z_{1},Z_{2},Z_{3},X,Y,\hat{A},\hat{B}\big{)}\) and \(SK_{sid}=H_{2}\big{(}Z_{1},Z_{2},Z_{3},X,Y,\hat{A},\hat{B}\big{)}\) can be calculated by \(S\).__II. If the sid is owned by \(\hat{B}\), Scheck whether the previous session has been queried. If yes, the previous session key \(SK_{\text{sid}}\) is returned._  
_III.