This article proposes a blockchain-based main key (MK) management system for vehicular networks to improve the credibility of sender identity and the messages. The proposed vehicle-to-vehicle (V2V) secure communication protocol uses blockchain for generating and validating MKs, while an unsupervised deep learning technique is used for analyzing anomalous data in less-secure vehicular communication. Compared to simple V2V communication protocol, the proposed protocol is highly secure and resistant to severe attacks due to blockchain's inherent capabilities. The experimental results show that the proposed long short-term memory-based model is effective in detecting anomalies. Also, the additional 1.17-ms latency that results from fetching MKs from the blockchain ledger suggests that the overall latency of the proposed method is acceptable for V2V communication.