Research Article

Query-Biased Preview over Outsourced and Encrypted Data

Algorithm 4

SecQBP algorithm.
:
(1) sample index keys , generate document
  encryption key
(2) output
:
(1) invoke to get and the encrypted document
(2) invoke to get the secure index
(3) output
:
(1) for each keyword in , compute
(2) put into query and pad it to length
(3) output the query
:
(1) let represent the snippet amount, unpack to get the queried
  tokens , set a flag
(2) select a subset of where is in . If no element
  is in , then set
(3) create the result if , or else randomly
  select an index and set
(4) put into query and pad it to length
(5) output
:
(1) unpack and get
(2)  if  the flag   then
(3) randomly select an index
(4)  else
(5) according to , generate the decryption key
  for each matched keyword in
(6) compute the decryption key
(7) invoke using Matrix-AC
(8) choose a snippet number in with the highest score
(9) end if 
(10) output the snippet index
: output the plaintext snippet