# An Improved Ciphertext-Policy Attribute-Based Encryption Scheme in Power Cloud Access Control
## 4 Our Proposed PCAC Scheme
### Detail Procedures in PCAC
#### 4.2.2 Data Collection Stage  
Data collection stage shows the flow when the DS uploads the collected data to the PC. There are three phases. First of all, DS,\(s\) identity should be audited by the PC. And then, the CKA generates the access structure for the data. At last, the collected data is encrypted with a symmetric encryption and the symmetric key is encrypted with CP-ABE. **Act_Audit**: An action audit phase in the data collection stage is executed by three parties, the CKA, the DS, and the PC. CKA may be cheated with other DS's identity information. Our action audit phase  
Figure 3: Flow Chart of Access Control. is aimed to ensure that the DS catches the private key associated with the identification that he/she has sent to the CKA. Different from the RAAC scheme [5], the phase in our PCAC scheme is executed before the Gen_key phase. If the audit fails, Gen_key phase is not executed and the computation overhead is reduced. Since the DS's private key must be kept absolutely secret, our action audit phase proves the identity of the DS with zero-knowledge proof, protecting the privacy of the DS. This phase is based on the chameleon hash, and a specific interaction is designed between the CKA and the DS. First of all, when the DS uploads data, _Pro_ needs to be uploaded to show its identification. In addition, DS also needs to select a random number \(r\in Z_{p}\) and upload \(R\ =\ g^{r}\) to the CKA. So the message that the DS needs to send to the CKA, when the data is uploaded, is \(\{k,\textit{Pro},R\}\) (\(k\) is a symmetric key chosen by DS, which is used in the encrypt phase). Then, the CKA randomly chooses \(r^{\prime}\) and sends it to the DS. DS gets \(r^{\prime}\) and calculates \(m\ =\ \frac{r-r^{\prime}}{DS_{id}}\). Since \(r\) is a random number for CKA (as it is hard to discover \(r\) with \(g^{r}\)), \(DS_{id}\) can be kept secret with \(r\). DS generates the time stamp \(TS\) and sends a message, which contains \(m\) and \(TS\), to CKA. CKA sends an audit message \(AM\ =\ \{\textit{Pro},R,m,TS,r^{\prime}\}\) to the PC for audit. The PC may set a transmission delay threshold \(\Delta TS\). Upon receiving \(AM\) sent by the CKA, the PC first determines whether the transmission delay is within this threshold. Suppose the time that PC receives AM is \(TS^{\prime}\). If \(TS^{\prime}-TS>\Delta TS\), PC will send CKA a _REJ_ audit results. This means there may be some trouble with this DS, and it requires an overhaul. In addition, the audit is operated according to Equation (1):  
\[e(g^{m},\textit{Pro})=e(R/g^{r^{\prime}},g) \tag{1}\]  
If the audit is passed, it means that DS catches the identification associated to itself. And then, the CKA generates the access structure for the DS. **Gen_Stru**: In this phase, there are two tasks: generate the access tree and convert access tree to LSSS-sharing matrix. The access structure generation phase generates a specific access structure based on the DS's ID and is executed by CKA. The static general access structure \(T_{1}\) and the dynamic restrictive access structure \(T_{2}\) are stored in the CKA, in the form of access trees. As the data's access structure may change according to different situations, the access structure is divided into two parts \(T_{1}\) and \(T_{2}\). \(T_{1}\) is static access structure that gives the limitation, which should be met in all situations. It means that any U with attribute sets that do not satisfy \(T_{1}\) can't get access to the data, at all times. \(T_{1}\) should be saved in the CKA, in advance, and does not change when the system is running. \(T_{2}\) does change in different situations, it further restricts the attribute set. When \(T_{2}\) changes, there should be a time limit (\(\textit{Time}_{1}\),\(\textit{Time}_{2}\) | \(\textit{Time}_{1}\) < \(\textit{Time}_{2}\)), and it means that when \(\textit{Time}_{1}\) < \(\textit{Time}<\textit{Time}_{2}\), the \(T_{2}\) changes. The access tree should combine the \(T_{1}\)'s limitations and \(T_{2}\)'s, so \(T=T_{1}\)_and_\(T_{2}\).