  Wireless Sensor Networks (WSNs) are composed of a large number of spatially
distributed devices equipped with sensing technology and interlinked via radio
signaling. A WSN deployed for monitoring purposes can provide a ubiquitous view
over the monitored environment. However, the management of collected data is
very resource-consuming and raises security and privacy issues. In this paper,
we propose a privacy preserving protocol for collecting aggregated data from
WSNs. The protocol relies on the Onion Routing technique to provide uniformly
distributed network traffic and confine the knowledge a foreign actor can gain
from monitoring messages traveling the network. Our solution employs the
computing power of nodes in the network by conveying them general-purpose
computer code for in-situ processing and aggregation of data sourcing from
multiple sensor nodes. We complement our work with a simulation of the proposed
solution using the network simulator ns-3. Results of the simulation give an
overview of the scalability of the solution and highlight potential
constraints.
