On Effect of Compromised Nodes on Security of Wireless Sensor Network