Algorithm 3. TokenGen.
| Input: The query phrase , the key set K | 
| Output: The serach trapdoor | 
| 1: Suppose that query phrase | 
| 2: for do | 
| 3: | 
| 4: | 
| 5: if then | 
| 6: | 
| 7: end if | 
| 8: end for | 
| 9: send to blockchain and cloud server | 
| Input: The query phrase , the key set K | 
| Output: The serach trapdoor | 
| 1: Suppose that query phrase | 
| 2: for do | 
| 3: | 
| 4: | 
| 5: if then | 
| 6: | 
| 7: end if | 
| 8: end for | 
| 9: send to blockchain and cloud server |