| Protocol 2: Query Protocol | |
|
Phase 1: Sink sends query to M Sink firstly computes {HNE0(low), HNE1(low), HNE0(high), HNE1(high)}, the comparator of low and high in Qt = (ψ, t, [low, high]), and replaces the low and high in Qt with their corresponding comparators, respectively. Then, Sink sends Qt = (ψ, t, {HNE0(low), HNE1(low), HNE0(high), HNE1(high)}) to M. Phase 2: M processes the query Upon receiving Qt from Sink, M performs the following two steps. We denote CS as the minimal encrypted dataset received by Sink, which contains the query results. The initial CS is empty, which is denoted as CS = Ø. (1) Let Cτ,i = Fi,1Fi,2...Fi,δ be an encrypted constraint chain contributed by si during a time slot, and min{HNE0(UB(Fi,j)), HNE1(UB(Fi,j))} is the comparator of UB(Fi,j), which is a factor in Ωi. According to Definition 1, LB(Fi,j) = UB(Fi,j−1) (1 < j ≤ δ), it is clear that the comparator of LB(Fi,j) is min{HNE0(UB(Fi,j−1)), HNE1(UB(Fi,j−1))} in Ωi. Here, the 0-1 encoding technology is employed to compare UB(Fi,j) and LB(Fi,j) with low and high, where Fi,j is a constraint factor in Cτ,i. If one of the following three conditions can be satisfied, add Fi,j into , where is a set of constraint factor. We set = Ø initially. Condition 1: low ≤ LB(Fi,j) ≤ high Condition 2: low ≤ UB(Fi,j) ≤ high Condition 3: LB(Fi,j) ≤ low ∧ high ≤ UB(Fi,j) After all constraint factors in Cτ,i are processed through the above steps, then all the constraint factor set will be added into another set CS. (2) After all sensor nodes are processed through step (1), M will send the following message to Sink.
After receiving the message from M, Sink decrypts the encrypted message in CS and computes the query result QR, and then verifies the integrity of QR. The process of verification is detailed in Algorithm 1 of Section 5.3. |