Applying range query processing in wireless sensor networks (WSNs) while preserving data privacy is a challenge. This paper proposes an energy-efficient and privacy-preserving range query processing in two-tiered wireless sensor networks, which is denoted as EPRQ. In data storing phase, each sensor node in the query range firstly encrypts its collected data, and then encodes them into the minimized comparison factors by 0-1
,encoding and hashed message authentication coding mechanism. After that, it transmits the encoded and encrypted data to the corresponding storage node. When the base station begins a range query, the bounds of the range are encoded into comparison factors, and then disseminate them to the corresponded storage nodes. According to the numerical comparison property of 0-1
,encoding verification mechanism, an encrypted data set containing the query result is generated by such storage nodes, even without knowing the actual values of the collected data and queried range. Then, the storage nodes send such encrypted data set to the base station as query responses, and the final query result is obtained after decryption by the base station. The theoretical analysis and experimental results show that the EPRQ ensure the privacy of the collected data, the query result and the query range, and it has better performance than the existing methods in the energy consumption.