In recent years, with the development of cloud computing, the Internet of Things (IoT), and other technologies, mobile intelligent transportation systems, particularly the vehicular ad hoc network (VANET), have been growing quickly. Researchers have attempted to use fog computing in VANETs in order to meet real-world requirements for their deployment. Fog computing is an extension of cloud computing, and thus, it inevitably inherits the same security challenges. Further, because VANETs are in an open network environment, they will also face several other potential security and privacy issues. In this study, to promote secure interaction in fog-based VANETs, a new authentication key exchange (AKE) scheme that uses fog nodes as relay nodes has been designed. The scheme completes mutual authentication and generates a session key for later confidential communication. The automatic verification tool ProVerif and the BAN (Burrows–Abadi–Needham) logic were used to formally verify the security of the scheme, and an informal analysis shows that it can resist multiple known attacks. The simulation and analysis results show that the proposed scheme is successful. Finally, performance evaluation shows the effectiveness of the approach. Compared with the previously proposed privacy protection authentication protocols, the results of the proposed scheme are more computationally efficient.