Contextual privacy in Wireless Sensor Networks (WSNs) is concerned with protecting contextual information such as whether, when, and where the data is collected. In this context, hiding the existence of a WSN from adversaries is a desirable feature. One way to mitigate the sensor nodes' detectability is by limiting the transmission power of the nodes (Le., the network is operating in the stealth mode) so that adversaries cannot detect the existence of the WSN unless they are within the sensing range of the WSN. Position dependent transmission power adjustment enables the network to maintain its level of stealth while allowing nodes farther from the network boundary to use higher transmission power levels. To mitigate the uneven energy dissipation characteristic, nodes that cannot dissipate their energies on communications reduce the amount of data they generate through computation so that the relay nodes convey less data. Dynamic data compression/decompression strategies reduce the amount of data to be communicated, thus, they achieve better energy savings when compared to static compression/decompression of data in which the data is always compressed independently of the power transmission strategy. In this study, we investigate various data compression strategies to maximize the lifetime of WSNs employing contextual privacy measures through a novel mathematical programming framework. (C) 2014 Elsevier B.V. All rights reserved.