The vehicular ad hoc network (VANET) has been considered as one of the most prominent technologies for improving the efficiency and safety of modern transportation systems. However, VANET will present a unique range of challenges and opportunities for security. In particular, key management, as the footstone to build a practical security framework in VANET, becomes a research hotspot. In this project, we investigate key management based on block chain for VANET. We first propose an efficient decentralized key management mechanism for VANET with block chain (DB-KMM) to automatically realize the registration, update and revocation of user’s public key. At the same time, we propose a lightweight mutual authentication and key agreement protocol based on the bivariate polynomial. Then, we analyze the security of DB-KMM in the universally composable framework and show that the mechanism can prevent the typical attacks including internal attacks, DoS attacks, public key tampering attacks and collusion attacks. Finally, we analyze the performance of the proposed scheme through experiments and simulation. Experiment results show that DB-KMM has better performance than the existing schemes in terms of communication, storage, computation overhead and latency.