Device data encryption method, computer device, storage medium and program product

By obtaining the device hardware identification code and random seed text to generate the target key, encrypting the on-board ECU data, the problem of low data security in the prior art is solved, and efficient data encryption is achieved without upgrading the hardware.

CN119740245AActive Publication Date: 2025-04-01FOSS (HANGZHOU) INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411801059.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-01
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The prior art is difficult to effectively protect the equipment data of on-board ECUs that have been put into use without special hardware, resulting in low data security.

Method used

By responding to the encryption command, the device hardware identification code and corresponding random seed text are obtained, the random key pool file is generated, the target key is determined, and the device data is encrypted to obtain the ciphertext data.

Benefits of technology

Without hardware upgrades, the encryption of business data is achieved, ensuring that the target key of each device is unique, improving the difficulty of cracking, and improving the security of device data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740245A_ABST
    Figure CN119740245A_ABST
Patent Text Reader

Abstract

The invention relates to an equipment data encryption method, computer equipment, a storage medium and a program product. The method comprises the following steps: in response to an encryption instruction, obtaining an equipment hardware identification code of current equipment and a random seed text corresponding to the equipment hardware identification code; generating a random key pool file based on the equipment hardware identification code and the random seed text; determining a target key based on the random key pool file; and encrypting the device data of the current device based on the target key to obtain ciphertext data. By adopting the method, the equipment data security can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a device data encryption method, computer equipment, storage medium and program product. Background Art

[0002] Nowadays, a lot of sensitive business data is stored in the vehicle's ECU (Electronic Control Unit), such as communication keys, autonomous driving model files, driving history trajectories, in-vehicle videos, etc. If the business data is illegally obtained, it will cause vehicle information security problems.

[0003] In order to prevent illegal access, traditional technologies require special hardware support to protect sensitive information. However, this solution cannot be applied to the in-vehicle ECUs that are already in use and do not have special hardware.

[0004] It can be seen that the existing technology still has the problem of low data security of the vehicle-mounted equipment that has been put into use. Summary of the invention

[0005] Based on this, it is necessary to provide a device data encryption method, computer device, storage medium and program product that can improve the security of device data in response to the above technical problems.

[0006] In a first aspect, the present application provides a device data encryption method, the device data encryption method comprising:

[0007] In response to the encryption instruction, obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code;

[0008] Generate a random key pool file based on the device hardware identification code and the random seed text;

[0009] Based on the random key pool file, determining a target key;

[0010] The device data of the current device is encrypted based on the target key to obtain ciphertext data.

[0011] In one embodiment, the step of obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code includes:

[0012] Read the device hardware identification code of the current device;

[0013] Based on the number of bytes of the device hardware identification code, a random seed text corresponding to the number of bytes is generated.

[0014] In one embodiment, the random key pool file includes a byte matrix; generating the random key pool file based on the device hardware identification code and the random seed text includes:

[0015] Determine a first identification code based on the device hardware identification code;

[0016] Determine a second identification code based on the device hardware identification code and the random seed text;

[0017] Based on the first identification code and the second identification code, a byte matrix is ​​determined; the order of the byte matrix is ​​the same as the number of bytes of the device hardware identification code.

[0018] In one embodiment, determining the second identification code based on the device hardware identification code and the random seed text includes:

[0019] A second identification code is determined based on an XOR operation result of the device hardware identification code and the random seed text.

[0020] In one embodiment, determining the byte matrix based on the first identification code and the second identification code includes:

[0021] Sequentially shifting the first identification code left by N bytes to obtain a left-shifted string, and shifting the second identification code right by N bytes to obtain a right-shifted string; N is a positive integer less than or equal to the number of bytes;

[0022] The byte matrix is ​​determined based on the XOR operation result of each pair of the left-shifted character string and the right-shifted character string.

[0023] In one embodiment, determining the target key based on the random key pool file includes:

[0024] Based on the device hardware identification code and the random seed text, determine an index list of the random key pool file; the index list includes a plurality of tuples; each of the tuples includes a first element determined by the random seed file and a second element determined by the device hardware identification code; the number of the tuples is the same as the number of bytes of the device hardware identification code;

[0025] Based on each of the two-tuples, sequentially search for bytes in the random key pool file to obtain a plurality of index bytes;

[0026] Based on a plurality of the index bytes, the target key is determined.

[0027] In one embodiment, determining the index list of the random key pool file based on the device hardware identification code and the random seed text includes:

[0028] Determine a first element of an Nth 2-tuple based on an Nth byte of the random seed text;

[0029] Based on the Nth byte of the device hardware identification code, obtain the second element of the Nth 2-tuple;

[0030] N is a positive integer less than or equal to the number of bytes.

[0031] In one embodiment,

[0032] The obtaining the first element of the Nth binary group based on the Nth byte of the random seed text comprises: obtaining the first element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the random seed text and N;

[0033] Obtaining the second element of the Nth binary group based on the Nth byte of the device hardware identification code includes: obtaining the second element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the device hardware identification code and N.

[0034] In one embodiment, determining the target key based on the plurality of index bytes comprises:

[0035] Based on the multiple index bytes, a concatenated string is obtained;

[0036] A hash operation is performed based on the concatenated character string to determine the target key.

[0037] In one embodiment, the encrypting the device data of the current device based on the target key to obtain the ciphertext data further includes:

[0038] The ciphertext data is stored, and the target key and the device data are deleted.

[0039] In one embodiment, after storing the ciphertext data and deleting the target key and the device data, the step further includes:

[0040] Generate a target key based on the device hardware identification code and the random seed text;

[0041] Decrypting the ciphertext data based on the target key to obtain device data;

[0042] Based on the number of bytes of the device hardware identification code, generating an updated random seed text corresponding to the number of bytes;

[0043] Based on the updated random seed text, updating the random seed text;

[0044] Based on the device hardware identification code and the updated random seed text, updating the target key;

[0045] encrypting the device data based on the updated target key;

[0046] The ciphertext data is stored, and the target key and the device data are deleted.

[0047] In a second aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above method when executing the computer program.

[0048] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method described above when executed by a processor.

[0049] In a fourth aspect, the present application provides a computer program product, which implements the method described above when executed by a processor.

[0050] The above-mentioned device data encryption method, computer device, storage medium and program product obtain the device hardware identification code of the current device and the random seed text corresponding to the device hardware identification code by responding to the encryption instruction; generate a random key pool file based on the device hardware identification code and the random seed text; determine the target key based on the random key pool file; encrypt the device data of the current device based on the target key to obtain ciphertext data, and can implement the encryption process of business data without upgrading the hardware of the device. Since the encryption key is generated based on the device characteristics and random text, it can ensure that the target key of each device is unique, and one machine and one secret are achieved, which can effectively increase the difficulty of cracking by a third party and achieve the effect of improving the security of device data. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A diagram of an application environment of a device data encryption method in an embodiment;

[0052] Figure 2 It is a schematic diagram of a flow chart of a device data encryption method in one embodiment;

[0053] Figure 3 It is a flowchart of a method for encrypting device data in another embodiment;

[0054] Figure 4 A schematic diagram of a process for generating a random key pool file in one embodiment;

[0055] Figure 5A schematic diagram of a process for generating an index list in one embodiment;

[0056] Figure 6 A schematic diagram of a process for generating a target key in one embodiment;

[0057] Figure 7 It is a structural block diagram of a device data encryption apparatus in one embodiment;

[0058] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] The device data encryption method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. It can be understood that the device data of the present application can be not limited to the device data encryption of the vehicle-mounted electronic control unit ECU, and can also be applied to the data encryption of other terminals. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In response to the encryption instruction, the terminal 102 obtains the device hardware identification code of the current device, and the random seed text corresponding to the device hardware identification code; based on the device hardware identification code and the random seed text, a random key pool file is generated; based on the random key pool file, the target key is determined; based on the target key, the device data of the current device is encrypted to obtain ciphertext data. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0061] In one embodiment, Figure 2 As shown, a device data encryption method is provided, which is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:

[0062] Step S100, in response to the encryption instruction, obtaining the device hardware identification code of the current device and the random seed text corresponding to the device hardware identification code.

[0063] The device hardware identification code may be information that uniquely identifies a hardware device, such as a MAC address, a serial number, etc.

[0064] The random seed text may be a string or number obtained based on a random generation algorithm. The random seed text corresponds to the device hardware identification code and may be randomly generated based on the characteristics of the device hardware identification code, the environmental parameters at the time of obtaining the device hardware identification code, etc. For example, the random seed text may be generated based on the byte length of the device hardware identification code itself, or based on the timestamp when the device hardware identification code is obtained, environmental noise, etc.

[0065] By generating a random seed text, the unpredictability of the target key can be improved, thereby achieving the effect of improving the security of device data.

[0066] Step S200: Generate a random key pool file based on the device hardware identification code and the random seed text.

[0067] The random key pool file may be a data set containing multiple candidate keys. The multiple candidate keys in the random key pool file may be created according to a preset rule, in combination with the device hardware identification code and the random seed text.

[0068] Exemplarily, generating a random key pool file may be to transform the device hardware identification code and / or random seed text multiple times according to preset rules, and concatenate the device hardware identification code and random seed text under each transformation, and perform hash operation on the concatenated string to obtain multiple hash values ​​of fixed length, thereby obtaining a random key pool file; it may also be to use the device hardware identification code as the master key and the random seed file as additional information, and generate multiple groups of independent keys based on a key derivation function to obtain a random key pool file; it may also be based on elliptic curve cryptography, using the device hardware identification code and random seed text as private keys to generate multiple candidate keys, thereby obtaining a random key pool file; it may also be other methods based on the device hardware identification code and random seed text to obtain multiple candidate keys through transformation and operation, which are not limited to this embodiment.

[0069] Step S300: determining a target key based on the random key pool file.

[0070] Among them, determining the target key based on the random key pool file can be to select one of the candidate keys as the target key; it can also be to further process the selected key to obtain the target key, for example, it can be obtained by performing a hash operation on the selected key; it can also be to select one or more candidate keys in the random key pool file according to preset rules, and select one or more characters or bytes in the candidate keys as the target key, or perform further processing to obtain the target key.

[0071] Step S400: encrypt the device data of the current device based on the target key to obtain ciphertext data.

[0072] Among them, the device data may be sensitive data that needs to be encrypted in the current device, and may include, for example, business data such as communication keys, autonomous driving model files, driving history trajectories, and in-car videos. For example, when the communication key needs to be encrypted as device data, the target key is generated by the device hardware identification code of the current device and the corresponding random seed text, and the communication key is encrypted by the target key to obtain ciphertext data.

[0073] Encryption through the selected target key can ensure that the ciphertext data can only be decrypted when the target key is correct. To encrypt device data, the target key can be used to encrypt the device data using a symmetric encryption algorithm to obtain ciphertext data.

[0074] Furthermore, when the device data needs to be used, the target key can be generated through the random key pool file of the current device and the corresponding random seed text, and the ciphertext data can be decrypted through the target key to obtain the device data, so that the device data can be used and further processed.

[0075] A device data encryption method provided in this embodiment obtains a device hardware identification code of a current device and a random seed text corresponding to the device hardware identification code in response to an encryption instruction; generates a random key pool file based on the device hardware identification code and the random seed text; determines a target key based on the random key pool file; and encrypts the device data of the current device based on the target key to obtain ciphertext data. The encryption process of business data can be implemented without upgrading the hardware of the device. Since the encryption key is generated based on the device characteristics and the random text, it can ensure that the target key of each device is unique, and one machine and one secret are implemented, which can effectively increase the difficulty of cracking by a third party and achieve the effect of improving the security of device data.

[0076] In one embodiment, the step of obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code includes:

[0077] Read the device hardware identification code of the current device;

[0078] Based on the number of bytes of the device hardware identification code, a random seed text corresponding to the number of bytes is generated.

[0079] Among them, reading the device hardware identification code of the current device may be accessing a path storing the device hardware identification code in the current device to complete the extraction of the device hardware identification code.

[0080] The number of bytes may be the data length occupied by the device hardware identification code, that is, the number of bytes included in the device hardware identification code.

[0081] Based on the number of bytes of the device hardware identification code, a random seed text corresponding to the number of bytes is generated. This may be based on the number of bytes of the device hardware identification code, generating a random seed text with the same number of bytes as the number of bytes.

[0082] Exemplarily, the generation of random seed text may be implemented by using a pseudo-random number generator, or may be implemented by using other secure random number generation algorithms.

[0083] The device data encryption method provided in this embodiment creates a random seed text of the same size. Since the generated random seed text matches the size of the hardware identification code, subsequent calculation processing can be performed more efficiently, which increases the difficulty for attackers to guess or crack the key, thereby achieving the effect of improving the security of device data.

[0084] In one embodiment, the random key pool file includes a byte matrix; generating the random key pool file based on the device hardware identification code and the random seed text includes:

[0085] Determine a first identification code based on the device hardware identification code;

[0086] Determine a second identification code based on the device hardware identification code and the random seed text;

[0087] A byte matrix is ​​determined based on the first identification code and the second identification code.

[0088] The first identification code may be a device hardware identification code directly, or a unique value generated according to the device hardware identification code. For example, the device hardware identification code may be transformed or calculated to obtain a first identification code of a fixed length.

[0089] The second identification code can be obtained based on the combination of the device hardware identification code and the random seed text. For example, the device hardware identification code and the random seed text can be concatenated or characters at specific positions can be extracted, and the concatenated or extracted character string can be transformed and calculated to obtain the second identification code, thereby further increasing the complexity of the identification code.

[0090] The byte matrix can be a two-dimensional array structure, and the order of the byte matrix is ​​the same as the number of bytes of the device hardware identification code. Based on the first identification code and the second identification code, the byte matrix is ​​determined, and the byte matrix can be generated by using the first identification code and the second identification code as input parameters, such as by mixed hashing, pseudo-random number generation, etc. This can enhance the diversity of the key, and because the size of the matrix is ​​associated with the device hardware identification code, the difficulty of cracking can be further increased.

[0091] In the process of generating the byte matrix, the matrix can also be filled by repeatedly applying the hash function and the pseudo-random number generator to ensure that the bytes at each position are random and unpredictable. In order to improve efficiency and reduce storage requirements, it is possible to consider dynamically generating the byte matrix only when needed, rather than storing the entire matrix in advance.

[0092] A device data encryption method provided in this embodiment can generate a random key pool file more precisely and securely by determining a byte matrix according to the device hardware identification code and random seed text, and based on the first identification code and the second identification code, thereby achieving the effect of improving the security of device data.

[0093] In one embodiment, determining the second identification code based on the device hardware identification code and the random seed text includes:

[0094] A second identification code is determined based on an XOR operation result of the device hardware identification code and the random seed text.

[0095] Among them, the XOR operation obtains the result of 0 or 1 according to the same or different input bits. Since the byte length of the device hardware identification code and the random seed text is equal, the binary bit value of the device hardware identification code and the random seed text can be XORed bit by bit to obtain the result after the XOR operation. When the byte length of the device hardware identification code and the random seed text are not equal, the length of the two strings used in the XOR operation can be made equal by truncating the longer string, filling the shorter string, or using circular filling.

[0096] A device data encryption method provided in this embodiment obtains a second identification code through an XOR operation, which can provide a certain degree of data obfuscation, making it difficult for an attacker to infer the complete second identification code based on only partial information, thereby enhancing the security and unpredictability of the generated second identification code, and achieving the effect of improving the security of device data.

[0097] In one embodiment, determining the byte matrix based on the first identification code and the second identification code includes:

[0098] Sequentially shifting the first identification code left by N bytes to obtain a left-shifted string, and shifting the second identification code right by N bytes to obtain a right-shifted string;

[0099] The byte matrix is ​​determined based on the XOR operation result of each pair of the left-shifted character string and the right-shifted character string.

[0100] Wherein, N is a positive integer less than or equal to the number of bytes. Shifting the identification code by N bytes may be shifting the first identification code by a number of bits in binary representation.

[0101] In this embodiment, the first identification code and the second identification code may be shifted N times respectively, and the number of bytes shifted each time increases progressively from 1 to N. The left shift and right shift may be determined to shift the identification code toward the high or low bits according to a preset setting.

[0102] The following uses the example of left shift to move data to the higher bit direction and right shift to move data to the lower bit direction to explain:

[0103] Shifting the first identification code left by N bytes can mean moving the data toward the high-order direction by N bytes. Taking the first identification code as 0x12345678 as an example, shifting the first identification code by 1 byte can mean obtaining a result of 0x34567812 or 0x34567800. You can set whether the overflowed bytes after the left shift are filled into the original low-order area.

[0104] Shifting the second identification code right by N bytes may mean moving the data toward the low-order direction by N bytes. Taking the second identification code as 0x9ABCDEF0 as an example, shifting the second identification code by 1 byte may result in 0x009ABCDE or 0xF09ABCDE. It may be set whether the overflowed bytes after the right shift are filled into the original high-order area.

[0105] It can be understood that by N times of bit-by-bit shifting, N pairs of left-shifted character strings and right-shifted character strings can be obtained. Furthermore, based on the XOR operation results of each pair of the left-shifted character string and the right-shifted character string, all the XOR operation results can be combined into a two-dimensional array to obtain a byte matrix with the same order as the device hardware identification code.

[0106] A device data encryption method provided in this embodiment increases encryption strength and complexity, increases cracking difficulty, and can achieve the effect of improving device data security by sequentially left-shifting the first identification code and right-shifting the second identification code according to different step sizes to obtain multiple pairs of left-shifted character strings and right-shifted character strings, and then performing XOR operations to obtain byte matrices.

[0107] In one embodiment, determining the target key based on the random key pool file includes:

[0108] Determine an index list of the random key pool file based on the device hardware identification code and the random seed text;

[0109] Based on each of the two-tuples, sequentially search for bytes in the random key pool file to obtain a plurality of index bytes;

[0110] Based on a plurality of the index bytes, the target key is determined.

[0111] In this embodiment, an index list is obtained through the device hardware identification code and the random seed text, and multiple bytes in the random key pool file are searched according to the index list, so as to obtain the target key in combination.

[0112] The index list is a data structure including multiple tuples, and each tuple can point to a specific position in the random key pool file.

[0113] The target key is generated by obtaining multiple bytes in the random key pool file through the index list. The bytes in the random key pool file are extracted through the index list, making it difficult for a third party to obtain the complete target key when analyzing the current device. Compared with hard coding in the current device, it can increase the difficulty for a third party to analyze the current device and obtain the target key.

[0114] Each of the two-tuples includes a first element determined by the random seed file and a second element determined by the device hardware identification code; the number of the two-tuples is the same as the number of bytes of the device hardware identification code.

[0115] The first element may be generated by sequentially calculating multiple values ​​according to the random seed text as the first element in each tuple. The second element may be generated by sequentially calculating multiple values ​​according to the device hardware identification code as the second element in each tuple.

[0116] Based on each of the two tuples, the bytes in the random key pool file are searched in turn to obtain multiple index bytes. The candidate key in the random key pool file can be determined according to the first element in each two tuple, and the corresponding byte in the candidate key is determined according to the second element as the candidate byte corresponding to the two tuple.

[0117] The target key may be determined based on the multiple index bytes, and the multiple index bytes may be arranged in a binary order or in a preset order to obtain the target key.

[0118] A device data encryption method provided in this embodiment establishes an index list to search for bytes in the random key pool file, obtains multiple index bytes, and then obtains the target key. This can avoid the situation where a single candidate key is successfully decrypted. By splicing partial contents of multiple candidate keys, security can be further improved, thereby achieving the effect of improving the security of device data.

[0119] In one embodiment, determining the index list of the random key pool file based on the device hardware identification code and the random seed text includes:

[0120] Determine a first element of an Nth 2-tuple based on an Nth byte of the random seed text;

[0121] Based on the Nth byte of the device hardware identification code, a second element of the Nth tuple is obtained.

[0122] Wherein, N is a positive integer less than or equal to the number of bytes. By determining the second element and the first element according to the number of bytes of the device hardware identification code, a tuple having the same number of groups as the number of bytes of the device hardware identification code can be obtained, and the second element of each tuple is associated with the device hardware identification code.

[0123] For example, taking the random seed text 0x9ABCDEF0 as an example, when N is 1, byte 9A is taken to obtain the first element of the first tuple. The first element can be obtained according to the Nth byte, or the Nth byte can be transformed so that the maximum value of the first element is less than or equal to the number of bytes of the candidate key. For example, the first element can be obtained by taking the remainder operation, normalizing and then rounding the Nth byte.

[0124] Similarly, taking the device hardware identification code of 0x12345678 as an example, when N is 1, byte 12 is taken to obtain the second element of the first tuple. It can be understood that the second element can be obtained according to the Nth byte, or the Nth byte can be transformed so that the maximum value of the second element is less than or equal to the number of candidate keys. Exemplarily, the second element can be obtained by taking the remainder operation, normalizing and rounding the Nth byte, etc.

[0125] By extracting the Nth byte from 1 to N multiple times, N tuples can be obtained, thereby establishing an index list.

[0126] A device data encryption method provided in this embodiment can make each tuple accurately reflect the information of the device hardware identification code and the random seed text, so that the index list has a high uniqueness, enhances the security of the target key, and ensures that even when facing the same device model, as long as the hardware identification code is different, the generated target key will also be different, thereby improving the security of sensitive data in the vehicle-mounted ECU and enhancing the robustness of the entire encryption mechanism, thereby achieving the effect of improving the security of device data.

[0127] In one embodiment,

[0128] The method of obtaining the first element of the Nth binary group based on the Nth byte of the random seed text includes: obtaining the first element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the random seed text and N.

[0129] Among them, the first element is determined by the Nth byte, and the Nth byte can be converted into a decimal number. For example, when the Nth byte is 9A, the decimal value is 154. Further, 154 is modulo N. For example, when N is 3, the modulo result of 154 and N is 1.

[0130] Obtaining the second element of the Nth binary group based on the Nth byte of the device hardware identification code includes: obtaining the second element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the device hardware identification code and N.

[0131] The second element is determined by the Nth byte, which may be converted into a decimal number. For example, when the Nth byte is 12, the decimal value is 18. Further, 18 is modulo N. For example, when N is 3, the modulo result of 154 and N is 0. It is understandable that in the actual execution process of a computer program, the index is usually started from bit 0, so the 0th candidate key is the 1st candidate key in the random key pool file.

[0132] A device data encryption method provided in this embodiment can map a larger numerical value into a small range through a modulo operation, thereby simplifying the index generation process and increasing the randomness of the index value, making it difficult for attackers to infer the index value through simple mathematical relationships, thereby achieving the effect of improving the security of device data.

[0133] In one embodiment, determining the target key based on the plurality of index bytes comprises:

[0134] Based on the multiple index bytes, a concatenated string is obtained;

[0135] A hash operation is performed based on the concatenated character string to determine the target key.

[0136] The index byte is a byte extracted from the random key pool according to the index list, and the concatenated string can be a string formed by connecting multiple index bytes in a preset order.

[0137] The target key is determined by performing a hash operation based on the concatenated character string. The target key may be obtained by converting data of any length into an output of a fixed length using a one-way encryption algorithm using a hash operation.

[0138] A device data encryption method provided in this embodiment obtains a concatenated string by splicing based on multiple index bytes; performs a hash operation based on the concatenated string to determine the target key, thereby generating a highly unique and secure target key, thereby achieving the effect of improving the security of device data.

[0139] In one embodiment, the encrypting the device data of the current device based on the target key to obtain the ciphertext data further includes:

[0140] The ciphertext data is stored, and the target key and the device data are deleted.

[0141] Among them, a secure and reliable storage location can be determined to save the encrypted data. This can be the internal memory of the vehicle ECU, an external storage device or a cloud storage service, and the encrypted data is written to the selected storage medium. To ensure data integrity and security, the security features provided by the file system can be used, such as permission control and access auditing.

[0142] Deleting the target key and the device data may be deleting the target key and the device data in the memory to ensure that a third party does not obtain the target key by reading the memory, thereby preventing data leakage and effectively protecting sensitive data in the vehicle-mounted ECU.

[0143] The device data encryption method provided in this embodiment can prevent a third party from obtaining the target key by reading the memory, thereby improving the security of the device data by storing the ciphertext data and deleting the target key and the device data.

[0144] In one embodiment, after storing the ciphertext data and deleting the target key and the device data, the step further includes:

[0145] Generate a target key based on the device hardware identification code and the random seed text;

[0146] Decrypting the ciphertext data based on the target key to obtain device data;

[0147] Based on the number of bytes of the device hardware identification code, generating an updated random seed text corresponding to the number of bytes;

[0148] Based on the updated random seed text, updating the random seed text;

[0149] Based on the device hardware identification code and the updated random seed text, updating the target key;

[0150] encrypting the device data based on the updated target key;

[0151] The ciphertext data is stored, and the target key and the device data are deleted.

[0152] In this embodiment, a data encryption method for updating a random seed text is provided, and data leakage caused by seed fixation can be prevented by updating the random seed text.

[0153] Based on the device hardware identification code and the random seed text, the target key is generated. The target key generation method adopted in any of the above embodiments may be adopted, which will not be described in detail in this embodiment.

[0154] Since the ciphertext data is obtained by symmetrically encrypting the device data with the target key, if the target key is correct, the device data can be decrypted with the target key.

[0155] Based on the number of bytes of the device hardware identification code, an updated random seed text corresponding to the number of bytes is generated, which may be a random seed text with the same number of bytes, recorded as the updated random seed text.

[0156] After the random seed text is updated based on the updated random seed text, the target key is updated based on the device hardware identification code and the updated random seed text. The target key corresponding to the updated random seed text can be generated based on the device hardware identification code and the updated random seed text according to the same target key generation method as that for generating the target key based on the device hardware identification code and the random seed text, and the target key is updated based on the key, and then the device data is re-encrypted according to the target key to obtain the ciphertext data under the new random seed text.

[0157] The device data encryption method provided in this embodiment can significantly improve the security of the system by regularly updating the random seed text and the target key. Even if the previous key is leaked, the updated key prevents the attacker from accessing the latest encrypted data, ensuring that the data is always under the latest encryption protection, thereby achieving the effect of improving the security of device data.

[0158] In order to more clearly illustrate the technical solution of the present application, the present application also provides a detailed embodiment.

[0159] In one embodiment, Figure 3 As shown, a device data encryption method is provided, comprising:

[0160] 1. Key initialization phase

[0161] The main work of this stage is to read the unique hardware ID inside the vehicle ECU and generate a seed and store it in the ECU's flash, and use the ID and seed as input to generate a random key pool file (KPF). Among them, the unique hardware ID is the device hardware identification code, and the seed is the random seed text. The detailed process is as follows:

[0162] Step 1.1, read the ID, after the vehicle ECU is started, read the device hardware identification code ID of the ECU internal hardware.

[0163] Step 1.2: The ECU uses a pseudo-random number generator to generate a random seed text seed and stores it in the ECU's flash. The length of the seed is the same as the length of the device hardware identification code ID in bytes.

[0164] Step 1.3, initialize two variables in the ECU memory, namely the first identification code L-ID and the second identification code R-ID, where the first identification code L-ID is assigned by the device hardware identification code ID, and the second identification code R-ID is assigned by the XOR operation result of the device hardware identification code ID and the random seed text seed, that is, R-ID = ID xor seed.

[0165] Step 1.4, initialize an n-order byte matrix nSmatrix in the ECU memory, where n is the length of the ID in step 1.1 in bytes.

[0166] Step 1.5, assigning a value to the byte matrix nSmartix, this step is to perform the following operation on the first identification code L-ID and the second identification code R-ID in step 1.3 and assign the value to nSmartix, such as Figure 4 As shown, the specific process is as follows:

[0167] Step 1.5.1, the first row of the byte matrix nSmartix is ​​equal to the result of the XOR operation of the first identification code L-ID circularly shifted left by 1 byte and the second identification code R-ID circularly shifted right by 1 byte.

[0168] Step 1.5.2, the second row of the byte matrix nSmartix is ​​equal to the result of the XOR operation of the first identification code L-ID circularly shifted left by 2 bytes and the second identification code R-ID circularly shifted right by 2 bytes.

[0169] The subsequent steps are analogous, and the nth row of nSmartix is ​​equal to the result of the XOR operation of the first identification code L-ID circularly shifted left by n bytes and the second identification code R-ID circularly shifted right by n bytes.

[0170] 2. Key WK Generation Phase

[0171] The main work of this stage is to generate the work key WK (WorkKey) used for encryption later, i.e. the target key, through the device hardware identification code ID, random seed text seed and byte matrix nSmatrix generated in step 1 through the multi-dimensional key derivator (MDKD). The detailed process of the multi-dimensional key derivator is as follows:

[0172] Step 2.1, such as Figure 5 As shown, n tuples are generated using the random seed text seed and the device hardware identification code ID, where n is the length of the device hardware identification code ID in byte in step 1.1. The specific process is as follows:

[0173] Step 2.1.1, take the first byte of the random seed text seed, convert the byte into an unsigned integer recorded as Sunit1, then calculate sI-1=Sunit1 mode n, and so on to calculate sI-n, so as to obtain the first element of each tuple.

[0174] Step 2.1.2, take the first byte of the device hardware identification code ID, convert the byte into an unsigned integer and record it as Dunit1, then calculate DI-1=Dunit1moden, and so on to calculate DI-n, so as to obtain the second element of each tuple.

[0175] Step 2.1.3, use sI-n calculated in 2.1.1 as the first element and DI-n calculated in 2.1.2 as the second element, generate n binary groups (sI-1, DI-1)…(sI-n, DI-n) recorded as IndexBinarySet, which is the index list for subsequent calculations.

[0176] Step 2.2, such as Figure 6 As shown, with the index list IndexBinarySet as the index, the corresponding bytes are read from the byte matrix nSmartix generated in step 1 in sequence, and concatenated one by one to generate a string of length n, which is recorded as the concatenated string prebinarystring.

[0177] Step 2.3, obtain the target key WK by performing a hash operation on the concatenated string prebinarystring, where WK = hash (prebinarystring).

[0178] 3. Business Data Encryption Phase

[0179] The main task of the business encryption phase is to use the WK generated in the key WK generation phase as the target secret key to encrypt the business data (textdata) into ciphertext data (encryptedata), and then store the ciphertext data encryptedata in the storage of the ECU, and delete the target key WK to prevent the attacker from memory dump attacks and business data textdata. The business data in this embodiment is the device data.

[0180] 4. Business Data Decryption Phase

[0181] The main task of the business encryption and decryption segment is to use the WK generated in the key WK generation phase as the secret key to decrypt the ciphertext data (encryptedata) into business data (textdata), and delete WK to prevent memory dump attacks by attackers.

[0182] 5. Key WK Update Phase

[0183] Step 5.1, using the key initialization phase, key WK generation phase and business data decryption phase, decrypt the business data textdata;

[0184] Step 5.2, regenerate the random seed text using step 1.2, recalculate the key initialization phase and the key WK generation phase process, and generate a new target key WK;

[0185] Step 5.3, use the new target key WK to perform the business data encryption phase.

[0186] In a specific embodiment, the device data encryption method is applied to an autonomous driving system, wherein the autonomous driving system (ADS) needs to be injected with SecOC before loading, and SecOC uses the communication key SecocKey for communication, and it is required that SecocKey must not be stored in plain text. Then, the steps of the key initialization phase and the key WK generation phase can be performed, and when the SecocKey is injected into the ADS on the production line, the ADS system uses the generated WK as the encryption key to encrypt SecocKey, encrypts SecocKey to generate ciphertext data EncryptoSecocKey, and stores it in the internal flash of the ADS, while clearing WK ​​and intermediate process data in the memory. When the ADS needs to use SecocKey, the target key WK can be calculated at zero time in the same way as in the key WK generation phase, and the AES-256 decryption algorithm can be used, with WK as the key and EncryptoSecocKey as the ciphertext, to decrypt and obtain Secockey, and at the same time delete WK and process data. The ADS system uses SecocKey for normal business, and the execution is complete and supports the deletion of SecocKey.

[0187] It is understandable that the random key pool file can be generated outside the ECU or inside the ECU. The random seed text can be a random number generated inside the ECU or the hardware ID of the ECU.

[0188] This embodiment provides a device data encryption method, which uses the internal hardware unique ID of the vehicle-mounted ECU and the seed generated by the pseudo-random number generator as two input parameters, and generates a one-machine-one-secret key through special changes in the scheme to encrypt the internal data of the user ECU.The hardware ID ensures the uniqueness of the key, and the seed ensures the unpredictability of the key. At the same time, the seed is variable data stored in the internal flash of the ECU. The encryption key is updated by updating the seed value, which prevents the problem that the vehicle-mounted ECU can only use one key during the product life cycle, thereby improving the security of encryption; by responding to the encryption instruction, the device hardware identification code of the current device and the random seed text corresponding to the device hardware identification code are obtained; based on the device hardware identification code and the random seed text, a random key pool file is generated; based on the random key pool file, the target key is determined; based on the target key, the device data of the current device is encrypted to obtain By converting the encrypted data into ciphertext data, the encryption process of business data can be realized without upgrading the hardware of the device. Since the encryption key is generated based on the device characteristics and random text, it can effectively increase the difficulty of cracking by a third party, thereby achieving the effect of improving the security of device data. By creating a random seed text of the same size, since the generated random seed text matches the size of the hardware identification code, subsequent calculations can be performed more efficiently, increasing the difficulty for attackers to guess or crack the key, thereby achieving the effect of improving the security of device data. By determining the byte matrix based on the device hardware identification code and the random seed text, and based on the first identification code and the second identification code, a more precise and secure generation of A random key pool file is formed, thereby achieving the effect of improving the security of device data; the second identification code is obtained by XOR operation, which can provide a certain degree of data obfuscation, making it difficult for an attacker to infer the complete second identification code based on only partial information, thereby enhancing the security and unpredictability of the generated second identification code, and achieving the effect of improving the security of device data; by sequentially performing byte left shifting on the first identification code and byte right shifting on the second identification code according to different step sizes, a plurality of pairs of left-shifted character strings and right-shifted character strings are obtained, and then performing XOR operation to obtain a byte matrix, which can increase the encryption strength and complexity, increase the difficulty of cracking, and achieve the effect of improving the security of device data; by establishing an index list to search for the random The bytes in the key pool file are used to obtain multiple index bytes, and then the target key is obtained, which can avoid the situation where a single candidate key is successfully decrypted. By splicing part of the content of multiple candidate keys, the security can be further improved, thereby achieving the effect of improving the security of device data; each tuple accurately reflects the information of the device hardware identification code and the random seed text, so that the index list has a high degree of uniqueness, enhances the security of the target key, and ensures that even in the face of the same device model, as long as the hardware identification code is different, the generated target key will be different, which improves the security of sensitive data in the vehicle-mounted ECU and enhances the robustness of the entire encryption mechanism, thereby achieving the effect of improving the security of device data.

[0189] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0190] Based on the same inventive concept, the embodiment of the present application also provides a device data encryption device for implementing the device data encryption method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more device data encryption device embodiments provided below can refer to the limitations on the device data encryption method above, and will not be repeated here.

[0191] In one embodiment, Figure 7 As shown, a device data encryption device is provided, comprising: an acquisition module, a generation module, a key module and an encryption module, wherein:

[0192] An acquisition module, configured to acquire, in response to the encryption instruction, a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code;

[0193] A generating module, used for generating a random key pool file based on the device hardware identification code and the random seed text;

[0194] A key module, used for determining a target key based on the random key pool file;

[0195] The encryption module is used to encrypt the device data of the current device based on the target key to obtain ciphertext data.

[0196] In one embodiment, the acquisition module is further used for:

[0197] Read the device hardware identification code of the current device;

[0198] Based on the number of bytes of the device hardware identification code, a random seed text corresponding to the number of bytes is generated.

[0199] In one embodiment, the random key pool file includes a byte matrix; the generation module is further used to:

[0200] Determine a first identification code based on the device hardware identification code;

[0201] Determine a second identification code based on the device hardware identification code and the random seed text;

[0202] Based on the first identification code and the second identification code, a byte matrix is ​​determined; the order of the byte matrix is ​​the same as the number of bytes of the device hardware identification code.

[0203] In one embodiment, the generating module is further used for:

[0204] A second identification code is determined based on an XOR operation result of the device hardware identification code and the random seed text.

[0205] In one embodiment, the generating module is further used for:

[0206] Sequentially shifting the first identification code left by N bytes to obtain a left-shifted string, and shifting the second identification code right by N bytes to obtain a right-shifted string; N is a positive integer less than or equal to the number of bytes;

[0207] The byte matrix is ​​determined based on the XOR operation result of each pair of the left-shifted character string and the right-shifted character string.

[0208] In one embodiment, the key module is further used for:

[0209] Based on the device hardware identification code and the random seed text, determine an index list of the random key pool file; the index list includes a plurality of tuples; each of the tuples includes a first element determined by the random seed file and a second element determined by the device hardware identification code; the number of the tuples is the same as the number of bytes of the device hardware identification code;

[0210] Based on each of the two-tuples, sequentially search for bytes in the random key pool file to obtain a plurality of index bytes;

[0211] Based on a plurality of the index bytes, the target key is determined.

[0212] In one embodiment, the key module is further used for:

[0213] Determine a first element of an Nth 2-tuple based on an Nth byte of the random seed text;

[0214] Based on the Nth byte of the device hardware identification code, obtain the second element of the Nth 2-tuple;

[0215] N is a positive integer less than or equal to the number of bytes.

[0216] In one embodiment,

[0217] The obtaining the first element of the Nth binary group based on the Nth byte of the random seed text comprises: obtaining the first element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the random seed text and N;

[0218] Obtaining the second element of the Nth binary group based on the Nth byte of the device hardware identification code includes: obtaining the second element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the device hardware identification code and N.

[0219] In one embodiment, the key module is further used for:

[0220] Based on the multiple index bytes, a concatenated string is obtained;

[0221] A hash operation is performed based on the concatenated character string to determine the target key.

[0222] In one embodiment, the device comprises a cleaning module for:

[0223] The ciphertext data is stored, and the target key and the device data are deleted.

[0224] In one embodiment, the device further includes an updating module, configured to:

[0225] Generate a target key based on the device hardware identification code and the random seed text;

[0226] Decrypting the ciphertext data based on the target key to obtain device data;

[0227] Based on the number of bytes of the device hardware identification code, generating an updated random seed text corresponding to the number of bytes;

[0228] Based on the updated random seed text, updating the random seed text;

[0229] Based on the device hardware identification code and the updated random seed text, updating the target key;

[0230] encrypting the device data based on the updated target key;

[0231] The ciphertext data is stored, and the target key and the device data are deleted.

[0232] Each module in the above-mentioned device data encryption device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module above.

[0233] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store random seed text and ciphertext data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a device data encryption method is implemented.

[0234] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0235] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the device data encryption method of any of the above embodiments is implemented:

[0236] In response to the encryption instruction, obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code;

[0237] Generate a random key pool file based on the device hardware identification code and the random seed text;

[0238] Based on the random key pool file, determining a target key;

[0239] The device data of the current device is encrypted based on the target key to obtain ciphertext data.

[0240] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the device data encryption method of any of the above embodiments is implemented:

[0241] In response to the encryption instruction, obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code;

[0242] Generate a random key pool file based on the device hardware identification code and the random seed text;

[0243] Based on the random key pool file, determining a target key;

[0244] The device data of the current device is encrypted based on the target key to obtain ciphertext data.

[0245] In one embodiment, a computer program product is provided. When the computer program is executed by a processor, the device data encryption method of any of the above embodiments is implemented:

[0246] In response to the encryption instruction, obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code;

[0247] Generate a random key pool file based on the device hardware identification code and the random seed text;

[0248] Based on the random key pool file, determining a target key;

[0249] The device data of the current device is encrypted based on the target key to obtain ciphertext data.

[0250] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0251] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0252] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0253] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A device data encryption method, characterized in that: The device data encryption method comprises: In response to the encryption instruction, obtaining a device hardware identification code of the current device and a random seed text corresponding to the device hardware identification code; Generate a random key pool file based on the device hardware identification code and the random seed text; Based on the random key pool file, determining a target key; The device data of the current device is encrypted based on the target key to obtain ciphertext data.

2. The device data encryption method according to claim 1, characterized in that: The step of obtaining the device hardware identification code of the current device and the random seed text corresponding to the device hardware identification code includes: Read the device hardware identification code of the current device; Based on the number of bytes of the device hardware identification code, a random seed text corresponding to the number of bytes is generated.

3. The device data encryption method according to claim 1, characterized in that: The random key pool file includes a byte matrix; the generating of the random key pool file based on the device hardware identification code and the random seed text includes: Determine a first identification code based on the device hardware identification code; Determine a second identification code based on the device hardware identification code and the random seed text; Based on the first identification code and the second identification code, a byte matrix is ​​determined; the order of the byte matrix is ​​the same as the number of bytes of the device hardware identification code.

4. The device data encryption method according to claim 3, characterized in that: The determining the second identification code based on the device hardware identification code and the random seed text comprises: A second identification code is determined based on an XOR operation result of the device hardware identification code and the random seed text.

5. The device data encryption method according to claim 3, characterized in that: The determining of the byte matrix based on the first identification code and the second identification code comprises: Sequentially shifting the first identification code left by N bytes to obtain a left-shifted string, and shifting the second identification code right by N bytes to obtain a right-shifted string; N is a positive integer less than or equal to the number of bytes; The byte matrix is ​​determined based on the XOR operation result of each pair of the left-shifted character string and the right-shifted character string.

6. The device data encryption method according to claim 1, characterized in that: The determining the target key based on the random key pool file comprises: Based on the device hardware identification code and the random seed text, determine an index list of the random key pool file; the index list includes a plurality of tuples; each of the tuples includes a first element determined by the random seed file and a second element determined by the device hardware identification code; the number of the tuples is the same as the number of bytes of the device hardware identification code; Based on each of the two-tuples, sequentially search for bytes in the random key pool file to obtain a plurality of index bytes; Based on a plurality of the index bytes, the target key is determined.

7. The device data encryption method according to claim 6, characterized in that: The determining the index list of the random key pool file based on the device hardware identification code and the random seed text comprises: Determine a first element of an Nth 2-tuple based on an Nth byte of the random seed text; Based on the Nth byte of the device hardware identification code, obtain the second element of the Nth 2-tuple; N is a positive integer less than or equal to the number of bytes.

8. The device data encryption method according to claim 7, characterized in that: The obtaining the first element of the Nth binary group based on the Nth byte of the random seed text comprises: obtaining the first element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the random seed text and N; Obtaining the second element of the Nth binary group based on the Nth byte of the device hardware identification code includes: obtaining the second element of the Nth binary group based on the modulo operation result of the unsigned integer of the Nth byte of the device hardware identification code and N.

9. The device data encryption method according to claim 6, characterized in that: The determining the target key based on the plurality of index bytes comprises: Based on the multiple index bytes, a concatenated string is obtained; A hash operation is performed based on the concatenated character string to determine the target key.

10. The device data encryption method according to claim 1, characterized in that: The step of encrypting the device data of the current device based on the target key to obtain the ciphertext data further includes: The ciphertext data is stored, and the target key and the device data are deleted.

11. The device data encryption method according to claim 10, characterized in that: After storing the ciphertext data and deleting the target key and the device data, the method further includes: Generate a target key based on the device hardware identification code and the random seed text; Decrypting the ciphertext data based on the target key to obtain device data; Based on the number of bytes of the device hardware identification code, generating an updated random seed text corresponding to the number of bytes; Based on the updated random seed text, updating the random seed text; Based on the device hardware identification code and the updated random seed text, updating the target key; encrypting the device data based on the updated target key; The ciphertext data is stored, and the target key and the device data are deleted.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 11 is implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

14. A computer program product, characterized in that When the computer program product is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • File encryption and decryption method and device and storage medium

    CN116015650A

  • File encryption storage system based on quantum random number beacons

    CN118194313A

  • Encryption method and device for burnt firmware, storage medium and computer equipment

    CN118981784A

  • Shared key generation based on dual clocks

    US20210377008A1

  • Securely executing software based on cryptographically verified instructions

    US20230017231A1