# Blockchain-Assisted Verifiable and Multi-User Fuzzy Search Encryption Scheme
## 5 Proposed Scheme
### Concrete Construction
#### 5.2.2 Encryption Work  
The encryption work mainly includes key encryption, file index vector generation, index tree generation, and trapdoor generation. A. Key Encryption  
\(Enc(pk,K_{1},K_{2},D,KW,KS,\Gamma)\): Assume that the file set has \(t\) types, \(DO\) has \(n\) plaintext files \(D=\{F_{1},F_{2},\ldots,F_{n}\}\). The files are categorized according to their types and the corresponding symmetric encryption key \(K_{i}(1\leq i\leq t)\) is generated for different types of files., e.g., in a medical database, ophthalmology case files are classified as one type and case files from different sections are categorized into different types. \(DO\) parses keyword sets \(KW\) from \(D\) and \(KW_{F_{i}}\) from \(F_{i}\) respectively, then encrypts file identifiers of \(D=\{F_{1},F_{2},\ldots,F_{n}\}\) by \(K_{2}\) to obtain the ciphertext \(FID=\{FID_{1},FID,\ldots,FID_{n}\}\). \(DO\) sets the access control structure tree \(\Gamma\) for different types of files with key \(K_{1}\) based on actual application requirements. For example, the core files of a medical department can be decrypted only by users who meet the conditions of important attributes, while for the general files of the department only the basic conditions of access to the files by the department need to be met. \(DO\) assign a polynomial \(q_{x}\) for each node \(x\) from root \(r\), where \(q_{x}\) in leaf nodes are constant. Randomly select \(s\) from \(\mathbb{Z}_{p}\) which \(q_{r}(0)=s\), \(\deg(q_{x})=d_{x}=k_{x}-1\), then \(deg(q_{r})\) random coefficients are selected from \(\mathbb{Z}_{p}\) to determine \(q_{x}\). \(Y\) denotes the leaf nodes and \(k_{x}\) is the threshold value of \(x\). Eventually gets \(C_{K_{i}}=\left\{\Gamma,\ \overline{C}=K_{1}e(g,g)^{\alpha s},\ C=h^{s},\ \left\{C_{y},\ C_{y^{ \prime}}\right\}\forall y\in Y\right\}\) where \(C_{y}=g^{dy(0)},C_{y^{\prime}}=H_{1}(att(y))^{dy(0)}\). \(DO\) encrypts plaintext \(D=\{F_{1},F_{2},\ldots,F_{n}\}\) by \(K_{i}\) to obtain ciphertext set \(C=\left(C_{1},C_{2}\ldots,C_{n}\right)\). Eventually, \(C\) and \(FID\) are sent to \(CS\), \(C_{K_{i}}\) will be stored in the index tree described subsequently. B. File Index Vector Generation  
The generation of file index vectors is carried out by mapping the keywords on the bloom filter of the file. The keywords transform into vectors so that they can be mapped on the bloom filter and the improved keyword bigram disambiguation algorithm from scheme [21] is used to transform the keywords into vectors. For the keyword \"happy\", \(DO\) first converts it to a bigram set \(\{ha_{1},ap_{1},pp_{1},py_{1}\}\). Considering the existence of the same bigram elements, the vector is expanded to \(2\times 26^{2}\), where \(26\times 26\) represents possible binary letters. If the bigram set of the keyword exists in the corresponding position of the vector, the corresponding position is set to 1, otherwise it is set to 0, different keywords are converted into vectors with the same length. \(DO\) constructs and initializes an \(l-\) bit bloom filter \(B_{i}\) for file \(F_{i}\) in the file collection \(D\) by \(k\) LSH. \(I^{\prime}\) and \(I^{\prime\prime}\) are \(l-\) bit null vectors. The keyword set \(KW_{F_{i}}\) is subjected by the porter stemming algorithm to obtain the stemmed set \(KW_{ST_{F_{i}}}\). If the file \(F_{i}\) has \(x\) keywords, the bigram set of \(KW_{ST_{F_{i}}}\) finally converts to a vector set \(Bv_{ST_{F_{i}}}\), \(bv_{i}\) in the vector set \(Bv_{ST_{F_{i}}}\) are mapped onto \(B_{i}\) by \(k\) LSH. Set the corresponding position of the mapping to \(TF_{i,j}/k\) according to the importance of the file according to the importance of the keyword to the file, where \(TF_{i,j}=1+|kw_{j}|/|F_{i}|\) is the frequency of keyword \(kw_{j}\) in \(F_{i}\), \(|kw_{j}|\) denotes the number of occurrences of \(kw_{j}\) in \(F_{i}\), and \(|F_{i}|\) denotes the number of keywords in \(F_{i}\).