# A Security-Enhanced Query Result Verification Scheme for Outsourced Data in Location-Based Services
## 4 Proposed Scheme
### Overview  
In brief, the design goal of our scheme was to support the security verification of query results on the basis of providing a secure query over the outsourced data. That is, when a query ends, both the query result and corresponding verification objects are returned to the user by the fog node. Upon receiving these returned data, the user can obtain the query result that corresponds to his/her query index as well as verify the completeness and correctness of the query result according to the verification objects and check the consistency of the query result based on the blockchain.  
Our scheme is mainly composed of three processes: data outsourcing process, data retrieval process, and data verification process. (1) The data outsourcing process: given a flat map (e.g., a city), the LBSP constructs a Voronoi diagram mentioned in Section 3.1. Then, according to the fog node in each Voronoi cell, the LBSP forms the original database, shown in Table 2. Note that the fog nodes can vary based on the frequency layers or in case the user devices are connected to some local Wi-Fi hotspots. Based on the original database, the LBSP begins to construct the encrypted outsourced data, such as the retrieval index, the query result, and the corresponding verification objects. While introducing the construction process of outsourced data, Section 4.2 explains the improved construction process of verification objects to fix the deficiency of the scheme [9]. (2) The data retrieval process: based on encrypted outsourced data constructed in the data outsourcing process, the storage structure of the outsourced data (i.e, one-to-n lookup table) stored in each fog node is illustrated. When a user specifies a query region, the fog nodes contained in the query region will be in charge of the user's query service. Based on the one-to-n lookup table, Section 4.3 states how the user obtains the query service from the fog nodes and how to prevent the fog nodes from deducing the meaning of the outsourced data stored in themselves by the way of statistics. (3) The data verification process: after obtaining the returned data from the fog nodes, Section 4.4 shows how to verify the correctness and completeness of the query result according to the verification objects and check the consistency of the query result based on the blockchain.  
\begin{table}
\begin{tabular}{l l l} \hline \hline
**Notation** & **Description** \\ \hline \(VO_{g}\) & The verification object of a fog node. \\ \(v_{og}[\,]\) & The position in the verification object of a fog node. \\ \(VO_{W}\) & The verification object set of description files containing all keywords. \\ \(VO_{w}\) & The verification object of description files containing keyword \(w\). \\ \(v_{w}[\,]\) & The counter in the verification object of description files containing keyword \(w\). \\ \(H\) & The set of \(l\) hash functions. \\ \(h\) & A hash function. \\ \hline \hline \end{tabular}
\end{table}
Table 1: \(Cont.\)  
\begin{table}
\begin{tabular}{l l l} \hline \hline \(\mathbf{G}\) & \(\mathbf{W}\) & \(\mathbf{DS_{W}}\) \\ \hline \multirow{4}{*}{\(g1\)} & \(w_{1}\) & \((ds)_{w_{1}}\) \\ \cline{2-3}  & \(w_{2}\) & \((ds)_{w_{2}}\) \\ \cline{2-3}  & \(\ldots\) & \\ \cline{2-3}  & \(w_{\theta}\) & \((ds)_{w_{9}}\) \\ \hline \multirow{4}{*}{\(g2\)} & \(w_{1}\) & \((ds)_{w_{1}}\) \\ \cline{2-3}  & \(w_{2}\) & \((ds)_{w_{2}}\) \\ \cline{2-3}  & \(\ldots\) & \\ \cline{2-3}  & \(w_{\theta}\) & \((ds)_{w_{9}}\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: The original database structure of the LBSP.