This paper proposed an integrity and privacy preserving data aggregation algorithm for WSNs, which is called IPPDA. First, it attached a group of congruent numbers to the sensing data in order to execute integrity checking operated by sink node using Chinese remainder theorem (CRT); then it computed the hash function-based message authentication codes with time and key as the parameters to satisfy data freshness; finally, it adopted a homomorphic encryption scheme to provide privacy preserving. The simulation results show that IPPDA can effectively preserve data privacy, check data integrity, satisfy data freshness, and get accurate data aggregation results while having less computation and communication cost than iCPDA and iPDA.