# Public Key-Based Authentication and En-Route Filtering Scheme in Wireless Sensor Networks
## 4 The Proposed Scheme
When the sender finds that \(v_{j}\) does not forward the report, it will deduct 0.1 from \(TV_{j}\) and inform another trusted upstream node whose trust value is higher than the others to verify and forward the report. When \(TV_{j}\) falls below \(T_{TV}\), the sender will delete \(v_{j}\) from the trusted neighbor list and add it into the isolation list. Unless all the trusted upstream nodes of the sender are compromised, the legitimate report will ultimately be forwarded to the BS. ### Report Forwarding and En-Route Filtering  
In this phase, two issues need to be addressed: (1) How to forward the signed report from the CH node to the BS? (2) How does a forwarding node verify the received report? To resist selective forwarding attacks, the authors design a forwarding routing protocol. The sender, which could be a CH or a forwarding node, selects a trusted upstream node (\(v_{j}\) for example) with the highest trust value, and transmits the signed event report to it. Each upstream node that hears the report will temporarily store the report. Then, the sender overhears the channel for a while. When the sender finds that \(v_{j}\) does not forward the report, it will deduct 0.1 from \(TV_{j}\) and inform another trusted upstream node whose trust value is higher than the others to verify and forward the report. When \(TV_{j}\) falls below \(T_{TV}\), the sender will delete \(v_{j}\) from the trusted neighbor list and add it into the isolation list. Unless all the trusted upstream nodes of the sender are compromised, the legitimate report will ultimately be forwarded to the BS. **Algorithm 8**Substitution of Cluster HeadWhen a forwarding node \(v_{t}\) receives a signed report \(\{V,e,\sigma\}\) from \(v_{k}\), where \(V=\{CID,ID_{ch},L_{e},t_{e}\}\), it will verify the report and drop the false one as follows:  
1. Check if \(v_{t}\) has stored the public key \(Q_{CID}\) of cluster \(CID\); otherwise, drop the report and go to S5. 2. Check the freshness of the report with the help of \(t_{e}\) in the report; otherwise, drop the report and go to S5. 3. When \(v_{t}\) is a neighbor of the CH node \(v_{ID_{ch}}\), \(v_{t}\) verifies the legitimacy of \(v_{ID_{ch}}\)'s location \(L_{ID_{ch}}\) stored locally by checking that d(\(L_{e}\), \(L_{ID_{ch}}\)) \(\leq R_{s}\). Otherwise, \(v_{t}\) drops the report and goes to S5. 4. Compute \(d=H(e\mid V)\), \(R=\sigma P-dQ_{CID}\), and \(C=ENC^{-1}(X(R),e)\), where \(ENC^{-1}\) denotes a decryption operation. Then, check that the \(\{ID_{ch},L_{e}\}\) abstracted from \(C\) are the same as those in the report; otherwise, drop the report and go to S5. 5. When the report is dropped, \(v_{t}\) deducts 0.1 from \(TV_{k}\). When \(TV_{k}\) falls below \(T_{TV}\), \(v_{t}\) deletes \(v_{k}\) from the trusted neighbor list and adds it into the isolation list. 6. When the report passes all the above checks, \(v_{t}\) sends the report to the next hop by using the proposed forwarding routing protocol. When a cluster node \(v_{a}\) sends out a signed report, the selected forwarding node will verify the report and, at the same time, each cluster node \(v_{b}\) that hears the report will also verify the report according to the steps S1-S4. When \(v_{b}\) finds that the report is false, it will deduct 0.1 from \(TV_{a}\). When \(TV_{a}\) falls below \(T_{TV}\) and \(NA_{a}\) is lower than \(Nc/2\), then \(v_{b}\) will broadcast an ALARM message for \(v_{a}\). \(v_{b}\), and each cluster node that hears the ALARM message, executes Algorithm 2 to process the ALARM message. When \(NA_{a}\) is greater than or equal to \(Nc/2\), \(v_{b}\) will delete \(v_{a}\) from the trusted neighbor list and add it into the isolation list.