Research Article

Tree-Based Public Key Encryption with Conjunctive Keyword Search

Algorithm 5

The algorithm for building an index tree and declared by BuildTree (CurrentNodeSet).
Input: the , which contains all the leaf nodes.
Output: the plaintext index tree .
(1)ifthen
(2)return;
(3) This is the root node of the tree.
(4)end if
(5)Initializes an empty set ;
(6)Sets and ;
(7)whiledo
(8)ifthen
(9)  Creates a parent node for two nodes and , , , , , and generates according to the Algorithm 3;
(10)  Insert to ;
(11)else
(12)  Insert to ;
(13)end if
(14);
(15)end while
(16);
(17) recursive calls BuildTree (Algorithm 5).
(18)return;