As the number of active Internet of Things (IoT) devices increases, managing and securing the enormous amount of data generated by these devices become harder. With their always-connected smart meters and internet-enabled electrical appliances, smart grids (SGs) are major data generation sources in IoT. Traditional SGs store and process their collected data in centralized cloud servers. Secure data aggregation (SDA) protocols play an essential role in efficient and private data collection and storage in cloud-based SGs. Due to a high number of connected devices, centralized cloud-based SGs may become inadequate to satisfy the processing and storage needs of the collected data. This article introduces two efficient and lightweight SDA protocols for fog computing-based SGs (FCSG), namely, FCSG-DF and FCSG-P, as a complementary solution for processing and storage needs of cloud-based SGs. By leveraging the distributed nature and other extended capabilities of fog computing, the proposed SDA protocols have a better response time with less computational overhead. Moreover, the privacy of fine-grained energy consumption data is preserved with the help of the privacy-preserving data aggregation processes in the hierarchical fog computing structure of FCSG. Extensive performance evaluation results demonstrate that the proposed protocols have superiority in terms of data transmission and storage efficiency compared to cloud-assisted schemes without data aggregation. Both protocols are analyzed by comparing their success in transmission and storage efficiencies. Moreover, privacy analysis verifies that both protocols effectively ensure the privacy of the data in each layer.