Network management method and device based on AUTOSAR, medium and program product

By adopting the dual hashing mechanism based on AUTOSAR in automotive network management, the problem of automobile network management packets being vulnerable to network attacks is solved, and higher security and integrity are achieved.

CN119544188APending Publication Date: 2025-02-28SHANGHAI HANGSHENG IND
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411740928.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing automotive network management messages are vulnerable to network attacks, resulting in high security risks.

Method used

AUTOSAR-based network management method is adopted to generate target packets by obtaining key byte sequences and performing dual hashing operations, thereby enhancing the security and integrity of packet transmission.

Benefits of technology

Effectively resist length-scaling attacks against hash algorithms, increasing the difficulty of attacks, reducing security risks, and ensuring the security and integrity of message transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544188A_ABST
    Figure CN119544188A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of information, and discloses a network management method and device based on AUTOSAR, a medium and a program product. The method is applied to a sending end, and comprises the following steps: acquiring a key byte sequence; wherein the key byte sequence is deployed in an electronic control unit, and the electronic control unit is used for managing network nodes; the key byte sequence at least comprises a key, an internal filling constant and an external filling constant; determining a first hash value according to the secret key, the internal filling constant and a to-be-sent original message; determining a second hash value according to the secret key, the external filling constant and the first hash value; and determining a target message according to the second hash value. The method and the device are at least used for solving the technical problems that messages based on automobile network management are easily attacked by a network and the security risk is relatively high in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to an AUTOSAR-based network management method, device, medium and program product. Background Art

[0002] As the functions of automobile technology become increasingly rich, the electronic and electrical systems of vehicles are becoming more and more complex, and the number of network nodes such as KL30 nodes is also increasing. Among them, KL30 nodes refer to electronic control units that are still powered by batteries when the ignition key is in the OFF state. In traditional network management solutions, KL30 nodes in the car are usually incorporated into the entire network instead of being finely managed according to actual needs. This makes it impossible to achieve the ultimate low power consumption. For example, in order to ensure vehicle safety, when the ignition key is turned to the OFF state, some KL30 nodes still need to communicate for a period of time after the engine is turned off. The communication duration usually ranges from a few minutes to tens of minutes. During this process, all KL30 nodes in the entire network segment must remain active and cannot enter a low-power state, so they will continue to consume battery power.

[0003] In this regard, in the related art, a network management (NM) solution based on AUTOSAR is proposed. The solution adopts a decentralized strategy. Each KL30 node can independently decide whether it needs to wake up or enter a sleep state based on the network management messages it receives and / or sends in the communication system, and the network management state machine can coordinate the switching of the wake-up and sleep states of all KL30 nodes in the local network. Since the above network management strategy is implemented at the level of the local network rather than the entire network, network resources can be managed more effectively and energy consumption can be reduced.

[0004] However, the inventors have found that there are at least the following technical problems in the related technology: currently, the messages of network management based on automobiles are generally transmitted in plain text. With the development of Internet of Vehicles technology, this situation is vulnerable to network attacks. Once the Internet of Vehicles system is invaded, the attacker may tamper with or forge the network management message, thereby destroying the normal management order of the KL30 node inside the vehicle and causing chaos, increasing security risks. Summary of the invention

[0005] One purpose of the present application is to provide an AUTOSAR-based network management method, device, medium and program product, at least to solve the technical problem in the related technology that the messages of automobile-based network management are vulnerable to network attacks and have high security risks.

[0006] To achieve the above objectives, some embodiments of the present application provide the following aspects:

[0007] In a first aspect, some embodiments of the present application provide a network management method based on AUTOSAR, which is applied to a sending end, and the method includes: obtaining a key byte sequence; wherein the key byte sequence is deployed in an electronic control unit, and the electronic control unit is used to manage network nodes; the key byte sequence includes at least a key, an internal filling constant and an external filling constant; determining a first hash value based on the key, the internal filling constant and the original message to be sent; determining a second hash value based on the key, the external filling constant and the first hash value; and determining a target message based on the second hash value.

[0008] In a second aspect, some embodiments of the present application also provide a network management method based on AUTOSAR, which is applied to a receiving end, and the receiving end is used to receive a target message generated by the method as described above; the method includes: determining the second hash value according to the target message; taking the target message as the original message, and determining a third hash value according to a key byte sequence of the original message; wherein the method for determining the third hash value is the same as the method for determining the second hash value; determining the security of the target message according to the second hash value and the third hash value.

[0009] In a third aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.

[0010] In a fourth aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method as described above.

[0011] In a fifth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the method described above when executed by a processor.

[0012] Compared with the related art, in the scheme provided by the embodiment of the present application, the AUTOSAR-based network management method applied to the sending end includes: obtaining a key byte sequence; wherein the key byte sequence is deployed in an electronic control unit, and the electronic control unit is used to manage network nodes; the key byte sequence includes at least a key, an internal filling constant and an external filling constant, and then a first hash value is determined according to the key, the internal filling constant and the original message to be sent, and then a second hash value is determined according to the key, the external filling constant and the first hash value, so as to determine the target message according to the second hash value. Since the key byte sequence is deployed in the electronic control unit, this means that the technical solution provided by the embodiment of the present application adds an information security authentication mechanism through the transport layer of network management, which is conducive to ensuring the security and integrity of message transmission. Since two different filling constants are set, two different keys can be generated. Thereby, the original message can be subjected to two independent hash operations, thus providing a technical solution of a double hash mechanism. Since it is difficult for attackers to predict the internal padding constant and the external padding constant, it is possible to effectively resist the length extension attack on the hash algorithm, thereby increasing the difficulty of the attack, eliminating the potential safety hazard in the related technology to a certain extent, reducing the security risk, and achieving the purpose of solving the technical problem in the related technology that the messages based on vehicle network management are vulnerable to network attacks and have high security risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0014] Figure 1 An exemplary flow chart of an AUTOSAR-based network management method applied to a transmitter according to some embodiments of the present application;

[0015] Figure 2 This is an exemplary flow chart of step S101 in an AUTOSAR-based network management method provided according to some embodiments of the present application;

[0016] Figure 3 This is an exemplary flow chart of step S102 in an AUTOSAR-based network management method provided according to some embodiments of the present application;

[0017] Figure 4 This is an exemplary flow chart of step S103 in an AUTOSAR-based network management method provided according to some embodiments of the present application;

[0018] Figure 5 This is an exemplary flow chart of step S104 in an AUTOSAR-based network management method provided according to some embodiments of the present application;

[0019] Figure 6 An exemplary flow chart of an AUTOSAR-based network management method applied to a receiving end according to some embodiments of the present application;

[0020] Figure 7 This is an exemplary flow chart of step S201 in an AUTOSAR-based network management method provided according to some embodiments of the present application;

[0021] Figure 8 A schematic diagram of an application example of an AUTOSAR-based network management method provided according to some embodiments of the present application;

[0022] Fig. 9 This is an exemplary structural diagram of an electronic device provided according to some embodiments of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] The following terms are used in this article.

[0025] AUTOSAR, whose full English name is AUTomotive Open System ARchitecture, refers to the automotive open system architecture.

[0026] AP AUTOSAR, the full name of AP is Adaptive Platform. AP AUTOSAR is an automotive software framework designed to meet the growing technological needs in the modern automotive industry.

[0027] NM, the full name of which is Network Management, refers to network management.

[0028] Bytes, bytes.

[0029] Body control module, the full English name is Body Control Module, abbreviated as BCM.

[0030] Battery Management System, the full English name is Battery Management System, abbreviated as BMS.

[0031] The power control module, whose full English name is Vehicle Control Unit, is the vehicle controller, abbreviated as VCU.

[0032] Infotainment system, the full English name is In-Vehicle Infotainment, abbreviated as IVI.

[0033] Exclusive OR, the full name in English is Exclusive OR, abbreviated as XOR.

[0034] Replay attack, the full English name is Replay Attack.

[0035] Defend against length extension attack, the full English name is Length Extension Attack.

[0036] First embodiment

[0037] The first embodiment of the present application relates to a network management method based on AUTOSAR. The method is applied to the sending end, such as Figure 1 As shown, the method may include the following steps:

[0038] Step S101, obtaining a key byte sequence; wherein the key byte sequence is deployed in an electronic control unit, and the electronic control unit is used to manage network nodes; the key byte sequence includes at least a key, an internal padding constant, and an external padding constant;

[0039] Step S102, determining a first hash value according to the key, the internal filling constant and the original message to be sent;

[0040] Step S103, determining a second Hash value according to the key, the external filling constant and the first Hash value;

[0041] Step S104: determine the target message according to the second Hash value.

[0042] First of all, it should be noted that in the network management of automobiles, the wake-up mechanism is a system design that ensures that the electronic control unit of the vehicle can be quickly activated and enter the working state when necessary. This mechanism is essential for achieving real-time response of various functions in the vehicle. Among them, the electronic control unit can be specifically an ECU controller; the wake-up methods of the electronic control unit are mainly divided into two types: active wake-up and passive wake-up. Active wake-up means that the electronic control unit can actively send a network wake-up message according to specific internal or external conditions to activate the system and start performing its functions. Passive wake-up refers to the process in which the electronic control unit is triggered and enters the working state after receiving the network wake-up message.

[0043] The transmitting end provided in the first to fifth embodiments of the present application corresponds to the electronic control unit that performs the active wake-up. Exemplarily, the transmitting end may be, but is not limited to, a body control module, a battery management system, a gateway module, etc.

[0044] The receiving end provided in the sixth embodiment to the seventh embodiment of the present application corresponds to the electronic control unit that performs the passive wake-up. Exemplarily, the receiving end may be, but is not limited to, a power control module, a motor controller, an infotainment system, etc.

[0045] In some examples, the AUTOSAR-based network management method may specifically be, but is not limited to, an APAUTOSAR-based network management method.

[0046] The following is a detailed description of each of the above steps.

[0047] For step S101, specifically, in some examples, the key byte sequence can be injected into the electronic control unit of the network node. The network node can be, but is not limited to, a KL30 node. For example, the network node can also include other nodes with similar functions to the KL30 node, which is not specifically limited in the embodiment of the present application. Exemplarily, the length of the key byte sequence can be, but is not limited to, 4 Bytes.

[0048] Exemplarily, the key is used to characterize confidential data used in the encryption process, and is usually known only to the sender and the receiver. The key is used to ensure the security of the data and prevent unauthorized third parties from reading or tampering with the information. In the encryption algorithm, in order to meet the algorithm's requirements for data length, the data may need to be padded. The internal padding constant refers to a set of specific values ​​used to fill the data. Similar to the internal padding constant, the external padding constant is also used for data padding in the encryption process. The internal padding constant is used to perform the first hash operation, and the external padding constant is used to perform the second hash operation.

[0049] For example, the key can be represented by Key, the original message to be sent can be represented by Message, and the internal filling constant can be represented by ipad Indicates that the external fill constant can be used opad express.

[0050] With respect to step S102, specifically, in some examples, the original message to be sent refers to data that needs to be encrypted and sent. The first hash value refers to an output value of a fixed length obtained by taking the key, the internal filling constant and the original message to be sent as input, and processing the key, the internal filling constant and the original message to be sent through a hash function. It can be understood that the hash function can map input data of any length to an output sequence of a fixed length. The first hash value is used in the subsequent encryption process to verify whether the data has been tampered with during the transmission process. Exemplarily, the first hash value can be used Hash_1 express.

[0051] For step S103, specifically, in some examples, the key, the external fill constant and the first Hash value are used as input, and the key, the external fill constant and the first Hash value are recalculated by a Hash function to obtain the second Hash value. Exemplarily, the second Hash value can be used HMAC express.

[0052] Regarding step S104, specifically, in some examples, the second hash value may be HMAC The target message is added to the end of the original message to obtain the target message. The target message is the encrypted data to be sent to the receiving end. It can be understood that the target message is a network management message.

[0053] It is not difficult to find that compared with the related art, in the solution provided in the embodiment of the present application, a key byte sequence is obtained; wherein the key byte sequence is deployed in an electronic control unit, and the electronic control unit is used to manage network nodes; the key byte sequence includes at least a key, an internal filling constant, and an external filling constant, and then a first hash value is determined according to the key, the internal filling constant, and the original message to be sent, and then a second hash value is determined according to the key, the external filling constant, and the first hash value, so as to determine the target message according to the second hash value. Since the key byte sequence is deployed in an electronic control unit, this means that the technical solution provided in the embodiment of the present application adds an information security authentication mechanism through the transport layer of network management, which is conducive to ensuring the security and integrity of message transmission. Since two different filling constants are set, two different keys can be generated. Thereby, the original message can be subjected to two independent hash operations, thus providing a technical solution of a double hash mechanism. Since it is difficult for attackers to predict the internal padding constant and the external padding constant, it is possible to effectively resist the length extension attack on the hash algorithm, thereby increasing the difficulty of the attack, eliminating the potential safety hazard in the related technology to a certain extent, reducing the security risk, and achieving the purpose of solving the technical problem in the related technology that the messages based on vehicle network management are vulnerable to network attacks and have high security risks.

[0054] Second embodiment

[0055] The second embodiment of the present application relates to a network management method based on AUTOSAR. The second embodiment is an improvement on the first embodiment, and the specific improvement is: in the second embodiment of the present application, a specific implementation method for obtaining a key byte sequence is provided.

[0056] Specifically, in some embodiments, the step of obtaining the key byte sequence, i.e., step S101, may further include the following steps: Figure 2 As shown:

[0057] Step S1011, determining the length information of the key byte sequence; wherein the key is determined according to the first digit in the length information, the internal padding constant is determined according to the second digit in the length information; and the external padding constant is determined according to the third digit in the length information;

[0058] Step S1012: Determine the key byte sequence according to the length information.

[0059] For example, the embodiment of the present application takes the length represented by the length information of the key byte sequence as 4 Bytes as an example. The key byte sequence may be composed as follows:

[0060] Byte0~1: indicates that the first two bytes of the key byte sequence can be set as the key.

[0061] Byte2: Indicates that the third byte of the key byte sequence can be set to an internal padding constant.

[0062] Byte3: Indicates that the fourth byte of the key byte sequence can be set to an external padding constant.

[0063] It is not difficult to find that in the embodiment of the present application, by determining the length information of the key byte sequence and determining the key byte sequence based on the length information, a specific implementation method for obtaining the key byte sequence is provided.

[0064] Third embodiment

[0065] The third embodiment of the present application relates to a network management method based on AUTOSAR. The third embodiment is an improvement on the first embodiment, and the specific improvement is: in the third embodiment of the present application, a specific implementation method for determining the first hash value according to the key, the internal filling constant and the original message to be sent is provided.

[0066] Specifically, in some embodiments, the first hash value is determined according to the key, the internal filling constant and the original message to be sent, that is, step S102 may further include the following steps: Figure 3 As shown:

[0067] Step S1021, determining a first operation result according to the key and the internal filling constant;

[0068] Step S1022: Determine a first hash value according to the first operation result and the original message to be sent.

[0069] Optionally, in some embodiments, determining the first operation result according to the key and the internal filling constant is specifically: performing a first XOR operation on the key according to the internal filling constant to obtain the first operation result.

[0070] Optionally, in some embodiments, determining the first hash value according to the first operation result and the original message to be sent is specifically: performing a first hash operation on the first operation result and the original message to be sent to determine the first hash value.

[0071] That is, in some examples, the internal fill constant can be used ipadA first XOR operation is performed on the key Key to obtain a first operation result. Then, the first operation result and the original message Message to be sent can be first concatenated to obtain a first concatenation result, and a first Hash operation is performed based on the first concatenation result to obtain a first Hash value. Exemplarily, the first Hash value can be recorded as Hash_1 The first hash value Hash_1 The calculation process can be expressed by the following formula:

[0072] Hash_1=Hash(Key@ipad)Message.

[0073] It should be noted that the third embodiment of the present application may also be an improvement based on the second embodiment.

[0074] It is not difficult to find that in an embodiment of the present application, by determining the first operation result according to the key and the internal filling constant, and determining the first hash value according to the first operation result and the original message to be sent, a specific implementation method for determining the first hash value according to the key, the internal filling constant and the original message to be sent is provided.

[0075] Fourth embodiment

[0076] The fourth embodiment of the present application relates to a network management method based on AUTOSAR. The fourth embodiment is an improvement on the first embodiment, and the specific improvement is: in the fourth embodiment of the present application, a specific implementation method for determining the target message according to the key, the external filling constant and the first hash value is provided.

[0077] Specifically, in some embodiments, the target message is determined according to the key, the external filling constant and the first hash value, that is, step S103 may further include the following steps: Figure 4 As shown:

[0078] Step S1031, determining a second operation result according to the key and the external padding constant;

[0079] Step S1032: determine a second Hash value according to the second operation result and the first Hash value.

[0080] Optionally, in some embodiments, determining the second operation result according to the key and the external filling constant is specifically: performing a second XOR operation on the key according to the external filling constant to obtain a second operation result.

[0081] Optionally, in some embodiments, determining the second Hash value according to the second operation result and the first Hash value is specifically: performing a second Hash operation on the second operation result and the first Hash value to determine the second Hash value.

[0082] That is to say, in some examples, the external padding constant opad can be used to perform a second XOR operation on the key Key to obtain a second operation result. Then, the second operation result and the first hash value Hash_1 can be concatenated for a second time to obtain a second concatenation result, and a second hash operation can be performed based on the second concatenation result to obtain a second hash value. Exemplarily, the second hash value can be recorded as HMAC. The second hash value HMAC is also the final hash value. The calculation process of the second hash value HMAC can be expressed by the following formula:

[0083] HMAC=Hash(Key@opad)Hash_1.

[0084] It should be noted that the fourth embodiment of the present application may also be an improvement based on the second embodiment and / or the third embodiment.

[0085] It is not difficult to find that in an embodiment of the present application, by determining the second operation result according to the key and the external filling constant, and determining the second hash value according to the second operation result and the first hash value, a specific implementation method for determining the target message according to the key, the external filling constant and the first hash value is provided.

[0086] Fifth embodiment

[0087] The fifth embodiment of the present application relates to a network management method based on AUTOSAR. The fifth embodiment is an improvement on the first embodiment, and the specific improvement is: in the fifth embodiment of the present application, a specific implementation method for determining the target message according to the second hash value is provided.

[0088] Specifically, in some embodiments, the target message is determined according to the second Hash value, and step S104 may further include the following steps: Figure 5 As shown:

[0089] Step S1041, obtaining the timestamp of the original message;

[0090] Step S1042, determining a first message according to the original message and the timestamp;

[0091] Step S1043: determine a target message according to the second Hash value and the first message.

[0092] Exemplarily, before the sending end is ready to send the original message, it can also obtain the local timestamp Timestamp of the original message at the current time, and the timestamp is used to indicate the time when the original message was sent; then fill the timestamp Timestamp to the end of the original message to obtain the first message. Exemplarily, the first message can be recorded as MSG pure Thus, the first message MSG pure The structure includes the data content of the original message and the additional timestamp Timestamp, so that the receiving end can receive the data according to the first message MSG pure The timestamp Timestamp in determines the specific time when the initial message is sent.

[0093] Furthermore, the second hash value HMAC may be added to the first message MSG pure After that, the target message is obtained. Exemplarily, the target message can be represented by MSG. After that, the sending end can send the target message MSG including the second hash value HMAC through the network. It can be understood that the second hash value HMAC is used by the receiving end to verify the integrity and authenticity of the target message.

[0094] It should be noted that the fourth embodiment of the present application may also be an improvement based on any one or more embodiments from the second embodiment to the fourth embodiment.

[0095] It is not difficult to find that in an embodiment of the present application, by obtaining the timestamp of the original message, and determining the first message based on the original message and the timestamp, and then determining the target message based on the second hash value and the first message, a specific implementation method for determining the target message based on the second hash value is provided.

[0096] Sixth embodiment

[0097] The sixth embodiment of the present application relates to a network management method based on AUTOSAR. The method is applied to a receiving end, and the receiving end is used to receive a target message generated by the method described in any one or more embodiments of the first to fifth embodiments; Figure 6 As shown, the method may include the following steps:

[0098] Step S201, determining the second Hash value according to the target message;

[0099] Step S202: taking the target message as the original message, and determining a third Hash value according to the key byte sequence of the original message; wherein the method for determining the third Hash value is the same as the method for determining the second Hash value;

[0100] Step S203: Determine the security of the target message according to the second Hash value and the third Hash value.

[0101] Exemplarily, the receiving end may obtain the target message MSG sent by the sending end, and may extract the second hash value from the tail of the target message MSG. The second hash value is used as a security authentication code.

[0102] Exemplarily, the second hash value may be recorded as HMAC target .

[0103] Further, after the receiving end receives the complete message frame of the target message MSG, the receiving end can use the method used by the sending end to calculate the second hash value HMAC, take the target message as the original message, and perform the same hash operation according to the key byte sequence of the original message to obtain a third hash value. Exemplarily, the third hash value can be calculated using HMAC res express.

[0104] Furthermore, the second hash value can be recorded as HMAC target and the third hash value HMAC res If the second hash value HMAC target and the third hash value HMAC res If the second hash value HMAC is consistent, it can be explained that the target message has not been tampered with during the transmission process and the target message is credible; target and the third hash value HMAC res If they are inconsistent, it can be shown that the target message may have been tampered with and the target message is unreliable. It can be seen that this verification method helps to resist the length extension attack and ensure the security and integrity of the message.

[0105] It is not difficult to find that the embodiment of the present application is an embodiment applied to the receiving end corresponding to the first embodiment, and the embodiment of the present application can be implemented in conjunction with any one or more embodiments of the first to fifth embodiments. The relevant technical details mentioned in any one or more embodiments of the first to fifth embodiments are still valid in the embodiment of the present application, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the embodiment of the present application can also be applied in any one or more embodiments of the first to fifth embodiments.

[0106] Seventh embodiment

[0107] The seventh embodiment of the present application relates to a network management method based on AUTOSAR. The seventh embodiment is an improvement based on the first embodiment, and the specific improvement is: in the seventh embodiment of the present application, a specific implementation method for determining the second hash value according to the target message is provided.

[0108] Specifically, in some embodiments, the step of determining the second hash value according to the target message, that is, step S201, may further include the following steps: Figure 7 As shown:

[0109] Step S2011, obtaining the timestamp carried by the target message;

[0110] Step S2012, obtaining the timestamp of the previous target message before the target message;

[0111] Step S2013, determining a verification result according to the timestamp carried by the target message and the timestamp of the previous target message;

[0112] Step S2014: determine the second hash value based on the target message in combination with the verification result.

[0113] Exemplarily, after the receiving end receives the target message MSG, the timestamp Timestamp carried by the target message MSG may be extracted. For example, the time represented by the timestamp Timestamp may be recorded as TS now Then, the timestamp Timestamp of the previous target message before the target message MSG is obtained. For example, the time represented by the timestamp Timestamp of the previous target message can be recorded as TS last Then, the TS now and the TS last Perform comparative verification.

[0114] Further, in some examples, the comparison verification method may include: comparing the TS now and the TS last If the verification result is: the TS now Less than or equal to the TS last , it indicates that the target message MSG is abnormal, and the step of determining the second hash value according to the target message may no longer be performed; otherwise, the step of determining the second hash value according to the target message is performed.

[0115] That is to say, in the embodiment of the present application, under normal circumstances, the TS now Cannot be equal to the TSlast , and the TS now must be greater than the TS last To ensure that the time represented by the timestamp is increasing. The verification method provided by the embodiment of the present application can effectively prevent replay attacks, that is, prevent the attacker from resending a previously captured target message.

[0116] It is not difficult to find that in the embodiment of the present application, by obtaining the timestamp carried by the target message and obtaining the timestamp of the previous target message before the target message, the verification result is determined according to the timestamp carried by the target message and the timestamp of the previous target message, and the second hash value is determined according to the target message in combination with the verification result, providing a specific implementation method for determining the second hash value according to the target message. The verification method provided by the embodiment of the present application can effectively prevent replay attacks, that is, prevent attackers from resending a previously captured target message.

[0117] Eighth embodiment

[0118] The eighth embodiment of the present application relates to an application example of a network management method based on AUTOSAR.

[0119] Specifically, see Figure 8 As shown, the target message consists of the original message Message, the timestamp Timestamp and the second hash value HMAC.

[0120] In this example, the original message includes: ControlBitVector, SourceNodeIdentifier, and UserData 0 to UserData N. Among them;

[0121] ControlBitVector represents a control bit vector, which is used to indicate certain characteristics or states of the target message.

[0122] SourceNodeIdentifier represents a source node identifier, which is used to identify the identification number (ID) of the sender of the target message.

[0123] UserData 0 to UserData N represent the user data portion, which contains the payload or data of the target message.

[0124] As can be seen from the figure, in this example, before the sending end prepares to send the original message, it obtains the local timestamp Timestamp of the original message at the current time, and fills the timestamp Timestamp to the end of the original message to obtain the first message. The structure of the first message includes the data content of the original message and the additional timestamp Timestamp.

[0125] Furthermore, the second hash value HMAC is added to the end of the first message to obtain the target message. The target message includes the data content of the original message, the additional timestamp Timestamp and the second hash value HMAC.

[0126] In this way, the receiving end can recalculate the third Hash value according to the calculation method represented by the formula provided in the third embodiment and the fourth embodiment, and compare the third Hash value with the second Hash value added in the target message. If the two do not match, it can be explained that the target message may have been tampered with and the target message is unreliable.

[0127] That is to say, the receiver can verify whether the target message comes from a trusted sender who knows the shared key Key through the second hash value, because only the sender who knows the correct key Key can generate the second hash value HMAC that matches the third hash value.

[0128] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0129] Ninth embodiment

[0130] The ninth embodiment of the present application also provides an electronic device. The electronic device can be various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices.

[0131] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the method provided in any one or more of the above embodiments. Fig. 9An exemplary structural diagram of the electronic device is disclosed. Fig. 9 As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.

[0132] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0133] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a track ball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0134] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0135] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the method provided by any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.

[0136] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.

[0137] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0138] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0139] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0140] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0141] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0142] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0143] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0144] The scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim may also be implemented by one unit or device through software or hardware. The words "first", "second", etc. are only used to distinguish the description, and do not indicate any particular order, nor can they be understood as indicating or implying relative importance.

[0145] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.

Claims

1. A network management method based on AUTOSAR, characterized in that: The method is applied to a transmitting end, and the method comprises: Acquire a key byte sequence; wherein the key byte sequence is deployed in an electronic control unit, and the electronic control unit is used to manage network nodes; the key byte sequence includes at least a key, an internal padding constant, and an external padding constant; Determine a first hash value according to the key, the internal filling constant and the original message to be sent; Determine a second hash value based on the key, the external padding constant and the first hash value; A target message is determined according to the second Hash value.

2. The method according to claim 1, characterized in that The obtaining of the key byte sequence comprises: Determine the length information of the key byte sequence; wherein the key is determined according to the first digit in the length information, the internal padding constant is determined according to the second digit in the length information; and the external padding constant is determined according to the third digit in the length information; The key byte sequence is determined according to the length information.

3. The method according to claim 1, characterized in that Determining the first Hash value according to the key, the internal filling constant and the original message to be sent includes: Determine a first operation result according to the key and the internal filling constant; A first hash value is determined according to the first operation result and the original message to be sent.

4. The method according to claim 1, characterized in that: The determining the target message according to the key, the external filling constant and the first Hash value includes: Determine a second operation result according to the key and the external padding constant; A second Hash value is determined according to the second operation result and the first Hash value.

5. The method according to claim 1, characterized in that: Determining the target message according to the second Hash value includes: Obtaining the timestamp of the original message; Determine a first message according to the original message and the timestamp; Determine a target message according to the second Hash value and the first message.

6. A network management method based on AUTOSAR, characterized in that: The method is applied to a receiving end, and the receiving end is used to receive a target message generated by the method according to any one of claims 1 to 5; the method comprises: Determine the second Hash value according to the target message; Taking the target message as the original message, and determining a third hash value according to the key byte sequence of the original message; wherein the method for determining the third hash value is the same as the method for determining the second hash value; The security of the target message is determined according to the second Hash value and the third Hash value.

7. The method according to claim 6, characterized in that The determining, according to the target message, the second Hash value comprises: Obtaining a timestamp carried by the target message; Obtaining the timestamp of the message received closest to the target message before receiving the target message; Verify based on the timestamp carried by the target message and the timestamp of the message closest to the target message; The second Hash value is determined according to the verification result and the target message.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 7.

9. A computer readable medium having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Message validity detection method, client, server and storage medium

    CN121056183A