An Energy Efficient and Dynamic Security Protocol for Wireless Sensor Networks: Magisterarbeit