For the privacy leakage during the data collection of fog-assisted smart grids, this study proposes a novel privacy-preserving data aggregation scheme with fault tolerance. Firstly, the BGN homomorphic encryption algorithm and the Shamir secret sharing scheme are combined to protect data privacy. At the same time, an efficient signature authentication method is constructed based on the elliptic curve discrete logarithm problem to ensure data integrity. In particular, the scheme has two fault-tolerant measures. When some smart meter data cannot be sent normally or some cloud servers fail to work because of attacks, the scheme can still perform aggregate statistics. The security analysis proves that the scheme meets the security requirements of the smart grid. The performance experiments show that the proposed scheme has better computational and communication performance than the existing schemes.