# A Charging and Discharging Data Privacy Protection Scheme for V2G Networks Based on Cloud-Fog-End
## 4 Correctness and Security Analysis
### Security Analysis
#### 4.2.2 Confidentiality
If the list \(L_{user}\) contains \(\left(ID_{i},x_{i},d_{i},X_{i},Y_{i}\right)\), [PERSON] returns \(PK_{i}=\left(X_{i},Y_{i}\right)\) to \(A_{1}\); Otherwise, if \(ID_{i}=ID_{i}^{*}\), challenger C randomly selects \(x_{i}\in Z_{q}^{*}\), so that \(X_{i}=x_{i}P\), calculates \(Y_{i}=(1-h_{1i})P_{pub}\), adds \(\left(ID_{i},x_{i},\bot,X_{i},Y_{i}\right)\) to the list \(L_{user}\), and returns \(PK_{i}=\left(X_{i},Y_{i}\right)\) to \(A_{1}\). If \(ID_{i}\
eq ID_{i}^{*}\), C randomly selects \(x_{i},y_{i}\in Z_{q}^{*}\), calculates \(X_{i}=x_{i}P\), \(Y_{i}=y_{i}P-h_{1i}P_{pub}\), then adds \(\left(ID_{i},x_{i},\bot,X_{i},Y_{i}\right)\) to the list of \(L_{user}\), and returns \(PK_{i}=\left(X_{i},Y_{i}\right)\) to \(A_{1}\). Secret value query: When challenger C receives a query about \(ID_{i}\), if \(ID_{i}=ID_{i}^{*}\), the simulation operation is terminated. Otherwise, [PERSON] queries the list \(L_{user}\), and if there is a corresponding item, returns the secret value \(x_{i}\) to \(A_{1}\). If it does not exist, [PERSON] executes the creation of a user inquiry to generate \(\left(ID_{i},x_{i},\bot,X_{i},Y_{i}\right)\) and adds it to \(L_{user}\), then returns \(x_{i}\) to \(A_{1}\). Change public key query: When challenger C receives a query \((ID_{i},X^{\prime}_{i},Y^{\prime}_{i})\) from \(A_{I}\), that is, \(A_{I}\) wants to replace the old \(PK_{i}=(X_{i},Y_{i})\) with a new \(PK^{\prime}_{i}=(X^{\prime}_{i},Y^{\prime}_{i})\), assuming that [PERSON] has already submitted a create user query. Then, [PERSON] obtains \((ID_{i},x_{i},d_{i},X_{i},Y_{i})\) from the list \(L_{user}\), updates \(X_{i}\) to \(X^{\prime}_{i}\), updates \(Y_{i}\) to \(Y^{\prime}_{i}\), and sets \(x_{i}=\bot,d_{i}=\bot\), thus \((PID_{i},x_{i},d_{i},X_{i},Y_{i})\) in \(L_{user}\) has been updated to \((PID_{i},\bot,\bot,X^{\prime}_{i},Y^{\prime}_{i})\). Signcryption query: When challenger C receives a query \((m_{i},ID_{i},ID_{c})\) from \(A_{I}\), where \(m_{i}\) is a plaintext message, \(ID_{i}\) is the sender, and \(ID_{c}\) is the receiver, the following processing is performed: If \(ID_{i}\
eq ID^{*}_{i}\), [PERSON] obtains the receiver's \(PK_{w}=(X_{c},Y_{c})\) and the sender's \(SK_{i}=(x_{i},d_{i})\) by querying \(L_{user}\), and then performs the signcryption operation on \(m_{i}\) according to the scheme. If \(ID_{i}=ID^{*}_{i}\), C queries \(L_{1}\) to obtain \(h_{1c}=H_{1}(ID_{c},X_{c},Y_{c})\), queries \(L_{user}\) to obtain the receiver's private key \(SK_{c}=(x_{c},d_{c})\), selects the random number \(r_{i}\in Z^{*}_{q}\), calculates \(R_{i}=r_{i}P\), \(U_{i}=(x_{c}+d_{c})R_{i}\), \(C_{i}=m_{i}\oplus H_{3}(PID_{i},ID_{CP_{i}},X_{i},Y_{i},U_{i},R_{i})\). \((PID_{i},ID_{CP_{i}},X_{i},Y_{i},U_{i},R_{i})\) and \((ID_{CP_{i}},X_{c},Y_{c},R_{i},C_{i},TS_{i})\) will be stored in list \(L_{3}\) and list \(L_{2}\), respectively. Finally, C calculates \(s_{i}\) to make \(s_{i}P=Y_{i}+P_{pub}h_{1i}+X_{i}h_{2i}\) true and return \(\delta_{i}=(R_{i},C_{i},s_{i})\). Aggregation verification query: When challenger C receives an aggregation signature query \((ID_{1},ID_{2}\ldots ID_{n},m_{1},m_{2}\ldots m_{n},ID_{c})\) from \(A_{I}\), C performs aggregation verification according to the scheme, verifying whether the equation \(SP=\sum_{i=1}^{n}Y_{i}+P_{pub}\sum_{i=1}^{n}h_{1i}+\sum_{i=1}^{n}X_{i}h_{2i}\) is true. If it is true, C returns the aggregation signcryption \(q=(R_{1},R_{2}\ldots R_{n},C_{1},C_{2}\ldots C_{n},S)\). Unsigncryption query: Challenger C receives an unsigncryption query \((ID_{1},ID_{2}\ldots ID_{n},\varphi,ID_{w})\) from \(A_{I}\), and if \(ID_{i}\
eq ID^{*}_{i}\), C will perform the unsigncryption operation according to the scheme and return the plaintext message \(m_{i}\). Otherwise, the game will be terminated. If \(ID_{i}=ID^{*}_{i}\) or the public key of \(ID_{i}\) is replaced, C queries the lists \(L_{2}\) and \(L_{3}\). If there are corresponding tuples, it returns the plaintext message \(m_{i}\); otherwise, the simulation stops.