The invention is suitable for the field of vehicle-mounted control systems, and provides a vehicle-mounted communication
security authentication method and
system based on a layered dynamic key. The method comprises the following steps: in a vehicle manufacturing stage, a complete vehicle factory generates a
master key, stores the
master key in a
hardware security module starting configuration area and performs hardware fusing locking; a supplier triggers a
master key to derive, and a working key is generated by encrypting the master key and a random number through an
advanced encryption standard and is periodically updated according to a
chain type rule; the current working key and a fresh value generated by a built-in frame counter of the
hardware security module are subjected to XOR to generate a
session key; encrypting data by using a
session key to generate a
ciphertext, generating an intercepted message
verification code by combining with a fresh value, and packaging and transmitting the intercepted message
verification code; the receiving end verifies the fresh value difference value to
resist replay, compares the intercepted message
verification code to complete
authentication and synchronizes the counter; through three-level secret key layering, calculation
power consumption reduction, anti-replay
time sequence verification and identity
authentication data integrity verification, an omnibearing
security system is constructed, and
eavesdropping, replay, tampering and other attacks are resisted.