Privacy and Security in Wireless Sensor Networks: Protocols, Algorithms, and Efficient Architectures