| CPC H04L 9/065 (2013.01) [H04L 9/14 (2013.01)] | 33 Claims |

|
8. A second vehicle-mounted device, comprising:
at least one processor; and
at least one memory coupled to the at least one processor and storing programming instructions for execution by the at least one processor to:
receive a second ciphertext packet from a first vehicle-mounted device, wherein the second ciphertext packet is formed by arranging a first ciphertext packet, a message authentication code, and a first fresh value;
obtain the first ciphertext packet from the second ciphertext packet;
obtain the first fresh value from the second ciphertext packet;
obtain the message authentication code from the second ciphertext packet;
in response to determining that the first fresh value is greater than a second fresh value, generate a new message authentication code based on a second key, the first ciphertext packet, and the first fresh value, wherein the second fresh value is locally stored after the second vehicle-mounted device receives the second ciphertext packet;
determine that the new message authentication code is same as the obtained message authentication code;
generate a keystream based on a first key and the first fresh value; and
obtain a first plaintext packet based on performing an exclusive OR operation using the keystream and the first ciphertext packet.
|