# Secure and Efficient Deduplication for Cloud Storage with Dynamic Ownership Management
## 5 The Proposed Secure Deduplication Protocol
### Data Download  
The clients can download data stored in cloud storage at their convenience, whenever they wish. The detailed process of data download is as follows.  
**Step 1. Request download.** The client sends a download request to the CS.  
* Client \(i\) sends a download request with \(h(M)^{\prime}\), \(r_{i}\), and \(GK^{{}^{\prime}}_{N}\) to the CS to download the data.  
\(h(M)^{\prime}\) indicates that the data client wants to download. \(r_{i}\) serves as proof of the client \(i\)'s identity, and \(GK^{{}^{\prime}}_{N}\) signifies the client's involvement in session \(N\). The use of a small quotation mark (\({}^{\prime}\)) on the values sent by the client visually indicates whether they match the values stored in the CS and the cloud storage.  
**Step 2. Check ownership.** The client sends a download request to the CS.  
* The CS checks whether \(h(M)^{\prime}\) and \(r_{i}\) are stored in the \(ACL\). If both \(h(M)^{\prime}\) and \(r_{i}\) exist, the CS will normally perform the download process. However, without \(h(M)^{\prime}\) or \(r_{i}\), CS will send an error message to the client. This is because the client cannot prove ownership to the CS, or the data do not exist in the cloud storage.
* The CS sends a download request, \(h(M)^{\prime}\), and \(GK^{{}^{\prime}}_{N}\) to the cloud storage. \(h(M)^{\prime}\) is for identifying data stored in the \(CTL\) of the cloud storage, and \(GK^{{}^{\prime}}_{N}\) is a group key for session \(N\) used to decrypt the re-encrypted data.  
**Step 3. Cloud storage's decryption.** The cloud storage decrypts the re-encrypted data and sends them to the CS.  
* The cloud storage checks whether \(h(M)^{\prime}\) is stored in the \(CTL\). If \(h(M)^{\prime}\) exists, the cloud storage calculates ciphertext \(C^{\prime}\) by performing an XOR operation on the group key \(GK^{{}^{\prime}}_{N}\) and re-encrypted data \(RC_{N}\). The \(GK^{{}^{\prime}}_{N}\) is received from the CS, and the \(RC_{N}\) is stored in the \(CTL\) of the cloud storage.
* The cloud storage sends \(C^{\prime}\) to the CS.  
**Step 4. CS's decryption.** The CS decrypts the ciphertext and sends to the client.  
* The CS decrypts the ciphertext \(C^{\prime}\) as \(h(M)^{\prime}\) to obtain \(M^{\prime}\), and the CS computes the hash value \(h(M^{\prime})\) of the message \(M^{\prime}\).
* The CS checks whether \(h(M)\) and calculated \(h(M^{\prime})\) are the same. The \(h(M)\) is a value stored in the CS's \(ACL\). If the two values are the same, it means that they have been decoded normally and will be transmitted to the client. In other cases, it means that an error occurred during the decoding process, and the client will be notified of this error.
* The CS sends \(M^{\prime}\) to the client \(i\).  
**Step 5. Client's decryption.** The client recovers plaintext \(m\) from \(M\).  
* The client recovers the plaintext \(m^{\prime}\) by performing an XOR operation on \(h(m)\) and \(M^{\prime}\). The hash value \(h(m)\) is stored in the client, and the \(M^{\prime}\) is received from the CS.  
If there is no error message received from the CS, \(m\) and \(m^{\prime}\) will be the same data.