# Research on Dynamic Searchable Encryption Method Based on Bloom Filter
## 5 Construction
First, the data owner inputs the security parameter \(\lambda\) to the algorithm, then generatea the addition group \(\mathbb{G}_{1}\), whose order is a prime q. Let the multiplicative group \(\mathbb{G}_{2}\) have the same order. Let \(e:\mathbb{G}_{1}\times\mathbb{G}_{1}\to\mathbb{G}_{2}\) be a map. So, we have \(g\) as the generator of group \(\mathbb{G}_{1}\). Then, the Hash function is selected and we also need to generate vector \(\vec{Z}\) based on the set of public keys of all users. \(KeyGen(H_{0},id,g)\to sk_{du_{i}},pk_{du_{i}}\): Each DU generates her/his own public/private keys using its own id. \(Initial(W_{ind},para)\to(ABF,EDB,B,NE)\): The data owner runs Algorithm 3 to initialize all the data. The data owner encrypts all the data before sending it to the cloud server. The initialization data for each keyword are placed in \(w_{ind}=(w,st_{w},ind[j])\), where \(ind[j]\) is a document collection of keywords (line 4-5). The search token corresponding to this keyword is evaluated by four hashes and mapped to the Bloom filter, while the counter A[i] at each corresponding position of the filter is increased by one. The next step is to encrypt the file set. The first document of each keyword is encrypted differently from the other documents, so it needs to be calculated separately. This scheme requires key-value pairs to store encrypted file sets. Key-value pairs are represented in this paper by \((add/val)\), and the corresponding \(val\) value is represented in this paper by \(EDB[add]\). This scheme needs to create an \(NE\) to store the random number generated by the latest keyword file for future updates. Finally, \(ABF,EDB,B,NE\) are sent to the cloud server. \(Trapdoor(w,pp)\to st_{w}\): The DU runs this algorithm, enters its private key and the data sent from the DO into the algorithm, and calculates the search token and sends it to the cloud server. \(Search(st_{w},para,EDB,ABF)\to res\): The CS runs this algorithm, uses the keyword search token to put its corresponding set of encrypted files into the set res, and sends the res to the DU. First, the cloud server needs to map the search token to the vABF to determine whether the token exists (Line 2-3). If the search token exists, the key-value pair of the encrypted file is found through the token. First, the first value \(val_{st_{w}}^{1}\) is found by searching the token, and then the encrypted file and \(rn\) value are calculated by \(val_{st_{w}}^{1}\). Then, the key pair of the next encrypted file is found by the \(rn\) value found in turn, and all the encrypted files \(IE\) are put into the set \(res\) through calculation. Finally, the cloud server sends the set \(res\) to the DU. \(Update(Doc,para,EDB,ABF)\):This algorithm is run by the DO to encrypt the newly stored keywords or files and put them in the corresponding location. Updates in this scheme are batch updates (including additions and deletions), and the data owner packages the files that need to be added along with other keywords, update status, and search tokens into a quadruple doc, and puts all the docs into a collection, Doc. There are four situations that need to be determined during the update:  
1. When the keyword corresponding to the updated document does not exist (line 8-18). At this point, you need to initialize the keyword and its files and update the ABF;2. When the keyword exists, and the corresponding first document is the target document (line 20-28). When determining that the first document is the target document, change the status op directly to the target op';
3. When the keyword exists, and the target file corresponds to a subsequent known file set (line 30-36). Check whether all the files correspond to the target file at one time, and change the corresponding state of the file op to the target state op' (add or del state) if found;
4. If the target file has not been stored (line 38-43). Add the target file to the end of the file set while updating \(EDB\) and file counters \(B\) and \(NE\).