# Trusted Energy-Aware Hierarchical Routing (TEAHR) for Wireless Sensor Networks
## 3 Proposed Studies
### Proposed Algorithm
If there is no direct interaction between x and y, the trust value T(x, y, \(\Delta\)t) is computed indirectly by the Cluster Head (CH), which aggregates recommendations from neighboring nodes. Since CHs are periodically verified and their trust values are aggregated using weighted averaging, malicious nodes cannot manipulate indirect trust values arbitrarily. TEAHR remains robust even when there are no direct interactions. Inductive Hypothesis (For k Interactions). Assume TEAHR correctly evaluates trust and prevents deception for all cases where the number of interactions \(\leq\)k. Inductive Step (For k+1 Interactions). If the number of successful interactions S(x, y, \(\Delta\)t) is greater than the unsuccessful interactions U(x, y, \(\Delta\)t), then T(x, y, \(\Delta\)t) remains above the trust threshold (T_thresh), allowing normal participation. If U(x, y, \(\Delta\)t) > S(x, y, \(\Delta\)t), TEAHR detects the node as potentially anomaly detection to detect sudden fluctuations in trust scores. Thus, by induction, TEAHR remains robust for all k+1 interactions, proving that no node can manipulate the trust model without detection. **Theorem 2**. : _TEAHR is Robust Against Anomaly Cluster Heads (CHs) in Hierarchical Trust Evaluations._

Proof. : by Contradiction. Suppose TEAHR is not robust, meaning an anomaly CH can manipulate trust scores. Each CH maintains a local trust table (LTT) and exchanges trust metrics with neighboring CHs. If a CH misbehaves (e.g., dropping packets, falsifying reports, or colluding with malicious nodes), TEAHR enforces the cross-verification with other CHs: if CH-A detects that CH-B is lowering trust scores unjustifiably, CH-B is penalized. Adaptive Trust Thresholds: CHs dynamically update the T_thresh, preventing attackers from exploiting static trust models. Anomaly Isolation: If a CH's behavior deviates significantly, it is flagged, demoted, or isolated. Thus, no CH can manipulate trust scores without being detected, leading to a contradiction. \(\square\)

Complexity Analysis of TEAHR

Computational Complexity

Trust Score Computation: Each node computes its trust score using a weighted sum of metrics (Energy Trust, Forwarding Trust, Consistency Trust, Behavioral Trust). Time Complexity: O(1) per node. Cluster Head Selection: CHs are selected based on energy levels and trust scores. Worst-case Complexity: O(N log N) (sorting-based selection). Anomaly Detection:

Sliding window-based detection: O(1) per node. Statistical deviation-based anomaly detection: O(N) time. Communication Complexity

Trust Exchange (Node-to-CH): O(1) per node, O(N) per cluster. CH-to-CH Trust Verification: O(log N) per CH. Global Network Trust Aggregation (Base Station processing): O(log N). Thus, TEAHR achieves O(N log N) worst-case complexity, making it scalable for large WSN deployments. TEAHR Under Adversarial Conditions

* Cluster Member-to-Cluster Member (CM-to-CM) Trust Estimation
* No Interaction (CM x and CM y):
* Ux,y C, D (\(\Delta\)t) + Sx,y C, D (\(\Delta\)t) = 0 \(\rightarrow\) Trust is computed by CH, ensuring robustness. * If Ux,y C, D (\(\Delta\)t) \(\geq\) 1 and Sx,y C, D (\(\Delta\)t) = 0:
* TEAHR assigns Tx,y C, D (\(\Delta\)t) = 0, preventing malicious deception. * If Ux,y C, D (\(\Delta\)t) \(\geq\) Sx,y C, D (\(\Delta\)t):
* Trust score Tx,y C, D (\(\Delta\)t) \(<\) G, flagging the node as malicious. * Prevention of Common WSN Attacks
* Sybil Attack Prevention
* TEAHR enforces ID authentication and anomaly detection. * Nodes with multiple IDs are flagged when behavioral discrepancies are detected. * On-Off Attack Defense
* TEAHR introduces trust decay factors. * Nodes alternating between good and bad behavior face exponential trust score decay, preventing cyclic exploitation. * Bad-Mouthing and Ballot-Stuffing Attack Mitigation
* TEAHR cross-verifies recommendations from multiple sources. * Weighted averaging of indirect trust prevents a group of malicious nodes from unfairly penalizing others.