A Framework For Robust Detection And Prevention Of Wide-spread Node Compromise In Wireless Sensor Networks