Vehicle gateway data encryption method and device, vehicle, medium and program product
By chunking the vehicle gateway data and generating the initial key using hash function, combining symmetric encryption and public key encryption, the problems of low encryption efficiency and high energy consumption in the existing technology are solved, and the security of vehicle data transmission is improved and efficiency.
Patent Information
- Application Number
- CN202411203444.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-10
AI Technical Summary
When the existing information encryption transmission method processes large data volumes, there are problems such as low encryption efficiency, high energy consumption and low data transmission security.
By chunking the vehicle gateway data, a unique initial key is generated using a hash function, and a new key is generated when each data block is encrypted, combining symmetric encryption and public key encryption, and finally transmitting the encrypted data through a secure channel.
It improves the security of vehicle data transmission, improves encryption efficiency, reduces energy consumption, and solves the efficiency and energy consumption problems of traditional encryption algorithms when processing large data volumes.
Smart Images

Figure CN119300025A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile technology, and in particular to a method, device, vehicle, medium and program product for encrypting vehicle gateway data. Background Art
[0002] With the development of automotive Internet technology, data exchange between vehicles and external networks is becoming increasingly frequent, and data transmission efficiency and data security issues have become particularly important.
[0003] However, when processing large amounts of data, existing information encryption and transmission methods have problems such as low encryption efficiency, high energy consumption, and low data transmission security, which need to be solved urgently. Summary of the invention
[0004] The present invention provides a vehicle gateway data encryption method, device, vehicle, medium and program product to solve the problems of low encryption efficiency and high energy consumption when traditional encryption algorithms process large amounts of data, thereby improving the security of vehicle data transmission, improving encryption efficiency and reducing energy consumption.
[0005] The first aspect of the present invention provides an encryption method for vehicle gateway data, comprising the following steps: obtaining the current data to be encrypted, the current timestamp and the vehicle identification code of the vehicle gateway; dividing the data to be encrypted into multiple data blocks, and generating an initial key according to the current timestamp and the vehicle identification code, and generating an encryption key for each data block according to the initial key; encrypting the initial key according to a preset public key encryption algorithm to obtain an encrypted initial key, and encrypting the corresponding data block according to the encryption key of each data block to obtain multiple encrypted data blocks, and transmitting the encrypted initial key and the multiple encrypted data blocks to a target node.
[0006] Further, in one embodiment, generating the initial key according to the current timestamp and the vehicle identification code includes: generating the initial key according to the current timestamp and the vehicle identification code based on a first key generation formula, wherein the first key generation formula is:
[0007] K=H(VIN∥timestamp∥nonce);
[0008] Wherein, K is the initial key, H is the hash function, VIN is the vehicle identification number, timestamp is the timestamp, and nonce is the random number.
[0009] Further, in one embodiment, generating the encryption key of each data block according to the initial key includes: obtaining the serial number of each data block; and generating the encryption key of each data block according to the initial key and the serial number of each data block.
[0010] Furthermore, in one embodiment, the encrypted initial key is:
[0011] K encrypted =RSA-2048 public key (K);
[0012] Among them, K encrypted For the encrypted initial key, the RSA-2048 public key () is the preset public key encryption algorithm, and K is the initial key.
[0013] Further, in one embodiment, the plurality of encrypted data blocks are:
[0014] C i =E(K i ,P i );
[0015] Among them, C i is the i-th encrypted data block, E() is the encryption function, K i is the key of the i-th data block, P i is the i-th data block.
[0016] According to the vehicle gateway data encryption method provided by the embodiment of the present invention, the data is divided into blocks, a unique initial key is generated by using a hash function, a new key is generated when each data block is encrypted, symmetric encryption and public key encryption are combined, and finally the encrypted data is transmitted through a secure channel. The problems of low encryption efficiency and high energy consumption existing in traditional encryption algorithms when processing large amounts of data are solved, the security of vehicle data transmission is improved, the encryption efficiency is improved, and the energy consumption is reduced.
[0017] The second aspect of the present invention provides an encryption device for vehicle gateway data, including: an acquisition module, used to obtain the current data to be encrypted, the current timestamp and the vehicle identification code of the vehicle gateway; a generation module, used to divide the data to be encrypted into multiple data blocks, and generate an initial key according to the current timestamp and the vehicle identification code, and generate an encryption key for each data block according to the initial key; an encryption module, used to encrypt the initial key according to a preset public key encryption algorithm to obtain an encrypted initial key, and encrypt the corresponding data block according to the encryption key of each data block to obtain multiple encrypted data blocks, and transmit the encrypted initial key and the multiple encrypted data blocks to the target node.
[0018] Further, in one embodiment, the generating module is specifically used to generate the initial key according to the current timestamp and the vehicle identification code based on a first key generating formula, wherein the first key generating formula is:
[0019] K=H(VIN∥timestamp∥nonce);
[0020] Wherein, K is the initial key, H is the hash function, VIN is the vehicle identification number, timestamp is the timestamp, and nonce is the random number.
[0021] Furthermore, in one embodiment, the generating module is specifically used to: obtain the serial number of each data block; and generate an encryption key for each data block according to the initial key and the serial number of each data block.
[0022] Furthermore, in one embodiment, the encryption module is specifically used to obtain the encrypted initial key. The encrypted initial key is:
[0023] K encrypted =RSA-2048 public key (K);
[0024] Among them, K encrypted For the encrypted initial key, the RSA-2048 public key () is the preset public key encryption algorithm, and K is the initial key.
[0025] Furthermore, in one embodiment, the encryption module is specifically used to generate the multiple encrypted data blocks. The multiple encrypted data blocks are:
[0026] C i =E(K i ,P i );
[0027] Among them, C i is the i-th encrypted data block, E() is the encryption function, K i is the key of the i-th data block, P i is the i-th data block.
[0028] The vehicle gateway data encryption device provided by the embodiment of the present invention divides the data into blocks, generates a unique initial key using a hash function, generates a new key when encrypting each data block, combines symmetric encryption and public key encryption, and finally transmits the encrypted data through a secure channel, thereby solving the problems of low encryption efficiency and high energy consumption in traditional encryption algorithms when processing large amounts of data. The security of vehicle data transmission is improved, encryption efficiency is improved, and energy consumption is reduced.
[0029] A third aspect of the present invention provides a vehicle, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-mentioned vehicle gateway data encryption method.
[0030] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the vehicle gateway data encryption method as described in the above embodiment.
[0031] A fifth aspect of the present invention provides a computer program product, including a computer program, which is executed to implement the vehicle gateway data encryption method as described in any one of the above items.
[0032] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0034] Figure 1 A flowchart of a method for encrypting vehicle gateway data according to an embodiment of the present invention;
[0035] Figure 2 A flowchart of a method for encrypting vehicle gateway data according to a specific embodiment of the present invention;
[0036] Figure 3 A block diagram of a device for encrypting vehicle gateway data according to an embodiment of the present invention;
[0037] Figure 4 The present invention is a block diagram of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0039] The following describes the encryption method, device, vehicle, medium and program product of the vehicle gateway data of the embodiment of the present invention with reference to the accompanying drawings. In view of the problems of low encryption efficiency, high energy consumption, low data transmission security, etc. mentioned in the above background technology, the present invention provides a vehicle gateway data encryption method, in which the data is divided into blocks, a unique initial key is generated using a hash function, and a new key is generated when each data block is encrypted, combined with symmetric encryption and public key encryption, and finally the encrypted data is transmitted through a secure channel. In this way, the problems of low encryption efficiency and low data transmission security existing in traditional encryption algorithms when processing large amounts of data are solved.
[0040] Specifically, Figure 1 A schematic flow chart of a method for encrypting vehicle gateway data is provided for an embodiment of the present invention.
[0041] like Figure 1 As shown, the encryption method of the vehicle gateway data includes the following steps:
[0042] In step S101, the current data to be encrypted, the current timestamp and the vehicle identification code of the vehicle gateway are obtained.
[0043] The current timestamp may be the current time. The Vehicle Identification Number (VIN) includes information such as the manufacturer, year, model, body type and code, engine code, and assembly location of the vehicle.
[0044] Optionally, the current timestamp can be obtained through a specific function call interface, and the vehicle identification number can be obtained through an online VIN detection tool.
[0045] In step S102, the data to be encrypted is divided into a plurality of data blocks, and an initial key is generated according to the current timestamp and the vehicle identification code, and an encryption key for each data block is generated according to the initial key. In one embodiment, the initial key is generated according to the current timestamp and the vehicle identification code, including: generating the initial key according to the current timestamp and the vehicle identification code based on a first key generation formula, wherein the first key generation formula is:
[0046] K=H(VIN∥timestamp∥nonce);
[0047] Among them, K is the initial key, H is the hash function, VIN is the vehicle identification number, timestamp is the timestamp, and nonce is a random number.
[0048] Furthermore, in one embodiment, generating an encryption key for each data block according to an initial key includes: obtaining a serial number of each data block; and generating an encryption key for each data block according to the initial key and the serial number of each data block.
[0049] Furthermore, in one embodiment, generating an encryption key for each data block according to an initial key includes: obtaining a serial number of each data block; and generating an encryption key for each data block according to the initial key and the serial number of each data block.
[0050] Optionally, in one embodiment, assuming that the amount of data to be encrypted is 600MB of encrypted data, the data to be encrypted can be divided into 600 data blocks of equal size according to the size of each data block of 1MB, and the sequence number of each data block can correspond to 1, 2, 3...600.
[0051] Furthermore, when the vehicle identification code VIN is 1HGCM82633A004352, the timestamp is 202407220833, and the random number is 123456, the hash function H in the first key generation formula can use the SHA-256 function. The SHA-256 function is a hash function algorithm standard that generates a 256-bit hash value for messages of any length. This function can generate a key based on the vehicle identification code, timestamp, and random number to ensure that the key is difficult to crack. The initial key can be expressed as:
[0052] K=H("1HGCM82633A004352202407220833123456")
[0053] K=SHA-256("1HGCM82633A004352202407220833123456")=0xA3B2C4...
[0054] Optionally, after the initial key is generated, the serial number of each data block is obtained to generate an encryption key for each corresponding data block. For any data block, for example, for data block 1, the encryption key of data block 1 can be generated by the initial key K and the hash function H, such as K1 = H (K ∥ 1), where K1 is the encryption key of data block 1. Specifically, the encryption key of data block 1 can be expressed as:
[0055] K1=SHA-256(0xA3B2C4...∥1)=0xD4E5F6...
[0056] Thus, the encryption key K1 corresponding to the data block P1 can be obtained.
[0057] In step S103, the initial key is encrypted according to a preset public key encryption algorithm to obtain an encrypted initial key, and the corresponding data block is encrypted according to the encryption key of each data block to obtain multiple encrypted data blocks, and the encrypted initial key and the multiple encrypted data blocks are transmitted to the target node.
[0058] Specifically, in one embodiment, the encrypted initial key is:
[0059] K encrypted =RSA-2048 public key (K);
[0060] Among them, K encrypted Initial key after encryption, RSA-2048 public key () is the preset public key encryption algorithm, and K is the initial key.
[0061] Further, in one embodiment, the plurality of encrypted data blocks are:
[0062] C i =E(K i ,P i );
[0063] Among them, C i is the i-th encrypted data block, E() is the encryption function, K i is the key of the ith data block, P i is the i-th data block.
[0064] Specifically, assuming that the content of the first data block P1 is "Block1 data", it is encrypted using the AES-256 function to obtain the first encrypted data block C1:
[0065] C1=AES-256(0xD4E5F6...,"Block1 data")=0x9A8B7C...
[0066] Repeat the above steps to encrypt all the remaining data blocks. For example, encrypt the second data block P2 to obtain the second data block key K2 and the second encrypted data block C2:
[0067] K2=H(K∥2)=SHA-256(0xA3B2C4...∥2)=0xG7H8I9...
[0068] C2=E(K2,P2)=AES-256(0xG7H8I9...,P2)=0xB1C2D3...
[0069] Thus, all encrypted data blocks and their corresponding encryption keys can be obtained.
[0070] It should be noted that after the encrypted initial key and multiple encrypted data blocks are transmitted to the target node, the encrypted data blocks need to be decrypted to obtain the initial data. Specifically, the encrypted initial key K can be decrypted by the private key decryption function encrypted , for example: K = RSA-2048 private key (K encrypted ). Among them, RSA-2048 private key () is the preset private key decryption algorithm. Further, the initial key K and the data block sequence number are used to generate the key K i , decrypted data block C i , for example, when decrypting the first data block C1:
[0071] K1=H(K∥1)=SHA-256(K∥1)
[0072] P1=D(K1,C1)=AES-256 decrypt (K1,C1)
[0073] Among them, K1 is the key of the first data block, P1 is the first data block, and D() is the decryption function, which can be AES-256 decrypt function.
[0074] Specifically, the encrypted data block C can be transmitted through a secure channel i , 600 encrypted data blocks are transmitted to the target node. Secondly, the initial key K is encrypted and transmitted using RSA-2048:
[0075] K encrypted =RSA-2048 public key (K) = 0xM1N2O3...
[0076] The encrypted initial key K encrypted Transfer to the target node.
[0077] Before decrypting the data block, the encrypted initial key K encrypted To decrypt, the target node can use the RSA-2048 private key decryption function, for example:
[0078] K = RSA-2048 privatekey (K encrypted )=0xA3B2C4...
[0079] Secondly, use the initial key K and the corresponding data block number to generate the corresponding key K i , decrypt the corresponding data block C i ,For example:
[0080] K1=H(K∥1)=SHA-256(0xA3B2C4...∥1)=0xD4E5F6...
[0081] P1=D(K1,C1)=AES-256 decrypt (0xD4E5F6...,0x9A8B7C...)="Block1 data"
[0082] Repeat the above steps to decrypt all other encrypted data blocks to obtain data. For example, for the second encrypted data block C2:
[0083] K2=H(K∥2)=SHA-256(0xA3B2C4...∥2)=0xG7H8I9...
[0084] P2=D(K2,C2)=AES-256 decrypt (0xG7H8I9...,0xB1C2D3...)=P2
[0085] In this way, all data can be encrypted for transmission and decrypted after receipt, which can improve the efficiency of encryption and decryption and enhance the security of data transmission.
[0086] In order to enable those skilled in the art to better understand the encryption method of vehicle gateway data in an embodiment of the present invention, the encryption method of vehicle gateway data in an embodiment of the present invention will be described in detail below in conjunction with specific embodiments.
[0087] Figure 2 The present invention is a flowchart of a method for encrypting vehicle gateway data according to a specific embodiment of the present invention.
[0088] First of all, it is necessary to explain the preset conditions of the specific embodiment of the present invention, where the data volume is 600MB, the data block size is 1MB, the hash function is SHA-256, the symmetric encryption algorithm is AES-256, the public key encryption algorithm is RSA-2048, the vehicle identification code VIN is 1HGCM82633A004352, the timestamp is 202407220833, and the random number is 123456.
[0089] like Figure 2 As shown, the specific steps of the vehicle gateway data encryption method are as follows:
[0090] In step S201, the data to be encrypted is divided into blocks.
[0091] Specifically, in one embodiment, the encrypted data with a data volume of 600 MB is divided into 600 data blocks, and the size of each data block is 1 MB.
[0092] In step S202, an initial key is generated using the vehicle identification code, a timestamp and a random number.
[0093] Specifically, in one embodiment, the data is substituted into the first key generation formula,
[0094] K=H(VIN∥timestamp∥nonce),
[0095] We can get:
[0096] K=H("1HGCM82633A004352202407220833123456").
[0097] Assume that the hash value generated by the hash function can be:
[0098] K=SHA-256("1HGCM82633A004352202407220833123456")=0xA3B2C4...
[0099] In step S203, each data block is encrypted.
[0100] Specifically, in one embodiment, for each data block P i To encrypt, first, generate the first data block key K1 using the hash function SHA-256:
[0101] K1=H(K∥1)
[0102] K1=SHA-256(0xA3B2C4...∥1)=0xD4E5F6....
[0103] Secondly, encrypt the first data block P1:
[0104] C1=E(K1,P1)
[0105] Assuming that the content of the first data block P1 is "Block1 data", it is encrypted using AES-256 to obtain the first encrypted data block C1:
[0106] C1=AES-256(0xD4E5F6...,"Block1 data")=0x9A8B7C...
[0107] Repeat the above steps to encrypt all remaining data blocks. For example, encrypt the second data block P2 to obtain the second data block key K2 and the second encrypted data block C2:
[0108] K2=H(K∥2)=SHA-256(0xA3B2C4...∥2)=0xG7H8I9...
[0109] C2=E(K2,P2)=AES-256(0xG7H8I9...,P2)=0xB1C2D3...
[0110] In step S204, the encrypted data block and the initial key are encrypted and transmitted.
[0111] Specifically, in one embodiment, the encrypted data block C is first transmitted through a secure channel. i , 600 encrypted data blocks are transmitted to the target node. Secondly, the initial key K is encrypted and transmitted using RSA-2048:
[0112] K encrypted =RSA-2048 public key (K) = 0xM1N2O3...
[0113] The encrypted initial key K encrypted Transfer to the target node.
[0114] In step S205, the initial key is decrypted and the encrypted data block is decrypted at the same time.
[0115] Specifically, in one embodiment, the target node decrypts the initial key K using the RSA-2048 private key:
[0116] K = RSA-2048 private key (K encrypted )=0xA3B2C4...
[0117] Secondly, use the initial key K and the data block number to generate the key K i , decrypted data block C i :
[0118] K1=H(K∥1)=SHA-256(0xA3B2C4...∥1)=0xD4E5F6...
[0119] P1=D(K1,C1)=AES-256 decrypt (0xD4E5F6...,0x9A8B7C...)="Block1 data"
[0120] Repeat the above steps to decrypt all other encrypted data blocks to obtain data. For example, for the second encrypted data block C2:
[0121] K2=H(K∥2)=SHA-256(0xA3B2C4...∥2)=0xG7H8I9...
[0122] P2=D(K2,C2)=AES-256 decrypt (0xG7H8I9...,0xB1C2D3...)=P2
[0123] In this way, all data can be encrypted for transmission and decrypted after receipt, which can improve encryption efficiency and reduce energy consumption while ensuring data transmission security.
[0124] According to the vehicle gateway data encryption method provided by the embodiment of the present invention, by dividing the data into blocks, using a hash function to generate a unique initial key, and generating a new key when encrypting each data block, combining symmetric encryption and public key encryption, and finally transmitting the encrypted data through a secure channel, the problems of low encryption efficiency and high energy consumption existing in traditional encryption algorithms when processing large amounts of data are solved. The security of vehicle data transmission is improved, encryption efficiency is improved, and energy consumption is reduced.
[0125] Next, the vehicle gateway data encryption device proposed according to an embodiment of the present invention is described with reference to the accompanying drawings.
[0126] Figure 3 4 is a block diagram of a device for encrypting vehicle gateway data according to an embodiment of the present invention.
[0127] like Figure 3 As shown, the vehicle gateway data encryption device 10 includes: an acquisition module 100, a generation module 200 and an encryption module 300.
[0128] Among them, the acquisition module 100 is used to obtain the current data to be encrypted, the current timestamp and the vehicle identification code of the vehicle gateway; the generation module 200 is used to divide the data to be encrypted into multiple data blocks, and generate an initial key according to the current timestamp and the vehicle identification code, and generate an encryption key for each data block according to the initial key; the encryption module 300 is used to encrypt the initial key according to a preset public key encryption algorithm to obtain an encrypted initial key, and encrypt the corresponding data block according to the encryption key of each data block to obtain multiple encrypted data blocks, and transmit the encrypted initial key and the multiple encrypted data blocks to the target node.
[0129] Further, in one embodiment, the generation module 200 is specifically used to: generate an initial key according to the current timestamp and the vehicle identification code based on a first key generation formula, wherein the first key generation formula is:
[0130] K=H(VIN∥timestamp∥nonce);
[0131] Among them, K is the initial key, H is the hash function, VIN is the vehicle identification number, timestamp is the timestamp, and nonce is a random number.
[0132] Furthermore, in one embodiment, the generation module 200 is further used to: obtain the serial number of each data block; and generate an encryption key for each data block according to the initial key and the serial number of each data block.
[0133] Furthermore, in one embodiment, the encryption module 300 is specifically used to obtain an encrypted initial key. The encrypted initial key is:
[0134] K encrypted =RSA-2048 public key (K);
[0135] Among them, K encrypted Initial key after encryption, RSA-2048 public key () is the preset public key encryption algorithm, and K is the initial key.
[0136] Further, in one embodiment, the encryption module 300 is specifically used to: generate multiple encrypted data blocks. The multiple encrypted data blocks are:
[0137] C i =E(K i ,P i );
[0138] Among them, C i is the i-th encrypted data block, E() is the encryption function, K i is the key of the ith data block, P i is the i-th data block.
[0139] Furthermore, in one embodiment, the encryption module 300 is further used to: decrypt the encrypted initial key K using the RSA-2048 private key encrypted , for example: K = RSA-2048 private key (K encrypted ). Among them, RSA-2048 private key () is the preset private key decryption algorithm.
[0140] Furthermore, in one embodiment, the encryption module 300 is further configured to: generate a key K using the initial key K and the data block sequence number. i , decrypted data block C i , for example, when decrypting the first data block C1:
[0141] K1=H(K∥1)=SHA-256(K∥1)
[0142] P1=D(K1,C1)=AES-256 decrypt (K1,C1)="Block1 data"
[0143] Among them, K1 is the key of the first data block, P1 is the first data block, and D() is the decryption function, which can be AES-256 decrypt function.
[0144] It should be noted that the aforementioned explanation of the embodiment of the vehicle gateway data encryption method is also applicable to the vehicle gateway data encryption device of this embodiment, and will not be repeated here.
[0145] The vehicle gateway data encryption device provided by the embodiment of the present invention divides the data into blocks, generates a unique initial key using a hash function, generates a new key when encrypting each data block, combines symmetric encryption and public key encryption, and finally transmits the encrypted data through a secure channel, thereby solving the problems of low encryption efficiency and high energy consumption in traditional encryption algorithms when processing large amounts of data. The security of vehicle data transmission is improved, encryption efficiency is improved, and energy consumption is reduced.
[0146] In addition, if Figure 4 As shown, an embodiment of the present invention further provides a vehicle, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the vehicle gateway data encryption method as described above.
[0147] Figure 4 A schematic diagram of the structure of a vehicle provided in an embodiment of the present invention. The vehicle may include:
[0148] Memory 401 , processor 402 , and a computer program stored in the memory 401 and executable on the processor 402 .
[0149] When the processor 402 executes the program, the vehicle gateway data encryption method provided in the above embodiment is implemented.
[0150] Furthermore, the vehicle further includes: a communication interface 403, which is used for communication between the memory 401 and the processor 402. The memory 401 is used to store a computer program that can be run on the processor 402. The memory 401 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0151] If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0152] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.
[0153] The processor 402 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0154] The vehicle proposed in the embodiment of the present invention solves the problems of low encryption efficiency and high energy consumption when the traditional encryption algorithm processes large amounts of data through the above-mentioned vehicle gateway data encryption device, thereby improving the security of vehicle data transmission, improving encryption efficiency, and reducing energy consumption.
[0155] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the above-mentioned vehicle gateway data encryption method is implemented.
[0156] In addition, an embodiment of the present invention further provides a computer program product, including a computer program, which is executed to implement any of the above-mentioned vehicle gateway data encryption methods.
[0157] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0158] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0159] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0160] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0161] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
Claims
1. A method for encrypting vehicle gateway data, characterized in that: The following steps are involved: Obtain the current data to be encrypted, current timestamp and vehicle identification code of the vehicle gateway; Dividing the data to be encrypted into multiple data blocks, generating an initial key according to the current timestamp and the vehicle identification code, and generating an encryption key for each data block according to the initial key; The initial key is encrypted according to a preset public key encryption algorithm to obtain an encrypted initial key, and the corresponding data block is encrypted according to the encryption key of each data block to obtain multiple encrypted data blocks, and the encrypted initial key and the multiple encrypted data blocks are transmitted to the target node.
2. The method according to claim 1, characterized in that: The generating of the initial key according to the current timestamp and the vehicle identification code comprises: Based on a first key generation formula, the initial key is generated according to the current timestamp and the vehicle identification code, wherein the first key generation formula is: K=H(VIN∥timestamp∥nonce); Wherein, K is the initial key, H is the hash function, VIN is the vehicle identification number, timestamp is the timestamp, and nonce is a random number.
3. The method according to claim 1 or 2, characterized in that: Generating an encryption key for each data block according to the initial key comprises: Obtaining the sequence number of each data block; An encryption key for each data block is generated according to the initial key and the sequence number of each data block.
4. The method according to claim 1 or 2, characterized in that: The encrypted initial key is: K encrypted =RSA-2048 publickey (K); Among them, K encrypted For the encrypted initial key, the RSA-2048 publickey () is the preset public key encryption algorithm, and K is the initial key.
5. The method according to claim 1, characterized in that The multiple encrypted data blocks are: C i =E(K i ,P i ); Among them, C i is the i-th encrypted data block, E() is the encryption function, K i is the key of the i-th data block, P i is the i-th data block.
6. A vehicle gateway data encryption device, characterized in that: include: An acquisition module, used to acquire the current data to be encrypted, the current timestamp and the vehicle identification code of the vehicle gateway; A generation module, used for dividing the data to be encrypted into a plurality of data blocks, generating an initial key according to a current timestamp and the vehicle identification code, and generating an encryption key for each data block according to the initial key; An encryption module is used to encrypt the initial key according to a preset public key encryption algorithm to obtain an encrypted initial key, and to encrypt the corresponding data block according to the encryption key of each data block to obtain multiple encrypted data blocks, and to transmit the encrypted initial key and the multiple encrypted data blocks to a target node.
7. The device according to claim 6, characterized in that The generation module is specifically used to generate the initial key based on a first key generation formula according to the current timestamp and the vehicle identification code, wherein the first key generation formula is: K=H(VIN∥timestamp∥nonce); Wherein, K is the initial key, H is the hash function, VIN is the vehicle identification number, timestamp is the timestamp, and nonce is a random number.
8. A vehicle, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the vehicle gateway data encryption method as described in any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the vehicle gateway data encryption method as described in any one of claims 1-5.
10. A computer program product, comprising a computer program, characterized in that The computer program is executed to implement the vehicle gateway data encryption method as described in any one of claims 1-5.
Citation Information
Cited By
Multi-channel data encryption method, device and equipment
CN119577816A