# Blockchain-Assisted Verifiable and Multi-User Fuzzy Search Encryption Scheme
## 4 Definitions of Algorithm and Security Model
### Algorithm Framework
#### 4.2.2 Algorithm Definition  
The scheme has nine main algorithms. 1. \(Setup(1^{\lambda})\rightarrow(pk,mk)\) is a system initialization algorithm. The Data Owner \(DO\) inputs random security parameter \(\lambda\), generates system public key \(pk\) and the master private key \(mk\). 2. \(KeyGen(1^{\lambda},l)\to KS\) is a key generation algorithm. \(DO\) inputs random security parameter \(\lambda\) and the length \(l\) of file index, outputs the key set \(KS=(M_{1},M_{2},S)\). 3. \(Enc(pk,K_{1},K_{2},D,KW,KS,\Gamma)\rightarrow(FID,C,C_{K_{1}},I,MAC_{c_{i}}, Index_{tree})\) is an encryption algorithm. \(DO\) takes public key \(pk\), plaintext set \(D\), keyword set \(KW\), access policy \(\Gamma\), key \(K_{i}\) of the corresponding type of files, authentication key \(K_{2}\), and index encryption key \(KS\) as input. Then, for outputs, the ciphertext set \(C\), encrypted file identifier \(FID\), security index \(I\), the key cipher containing access policy \(C_{K_{i}}\), ciphertext file message authentication code \(MAC_{c_{i}}\), and security index tree \(Index_{tree}\). 4. \(UserSign(pk,mk,S_{u})\rightarrow(SK_{u},SK_{s},user\_id)\) is a user registration algorithm run by \(TA\), it takes \(pk\), \(mk\), and \(S_{u}\) as input, outputs attribute private key \(SK_{u}\), the user search key \(SK_{s}\), and authenticated identifier \(user\_id\). 5. \(TokenGen(pk,SK_{s},W_{q})\to T_{t}\) is a trapdoor generation algorithm. Data User takes the public key \(pk\), a query keyword collection \(W_{q}\) and attribute private key \(SK_{s}\) as input, outputs the trapdoor with time stamp \(T_{t}\). 6. \(Search(Index_{tree},T_{t})\rightarrow(C_{K_{i}},FID,MAC_{c_{i}})\) is a search-matching algorithm run by Smart Contract \(SC\). This algorithm takes \(T_{t}\) and \(Index_{tree}\) as input, outputs \(C_{K_{i}}\), \(MAC_{c_{i}}\) and \(FID\). 7. \(Verify(C_{i},MAC_{c_{i}},K_{2})\to 1/0\) is a verification algorithm. The Data User takes the verification key \(K_{2}\), the ciphertext file \(C_{i}\) and the ciphertext message authentication \begin{table}
\begin{tabular}{c c} \hline \hline
**Notation** & **Meaning** \\ \hline \(D=\{F_{1},F_{2},\ldots,F_{n}\}\) & the file set of \(DO\) \\ \(C=\{C_{1},C_{2},\ldots,C_{n}\}\) & the ciphertext set \\ \(pk\) & the public key \\ \(\Gamma\) & the access policy \\ \(K_{i}\) & the symmetric key for the corresponding type of files. \\ \(C_{K_{i}}\) & the key cipher containing access policy \\ \(K_{2}\) & the verification key \\ \(S_{u}\) & the user attributes collection \\ \(W_{q}\) & a query keyword collection \\ \(KS\) & the index encryption key \\ \(SK_{u}\) & attribute private key for users \\ \(SK_{s}\) & the user search key \\ \(T_{t}\) & a trapdoor with time stamp \\ \(KW\) & a collection of keywords for a file set \\ \(KW_{F_{i}}\) & the keyword set for file \(F_{i}\) \\ \(ST_{km}\) & the stemming of the keyword \(kw\) \\ \(ST_{kw_{t}}\) & the keyword stemming set for file \(F_{i}\) \\ \(MAC_{c_{i}}\) & the ciphertext message authentication code \\ \(KS=(M_{1},M_{2},S)\) & the key set for the encrypted trapdoor and index \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Description of Symbols. code \(MAC_{C_{i}}\) as input. It is determined whether a preliminarily correct result is obtained by outputting the result. (8) \(Dec(SK_{u},C_{K_{i}},C_{w_{q}})\rightarrow(D_{kw}/\bot)\) is a decryption algorithm run by the Data User. It takes the attribute private key \(SK_{u}\), the key cipher containing access policy \(C_{K_{i}}\), and file set cipher \(C_{w_{q}}\), which are based on the query keyword set \(w_{q}\) as input. If \(SK_{u}\) satisfies the access structure \(\Gamma\) defined by the Data Owner \(DO\), then it outputs the plaintext files containing the query keyword set, otherwise, the output is \(\bot\). (9) \(Update(Uptype,I_{T_{c}})\to Index_{tree\_new}\) is an index tree update algorithm run by the smart contract. It takes the encrypted subtree \(I_{T_{c}}\) sent by the Data Owner as input, and outputs the new index tree \(Index_{tree\_new}\).