In-network data aggregation presents a critical challenge for data privacy in resource constraint wireless sensor networks. We propose a PAPF scheme, in which a novel p-function set taking advantage of the algebraic properties of modular operation is constructed. Thanks to the p-functions, nodes can perturb their privacy data without extra data exchange, and the aggregation result can be recovered from the perturbed data in the cluster head. Due to the flexible generation of the p-function set, PAPF scheme is adapted to node periodical reporting and sink in query response reports. Extensive analysis and simulations show that PAPF scheme is able to preserve privacy more efficiently while consuming less communication overhead, and has a good resistance to data loss.