Data encryption method and device, electronic equipment and storage medium

By dividing data into sub-segments and generating encrypted data based on checksums and random positions, the problem of insufficient data security in existing technologies is solved, achieving more efficient data encryption and security.

CN119788300BActive Publication Date: 2025-11-21BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311296519.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-08
Publication Date
2025-11-21
Estimated Expiration
2043-10-08

AI Technical Summary

Technical Problem

Existing data encryption methods are insufficient to effectively improve data security, especially in preventing unauthorized access and tampering during data transmission and storage.

Method used

The data to be encrypted is divided into N sub-data segments, and a checksum is assigned to each sub-data segment. The sub-data segments are randomly added to preset random data positions. The target configuration data segment is determined based on the position information, byte length, and checksum. Encrypted data is generated by updating the data.

Benefits of technology

It improves data security and encryption efficiency, ensuring the confidentiality and integrity of data during transmission and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788300B_ABST
    Figure CN119788300B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data encryption method and device, electronic equipment and storage medium, relates to the technical field of computers, and particularly relates to the artificial intelligence technical field of information security, data encryption and the like. The specific implementation scheme is as follows: the first data to be encrypted is divided into N sub-data segments, and a check code corresponding to each sub-data segment is determined, wherein N is an integer greater than 1; the N sub-data segments are added to different positions of preset random data respectively to obtain second data; according to at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment and the check code, a target configuration data segment is determined; and based on the target configuration data segment, the initial configuration data segment of the second data is updated to obtain encrypted data. Thus, the encryption of the first data is realized, and the security of the first data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular to the technical field of information security, data encryption and the like, and specifically relates to a data encryption method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the advent of the digital age, people increasingly rely on electronic devices for data storage and transmission. However, the data stored on computers, mobile devices or cloud servers often contains personal, business or confidential information. In order to protect this information from being accessed, stolen or tampered with by unauthorized persons, data encryption has become an important means of privacy protection. Therefore, how to encrypt data has become a key research direction. SUMMARY

[0003] The present disclosure provides a data encryption method and device, electronic equipment and storage medium.

[0004] According to a first aspect of the present disclosure, a data encryption method is provided, comprising:

[0005] dividing first data to be encrypted into N sub-data segments, and determining a check code corresponding to each of the sub-data segments, wherein N is an integer greater than 1;

[0006] adding the N sub-data segments to different positions of preset random data respectively to obtain second data;

[0007] determining a target configuration data segment according to at least one of the value of N, the position information of each of the sub-data segments in the second data, the first byte length of each of the sub-data segments and the check code;

[0008] updating an initial configuration data segment of the second data based on the target configuration data segment to obtain encrypted data.

[0009] According to a second aspect of the present disclosure, a data encryption device is provided, comprising:

[0010] a first determination module configured to divide first data to be encrypted into N sub-data segments, and determine a check code corresponding to each of the sub-data segments, wherein N is an integer greater than 1;

[0011] a first acquisition module configured to add the N sub-data segments to different positions of preset random data respectively to obtain second data;

[0012] The second determining module is used to determine the target configuration data segment based on at least one of the following: the value of N, the position information of each sub-data segment in the second data, the length of the first byte corresponding to each sub-data segment, and the check code.

[0013] The second acquisition module is used to update the initial configuration data segment of the second data based on the target configuration data segment in order to obtain encrypted data.

[0014] According to a third aspect of this disclosure, an electronic device is provided, comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the data encryption method as described in the first aspect.

[0018] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing the computer to perform the data encryption method as described in the first aspect.

[0019] According to a fifth aspect of this disclosure, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the data encryption method as described in the first aspect.

[0020] According to a sixth aspect of this disclosure, a smart driving vehicle is provided, the smart driving vehicle including the data encryption device described in the second aspect.

[0021] The data encryption method, apparatus, electronic device, and storage medium disclosed herein have the following beneficial effects:

[0022] In the embodiments of the present disclosure, the first data to be encrypted can be divided into N sub-data segments, and the corresponding check code of each sub-data segment is determined, then the N sub-data segments are added to different positions of the preset random data respectively to obtain second data, and then at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment and the check code is determined to determine the target configuration data segment, and finally the initial configuration data segment of the second data is updated based on the target configuration data segment to obtain the encrypted data. Therefore, the plurality of sub-data segments contained in the first data to be encrypted can be added to the random data respectively, and the target configuration data segment is generated according to the configuration information of each sub-data segment to obtain the encrypted data, which realizes the encryption of the first data and improves the security of the first data.

[0023] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0024] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them:

[0025] Figure 1 is a flowchart of a data encryption method according to an embodiment of the present disclosure;

[0026] Figure 1A is a schematic diagram of encrypted data corresponding to first data according to an embodiment of the present disclosure;

[0027] Figure 2 is a flowchart of a data encryption method according to another embodiment of the present disclosure;

[0028] Figure 3 is a flowchart of a data encryption method according to another embodiment of the present disclosure;

[0029] Figure 4 is a flowchart of a data encryption method according to another embodiment of the present disclosure;

[0030] Figure 5 is a structural schematic diagram of a data encryption device according to an embodiment of the present disclosure;

[0031] Figure 6 is a block diagram of an electronic device for implementing the data encryption method according to the embodiments of the present disclosure. DETAILED DESCRIPTION

[0032] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are cited as illustrative examples. Various details of the embodiments of the present disclosure are described herein in order to provide a thorough understanding thereof. It will be understood by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in the following description, descriptions of well-known functions and constructions are omitted for clarity and conciseness.

[0033] Embodiments of the present disclosure relate to the technical field of artificial intelligence, such as computer vision and deep learning.

[0034] Information security is a technology and management security protection established and adopted by a data processing system, which is to protect computer hardware, software, and data from being damaged, altered, and leaked due to accidental or malicious reasons.

[0035] Data encryption refers to converting and processing original data by using an encryption algorithm or a key, so that unauthorized persons cannot understand and obtain the content therein. Data encryption can ensure the confidentiality and security of data during transmission and storage.

[0036] The data encryption method, device, electronic equipment, and storage medium of embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0037] It should be noted that the execution subject of the data encryption method of the present embodiment is a data encryption device, which can be implemented by software and / or hardware. The device can be configured in an electronic equipment, which can include but is not limited to a terminal, a server, and the like.

[0038] Figure 1 FIG. 1 is a flowchart of a data encryption method according to an embodiment of the present disclosure.

[0039] As shown in FIG. 1, the data encryption method includes the following steps. Figure 1

[0040] S101, dividing first data to be encrypted into N sub-data segments, and determining a check code corresponding to each sub-data segment, wherein N is an integer greater than 1.

[0041] In some embodiments, the first data to be encrypted can be hexadecimal data. The present disclosure does not limit this.

[0042] In some embodiments, the first data can be divided into N sub-data segments of different lengths, so as to further improve the security of data encryption.

[0043] ​Alternatively, the first data can also be divided into N sub-data segments based on a preset length, that is, the first data to be encrypted can be divided into N sub-data segments with the same length. In this way, the efficiency of dividing the first data can be improved, and the encryption efficiency can be improved.

[0044] Optionally, the preset length can be agreed by the encryption and decryption parties in advance. For example, the preset length can be 32 bytes, 50 bytes, 100 bytes, etc.

[0045] For example, the first data is "82E0 FF FB 3F FF F7 F4 9F EF 4F 8F 9D 6F AB F5 E6 E1 E5 F9 AC DB FB B0 DB ED AC 9E 97 2F F7 0F 1E 5F 9E 57 67DD E7 97 6E E7 9F FF F8 DB A9 3B 42 77DC 71 87 37D7 AE 1F 78D3 09E0 FB DD 4E E8 8D DD 20 74C6 B3 B3 EE C5 FA A1 E3 BC 7D ED E3 6F 7F EB 74 4E 05B1 37B9 98 76 1C 7F 70 7A BB 89F2 00 31 1E 1B 71 30 9D 4C DC 41C8 4C 10 1F 43E1 D3 8E 37 61 96 9C 80 60 86 8E 96EB", if divided into 5 sub-data segments with different lengths, sub-data segment 1 can be "82E0 FF FB 3F FF F7 F4 9F EF 4F 8F 9D 6F AB F5 E6 E1 E5 F9 AC DB FB B0 DB ED AC 9E 97 2F F7 0F"; sub-data segment 2 can be "1E 5F 9E 57 67DD E7 97 6E E7 9F FF F8 DB A9 3B"; sub-data segment 3 can be "42 77DC 71 87 37D7 AE 1F 78D3 09E0 FB DD 4E E8 8D DD 20 74C6 B3 B3 EE C5 FA A1 E3 BC 7D ED"; sub-data segment 4 can be "E3 6F 7F EB 74 4E 05B1 37B9 98 76 1C 7F 70"; and sub-data segment 5 can be "7A BB 89F2 00 31 1E 1B 71 30 9D 4C DC 41C8 4C 10 1F 43E1 D3 8E 37 61 96 9C 80 60 86 8E 96EB".

[0046] Alternatively, if the preset length can be 32 bytes, it can be divided into 4 sub-data segments of the same length, then sub-data segment 1 can be "82E0 FF FB 3F FF F7 F4 9F EF 4F 8F 9D 6F AB F5 E6 E1 E5 F9 AC DB FB B0 DB ED AC 9E 97 2F F7 0F"; sub-data segment 2 can be "1E 5F 9E 57 67 DD E7 97 6E E7 9F FF F8 DB A9 3B 42 77 DC 71 87 37 D7 AE 1F 78 D3 09 E0 FB DD 4E"; sub-data segment 3 can be "1E 5F 9E 57 67 DD E7 97 6E E7 9F FF F8 DB A9 3B 42 77 DC 71 87 37 D7 AE 1F 78 D3 09 E0 FB DD 4E"; and sub-data segment 4 can be "BB 89 F2 00 31 1E 1B 71 30 9D 4C DC 41 C8 4C 10 1F 43 E1 D3 8E 37 61 96 9C 80 60 86 8E 96 EB".

[0047] The check code can be used by the decryption party to check the integrity of each sub-data segment received.

[0048] In some embodiments, checksum, cyclic redundancy check (CRC), hash function check, etc. can be used to determine the check code corresponding to each sub-data segment.

[0049] The checksum is calculated by adding the bytes in each sub-data segment and calculating the checksum value. The decryption party can use the same method to calculate the checksum and compare it with the checksum provided by the encryption party to check if the data is correct.

[0050] The CRC is usually used in network communication and storage systems. It uses a polynomial algorithm to generate a fixed-length check code. The encryption party calculates the CRC and sends it to the receiving party. The decryption party uses the same polynomial algorithm to calculate the CRC and compares the results to detect whether the data is complete.

[0051] The hash function can convert each sub-data segment into a hash value of fixed length. The encrypting party calculates the hash value of the data and shares it with the decrypting party. After obtaining each sub-data segment, the decrypting party calculates the hash value and compares it with the hash value provided by the encrypting party to verify whether the data is complete. Commonly used hash functions include Message Digest Algorithm 5 (MD5), Secure Hash Algorithm 1 (SHA-1), and Secure Hash Algorithm 256 (SHA-256).

[0052] In some embodiments, the encrypting and decrypting parties can agree on the verification method in advance. For example, the verification method can be agreed to be a checksum, or the verification method can be agreed to be a parity check, etc. The present disclosure does not limit this.

[0053] In some embodiments, the encrypting and decrypting parties can agree on the verification method in advance. For example, the verification method can be agreed to be a checksum, or the verification method can be agreed to be a parity check, etc. The present disclosure does not limit this.

[0053] S102, adding the N sub-data segments to different positions of the preset random data respectively to obtain second data.

[0054] The random data can be generated by using a random function. Alternatively, the random data can also be generated in advance.

[0055] In some embodiments, if the random data is generated by using a random function, the size of the random data can be set in advance.

[0056] Optionally, the first order corresponding to the N sub-data segments in the first data is different from the second order corresponding to the N sub-data segments in the second data. Thus, the security of the encrypted file can be further improved.

[0057] Alternatively, the first order corresponding to the N sub-data segments in the first data is the same as the second order corresponding to the N sub-data segments in the second data.

[0058] S103, determining a target configuration data segment according to at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the verification code.

[0059] Optionally, the first configuration data segment corresponding to each sub-data segment can be determined according to at least one of the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code, and then the second configuration data segment corresponding to all sub-data segments can be obtained by combining the first configuration data segment corresponding to each sub-data segment based on the first order of the N sub-data segments in the first data; finally, the target configuration data segment can be obtained by recombining the value of N and the second configuration data segment. In this way, the target configuration data segment can be accurately determined according to the configuration information corresponding to each sub-data segment and the first order of the N sub-data segments in the first data.

[0060] The position information of the sub-data segment in the second data can be a starting position of the sub-data segment in the second data, or can be a starting position and an ending position.

[0061] In some embodiments, if the position information in the second data includes a starting position and an ending position, the target configuration data segment can be determined according to the value of N, the position information of each sub-data segment in the second data, and the check code corresponding to each sub-data segment.

[0062] In some embodiments, if the position information in the second data includes a starting position, the target configuration data segment can be determined according to the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code.

[0063] Optionally, the first configuration data segment corresponding to each sub-data segment can be determined according to the starting position of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code. For example, the first configuration data segment is “00 90 00 20 26”, wherein 00 90 represents the starting position of the sub-data segment, 00 20 represents the first byte length of the sub-data segment (i.e., the sub-data segment contains 32 bytes), and 26 represents the check code byte of the sub-data segment.

[0064] For example, there are five sub-data segments, the first configuration data segment corresponding to the sub-data segment 1 can be "00 900020 26", the first configuration data segment corresponding to the sub-data segment 2 can be "00C0 00 0F AE", the first configuration data segment corresponding to the sub-data segment 3 can be "00D4 00 20 3A", the first configuration data segment corresponding to the sub-data segment 4 can be "01 1000 0E 3F", and the first configuration data segment corresponding to the sub-data segment 5 can be "01B0 00 20E8". The second configuration data segment is "00 90 00 20 26 00C0 00 0F AE 00D4 00 20 3A 01 10 00 0E 3F 01B0 0020E8". If the value of N occupies two bytes, the data segment corresponding to N is "00 05", and the target configuration data segment is "00 05 00 90 0020 26 00C0 00 0F AE 00D4 00 20 3A 01 10 00 0E 3F 01B0 00 20E8".

[0065] Optionally, in the case that the first byte length corresponding to each sub-data segment is a preset length, the target configuration data segment can be determined according to the value of N, the starting position of each sub-data segment in the first data, and the check code.

[0066] It should be noted that, if the first byte length corresponding to each sub-data segment is a preset length, the length information corresponding to each sub-data segment can not be included in the target configuration data segment, so that the length of the target configuration data segment can be shortened, and the encryption efficiency can be improved.

[0067] In S104, the initial configuration data segment of the second data is updated based on the target configuration data segment to obtain encrypted data.

[0068] The initial configuration data segment can be a data segment in the second data for placing configuration information corresponding to each sub-data segment. For example, the initial configuration data segment can be all 0s or all 1s. The present disclosure does not limit this.

[0069] In the present disclosure, after the target configuration data segment is determined, the initial configuration data segment of the second data can be updated based on the target configuration data segment to obtain encrypted data.

[0070] Figure 1A A schematic diagram of encrypted data corresponding to the first data provided by an embodiment of the present disclosure is shown in FIG. 1. Figure 1AAs shown, in the encrypted data, the target configuration data segment is "00 05 00 90 00 20 26 00 C0 00 0F AE 00 D4 00 23 A0 10 00 0E 3F 01 B0 00 20 E8"; the sub-data segment 1 is "82 E0 FF FB 3F FF F7 F4 9F EF 4F 8F 9D 6F AB F5 E6 E1 E5 F9 AC DB FB B0 DB ED AC 9E 97 2F F7 0F"; the sub-data segment 2 is "1E 5F 9E 57 67 DD E7 97 6E E7 9F FF F8 DB A9 3B"; the sub-data segment 3 is "42 77 DC 71 87 37 D7 AE 1F 78 D3 09 E0 FB DD 4E E8 8D DD 20 74 C6 B3 B3 EE C5 FA A1 E3 BC 7D ED"; the sub-data segment 4 is "E3 6F 7F EB 74 4E 05 B1 37 B9 98 76 1C 7F 70"; and the sub-data segment 5 is "7A BB 89 F2 00 31 1E 1B 71 30 9D 4C DC 41 C8 4C 10 1F 43 E1 D3 8E 37 61 96 9C 80 60 86 8E 96 EB".

[0071] In the embodiments of the present disclosure, the first data to be encrypted can be divided into N sub-data segments, and the check code corresponding to each sub-data segment can be determined. Then, the N sub-data segments are added to different positions of the preset random data to obtain the second data. Further, at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length of each sub-data segment, and the check code is determined to determine the target configuration data segment. Finally, the initial configuration data segment of the second data is updated based on the target configuration data segment to obtain the encrypted data. Thus, the plurality of sub-data segments contained in the first data to be encrypted can be added to the random data, and the target configuration data segment can be generated according to the configuration information of each sub-data segment to obtain the encrypted data, thereby realizing the encryption of the first data and improving the security of the first data.

[0072] Figure 2 is a flow diagram of a data encryption method according to another embodiment of the present disclosure;

[0073] As Figure 2 shown, the data encryption method comprises:

[0074] S201, the first data to be encrypted is divided into N sub-data segments, and the check code corresponding to each sub-data segment is determined, wherein N is an integer greater than 1.

[0075] S202, adding the N sub-data segments to different positions of the preset random data respectively to obtain second data.

[0076] The specific implementation forms of steps S201 to S202 can refer to the detailed descriptions in the remaining embodiments of the present disclosure, and will not be described in detail here.

[0077] S203, determining a second byte length occupied by configuration information corresponding to each sub-data segment according to at least one of position information of each sub-data segment in the second data, a first byte length corresponding to each sub-data segment, and a check code.

[0078] Optionally, the first byte length can be determined according to the number of bytes occupied by the position information, the number of bytes occupied by the first byte length, and the number of bytes occupied by the check code.

[0079] For example, if the position information occupies two bytes, the first byte length occupies two bytes, and the check code occupies one byte, the second byte length is 5 bytes in the case where the configuration information corresponding to each sub-data segment includes the position information, the first byte length corresponding to each sub-data segment, and the check code. The second byte length is 3 bytes in the case where the configuration information corresponding to each sub-data segment includes the position information and the check code corresponding to each sub-data segment.

[0080] S204, determining a target byte length corresponding to a target configuration data segment according to a value of N, a third byte length occupied by the value of N, and the second byte length.

[0081] For example, if the value of N is 5, the third byte length occupied by the value of N is 2 bytes, and the second byte length is 5 bytes, the target byte length can be 2+5*5=27 bytes.

[0082] S205, determining a preset starting position of the target configuration data segment in the encrypted data.

[0083] The preset starting position of the target configuration data segment in the encrypted data can be agreed in advance by both the encryption side and the decryption side. For example, the 100th byte in the encrypted data can be agreed as the preset starting position of the target configuration data segment in the encrypted data.

[0084] S206, determining an initial configuration data segment of the second data according to the target byte length and the preset starting position.

[0085] Optionally, a data segment in the second data, which starts from the preset starting position and has a length of the target byte length, is determined as the initial configuration data segment.

[0086] For example, the preset starting position is the 100th byte in the second data, and the target byte length is 27 bytes. The 100th to 126th bytes in the second data are the initial configuration data segment.

[0087] It should be noted that after the sub-data segment is added to the first data, it is necessary to ensure that the 100th to 126th bytes in the obtained second data are not sub-data segments.

[0088] Alternatively, based on the target byte length, the initial configuration data segment is generated, and based on the preset starting position, the initial configuration data segment is added to the second data.

[0089] For example, the preset starting position is the 100th byte in the second data, and the target byte length is 27 bytes. The 100th to 126th bytes in the second data are the initial configuration data segment.

[0090] It should be noted that after the sub-data segment is added to the first data, it is necessary to ensure that the 100th to 126th bytes in the obtained second data are not sub-data segments.

[0091] Therefore, in the embodiments of the present disclosure, the initial configuration data segment can be accurately determined by the above two ways.

[0092] S207, determining the target configuration data segment according to at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code.

[0093] S208, updating the initial configuration data segment of the second data based on the target configuration data segment to obtain the encrypted data.

[0094] The specific implementation form of steps S207 to S208 can refer to the detailed description in the remaining embodiments of the present disclosure, and will not be described in detail here.

[0095] In the embodiments of the present disclosure, after adding the N sub-data segments to different positions of the preset random data respectively to obtain the second data, the second byte length occupied by the configuration information corresponding to each sub-data segment is determined according to at least one of the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment and the check code, the target byte length corresponding to the target configuration data segment is determined according to the value of N, the third byte length occupied by the value of N, and the second byte length, and then the initial configuration data segment of the second data is determined in combination with the preset starting position of the target configuration data segment in the encrypted data. Finally, the initial configuration data segment of the second data is updated based on the determined target configuration data segment to obtain the encrypted data. Therefore, the target byte length of the target configuration data segment can be accurately determined according to the second byte length occupied by the configuration information corresponding to each sub-data segment, and then the initial configuration data segment is accurately determined in combination with the preset starting position, and the position of the target configuration data segment in the encrypted file is accurately determined, which provides a condition for the decryption party to decrypt.

[0096] Figure 3 is a flowchart of a data encryption method according to another embodiment of the present disclosure;

[0097] As shown in Figure 3 , the data encryption method comprises:

[0098] S301, dividing the first data to be encrypted into N sub-data segments, and determining the check code corresponding to each sub-data segment, wherein N is an integer greater than 1.

[0099] S302, adding the N sub-data segments to different positions of the preset random data respectively to obtain the second data.

[0100] S303, determining the target configuration data segment according to at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment and the check code.

[0101] The specific implementation form of steps S301 to S303 can refer to the detailed description in the remaining embodiments of the present disclosure, and will not be described in detail here.

[0102] S304, dividing the target configuration data segment to obtain a plurality of sub-target configuration data segments.

[0103] In some embodiments, the target configuration data segment can be divided into M sub-target configuration data segments with different lengths, so as to further improve the security of data encryption.

[0104] Alternatively, the target configuration data segment is divided into M sub-target configuration data segments of the same length, for example, each sub-target configuration data segment can be 4 bytes, 5 bytes, etc. The present disclosure does not make any limitation on this.

[0105] Alternatively, the target configuration data segment can also be divided based on the number of first configuration data segments contained in each sub-target configuration data segment to obtain a plurality of sub-target configuration data segments.

[0106] For example, the target configuration data segment is "00 05 00 90 00 20 26 00C0 00 0F AE 00D4 00 20 3A 01 10 00 0E 3F 01B0 00 20E8", wherein "00 05" is the value of N, "00 90 00 20 26" is the first configuration data segment corresponding to the sub-data segment 1; "00C0 00 0F AE" is the first configuration data segment corresponding to the sub-data segment 2; "00D4 00 20 3A" is the first configuration data segment corresponding to the sub-data segment 3, "01 10 00 0E 3F" is the first configuration data segment corresponding to the sub-data segment 4, and "01B0 00 20E8" is the first configuration data segment corresponding to the sub-data segment 5. If the number of first configuration data segments contained in each sub-target configuration data segment is 2, then the sub-target configuration data segment 1 can be "0005 00 90 00 20 26 00C0 00 0F AE", the sub-target configuration data segment 2 can be "00D4 00 20 3A 01 1000 0E 3F", and the sub-target configuration data segment 3 can be "01B0 00 20E8".

[0107] S305, based on each sub-target configuration data segment, updating each sub-initial configuration data segment in the second data to obtain encrypted data.

[0108] The sub-initial configuration data segment can be a data segment in the second data for placing configuration information corresponding to each sub-data segment. For example, the sub-initial configuration data segment can be all 0, all 1, etc. The present disclosure does not make any limitation on this.

[0109] In the embodiments of the present disclosure, the specific implementation form of determining each sub-initial configuration data segment in the second data can refer to the specific implementation of determining the initial configuration data segment in the present disclosure, which will not be described in detail here.

[0110] Optionally, the plurality of sub-target configuration data segments are sorted based on a position of each sub-target configuration data segment in the target configuration data segment to obtain a first sorting result, then the plurality of sub-initial configuration data segments are sorted based on a position of each sub-initial configuration data segment in the second data to obtain a second sorting result, and finally the i-th corresponding sub-initial configuration data segment in the second sorting result is updated based on the i-th corresponding sub-target configuration data segment in the first sorting result to obtain the encrypted data. That is, the order of each sub-target configuration data segment in the encrypted file is the same as the order in the target configuration data segment. Thus, the position of each sub-target configuration data segment in the encrypted file can be accurately determined, and the encryption and decryption efficiency is improved.

[0111] In the embodiment of the present disclosure, the first data to be encrypted is first divided into N sub-data segments and the corresponding check code of each sub-data segment is determined, then the N sub-data segments are added to different positions of the preset random data to obtain second data, and then the target configuration data segment is determined according to at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length of each sub-data segment, and the check code, and the target configuration data segment is divided to obtain a plurality of sub-target configuration data segments, and finally each sub-initial configuration data segment in the second data is updated based on each sub-target configuration data segment to obtain encrypted data. Thus, the target configuration data segment is divided into a plurality of sub-target configuration data segments and placed in different positions of the encrypted file, so that the security of the encrypted file can be further improved.

[0112] Figure 4 is a flowchart of a data encryption method according to another embodiment of the present disclosure;

[0113] As shown in Figure 4 , the data encryption method comprises:

[0114] S401, the first data to be encrypted is divided into N sub-data segments, and the corresponding check code of each sub-data segment is determined, wherein N is an integer greater than 1.

[0115] Optionally, the security level and encryption efficiency level of the first data are obtained, then the value of N is determined according to the security level and / or the encryption efficiency level, and finally the first data is divided into N sub-data segments based on the value of N. Thus, the value of N can be accurately determined according to the configuration of the security level and the encryption efficiency level, so that the obtained encrypted data can meet the user's demand.

[0116] The security level and the encryption efficiency level of the first data can be configured by a user. If the user configures a higher security level, the first data needs to be deeply encrypted to improve security. If the user configures a higher encryption efficiency level, the encryption depth of the first data needs to be reduced to improve encryption efficiency.

[0117] Optionally, the higher the security level, the larger the value of N, so that the encryption depth of the first data in the encrypted data can be improved, and the security level can be improved.

[0118] Optionally, the higher the encryption efficiency level, the smaller the value of N, so that the decryption efficiency can be improved.

[0119] S402, determining a target size of random data.

[0120] Optionally, the first occupancy rate of the processor and the second occupancy rate of the memory can be obtained first, and then the target size of the random data is determined according to the first occupancy rate and / or the second occupancy rate. Thus, the target size of the random data can be accurately determined according to the first occupancy rate and / or the second occupancy rate.

[0121] Optionally, the higher the first occupancy rate, the smaller the target size of the random data, so that the encryption efficiency can be improved.

[0122] Optionally, the higher the second occupancy rate, the smaller the target size of the random data, so that the encryption efficiency can be improved.

[0123] Optionally, the security level and the encryption efficiency level of the first data can also be obtained first, and then the target size of the random data is determined according to the security level and / or the encryption efficiency level. Thus, the target size of the random data can be accurately determined according to the security level and the encryption efficiency level set by the user.

[0124] The security level and the encryption efficiency level of the first data can be configured by a user. If the user configures a higher security level, the first data needs to be deeply encrypted to improve security. If the user configures a higher encryption efficiency level, the encryption depth of the first data needs to be reduced to improve encryption efficiency.

[0125] Optionally, the higher the security level, the larger the target size of the random data, so that the encryption depth of the first data in the encrypted data can be improved, and the security level can be improved.

[0126] Optionally, the higher the encryption efficiency level, the smaller the target size of the random data, so that the resource occupancy can be reduced, and the efficiency can be improved.

[0127] S403, generating random data based on the target size.

[0128] S404, add the N sub-data segments to different positions of the preset random data respectively to obtain second data.

[0129] S405, determine a target configuration data segment according to at least one of a value of N, position information of each sub-data segment in the second data, a first byte length corresponding to each sub-data segment, and a check code.

[0130] S406, update the initial configuration data segment of the second data based on the target configuration data segment to obtain encrypted data.

[0131] The specific implementation forms of steps 404 to 406 can refer to the detailed descriptions in the remaining embodiments of the present disclosure, and will not be described in detail here.

[0132] In the embodiments of the present disclosure, one or more of the current first occupancy rate of the processor, the second occupancy rate of the memory, the security level of the configured first data, and the encryption efficiency level can be used to determine the target size of the random data, and then the random data is generated based on the target size, the N sub-data segments are added to different positions of the preset random data respectively to obtain second data, at least one of the value of N, the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code is used to determine the target configuration data segment, and finally the initial configuration data segment of the second data is updated based on the target configuration data segment to obtain encrypted data. Therefore, the target size of the random data can be accurately determined according to one or more of the current first occupancy rate of the processor, the second occupancy rate of the memory, the security level of the configured first data, and the encryption efficiency level, and the random data is generated, and then the encryption of the first data is realized.

[0133] Figure 5 is a structural schematic diagram of a data encryption device according to an embodiment of the present disclosure;

[0134] As shown in the figure, the data encryption device 500 includes: Figure 5

[0135] The first determination module 501 is configured to divide the first data to be encrypted into N sub-data segments, and determine a check code corresponding to each sub-data segment, wherein N is an integer greater than 1.

[0136] The first acquisition module 502 is configured to add the N sub-data segments to different positions of the preset random data respectively to obtain second data.

[0137] The second determination module 503 is configured to determine a target configuration data segment according to at least one of a value of N, position information of each sub-data segment in the second data, a first byte length corresponding to each sub-data segment, and a check code. ​

[0138] The second obtaining module 504 is configured to update the initial configuration data segment of the second data based on the target configuration data segment, to obtain the encrypted data.

[0139] Optionally, the apparatus further includes a third determining module configured to:

[0140] determine the second byte length occupied by the configuration information corresponding to each sub-data segment according to at least one of the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code;

[0141] determine the target byte length corresponding to the target configuration data segment according to the value of N, the third byte length occupied by the value of N, and the second byte length;

[0142] determine a preset starting position of the target configuration data segment in the encrypted data;

[0143] determine the initial configuration data segment of the second data according to the target byte length and the preset starting position.

[0144] Optionally, the third determining module is configured to:

[0145] determine, as the initial configuration data segment, a data segment in the second data that starts from the preset starting position and has a length of the target byte length; or

[0146] generate the initial configuration data segment based on the target byte length, and add the initial configuration data segment to the second data based on the preset starting position.

[0147] Optionally, the second determining module is configured to:

[0148] determine the first configuration data segment corresponding to each sub-data segment according to at least one of the position information of each sub-data segment in the second data, the first byte length corresponding to each sub-data segment, and the check code;

[0149] combine the first configuration data segment corresponding to each sub-data segment based on the first order of the N sub-data segments in the first data, to obtain the second configuration data segment corresponding to all the sub-data segments;

[0150] recombine the value of N and the second configuration data segment, to obtain the target configuration data segment.

[0151] Optionally, the apparatus further includes a third obtaining module configured to:

[0152] divide the target configuration data segment to obtain a plurality of sub-target configuration data segments;

[0153] Based on each sub-target configuration data segment, each sub-initial configuration data segment in the second data is updated to obtain encrypted data.

[0154] Optional, a third acquisition module, used for:

[0155] Based on the position of each sub-target configuration data segment within the target configuration data segment, the multiple sub-target configuration data segments are sorted to obtain the first sorting result;

[0156] Based on the position of each sub-initial configuration data segment in the second data, the multiple sub-initial configuration data segments are sorted to obtain the second sorting result;

[0157] Based on the i-th corresponding sub-target configuration data segment in the first sorting result, the i-th corresponding sub-initial configuration data segment in the second sorting result is updated to obtain encrypted data.

[0158] Optionally, a generation module is also included for:

[0159] Determine the target size for the random data;

[0160] Random data is generated based on the target size.

[0161] Optional, a generation module, used for:

[0162] Get the current first processor utilization and the second memory utilization;

[0163] The target size of the random data is determined based on the first occupancy rate and / or the second occupancy rate.

[0164] Optional, a generation module, used for:

[0165] Obtain the security level and encryption efficiency level of the first data;

[0166] The target size of the random data is determined based on the security level and / or encryption efficiency level.

[0167] Optionally, the first determining module is used for:

[0168] Obtain the security level and encryption efficiency level of the first data;

[0169] The value of N is determined based on the security level and / or encryption efficiency level.

[0170] Based on the value of N, the first data is divided into N sub-data segments.

[0171] Optionally, the first determining module is used for:

[0172] Based on a preset length, the first data is divided into N sub-data segments.

[0173] Optionally, a second determining module is used for:

[0174] With the first byte length of each sub-data segment being a preset length, the target configuration data segment is determined based on the value of N, the starting position of each sub-data segment in the first data segment, and the checksum.

[0175] Optionally, the first order of the N sub-data segments in the first data may differ from the second order of their corresponding sub-data segments in the second data.

[0176] It should be noted that the foregoing explanation of the data encryption method also applies to the data encryption device of this embodiment, and will not be repeated here.

[0177] In this embodiment, the first data to be encrypted can be first divided into N sub-data segments, and the checksum corresponding to each sub-data segment can be determined. Then, the N sub-data segments are added to different positions in preset random data to obtain second data. Next, based on at least one of the following: the value of N, the position information of each sub-data segment in the second data, the length of the first byte corresponding to each sub-data segment, and the checksum, a target configuration data segment is determined. Finally, based on the target configuration data segment, the initial configuration data segment of the second data is updated to obtain encrypted data. Thus, multiple sub-data segments contained in the first data to be encrypted can be added to random data, and a target configuration data segment can be generated according to the configuration information of each sub-data segment to obtain encrypted data, thereby achieving encryption of the first data and improving its security.

[0178] The data encryption method and data encryption device disclosed herein can be used in intelligent driving / autonomous driving vehicles. For example, intelligent driving / autonomous driving vehicles can use the data encryption method and data encryption device disclosed herein in scenarios such as vehicle-road cooperative scenarios, roadside equipment or cloud communication.

[0179] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, a computer program product, and an autonomous vehicle.

[0180] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present disclosure described and / or claimed in this document.

[0181] As shown in Figure 6 The device 600 includes a computing unit 601 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 602 or a computer program loaded into a random access memory (RAM) 603 from a storage unit 608. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0182] Various components in the device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, a magneto-optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0183] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as the data encryption method. For example, in some embodiments, the data encryption method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded onto the RAM 603 and executed by the computing unit 601, one or more steps of the data encryption method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the data encryption method by any other suitable means, such as by means of firmware.

[0184] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0185] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine or entirely on a remote machine or server.

[0186] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0187] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0188] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0189] The computer system can include clients and servers. This relationship can be. The servers are typically remote from the users who use the clients to access the servers via a communications network. The relationship between the clients and the servers is a client-server relationship that is often implemented via a web browser, a web server, and a web page. The servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are a host product in the cloud computing service system. The servers can also be servers of a distributed system or servers combined with a blockchain.

[0190] It should be understood that the various forms of flow shown above can be used to reorder, add, or delete steps. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present disclosure can be achieved, and the present disclosure is not limited herein.

[0191] In addition, the terms "first", "second", "third", etc. are used only for descriptive purposes and should not be construed as indicating or implying relative importance or an indicated number of technical features. Therefore, the features defined with "first", "second", etc. can explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified. In the description of the present disclosure, the word "if" and "if" can be interpreted as "when" or "when" or "in response to determining" or "in the case of".

[0192] The above detailed description does not constitute a limitation on the scope of protection of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements within the spirit and principles of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A data encryption method, comprising: dividing first data to be encrypted into N sub-data segments, and determining a check code corresponding to each of the sub-data segments, wherein N is an integer greater than 1; adding the N sub-data segments to different positions of preset random data respectively to obtain second data; determining, according to at least one of position information of each of the sub-data segments in the second data, a first byte length corresponding to each of the sub-data segments, and the check code, a first configuration data segment corresponding to each of the sub-data segments; combining the first configuration data segment corresponding to each of the sub-data segments based on a first order of the N sub-data segments in the first data to obtain a second configuration data segment corresponding to all the sub-data segments; recombining the value of N and the second configuration data segment to obtain a target configuration data segment; updating an initial configuration data segment of the second data based on the target configuration data segment to obtain encrypted data.

2. The method of claim 1, wherein, After the adding the N sub-data segments to different positions of preset random data respectively to obtain second data, the method further comprises: determining a second byte length occupied by configuration information corresponding to each of the sub-data segments according to at least one of the position information of each of the sub-data segments in the second data, the first byte length corresponding to each of the sub-data segments, and the check code; determining a target byte length corresponding to the target configuration data segment according to the value of N, a third byte length occupied by the value of N, and the second byte length; determining a preset starting position of the target configuration data segment in the encrypted data; determining the initial configuration data segment of the second data according to the target byte length and the preset starting position.

3. The method of claim 2, wherein, The determining the initial configuration data segment of the second data according to the target byte length and the preset starting position comprises: determining, as the initial configuration data segment, a data segment in the second data starting from the preset starting position and having a length of the target byte length; or generating the initial configuration data segment based on the target byte length, and adding the initial configuration data segment to the second data based on the preset starting position.

4. The method of claim 1, wherein, After the determining the target configuration data segment, the method further comprises: dividing the target configuration data segment to obtain a plurality of sub-target configuration data segments; updating each sub-initial configuration data segment in the second data based on each of the sub-target configuration data segments to obtain the encrypted data.

5. The method of claim 4, wherein, The updating each sub-initial configuration data segment in the second data based on each of the sub-target configuration data segments to obtain the encrypted data comprises: sorting the plurality of sub-target configuration data segments based on a position of each of the sub-target configuration data segments in the target configuration data segment to obtain a first sorting result; sorting the plurality of sub-initial configuration data segments based on a position of each of the sub-initial configuration data segments in the second data to obtain a second sorting result; and updating the i-th corresponding sub-initial configuration data segment in the second sorting result based on the i-th corresponding sub-target configuration data segment in the first sorting result, to obtain the encrypted data.

6. The method of claim 1, wherein, Before the adding the N sub-data segments to different positions of the preset random data respectively to obtain the second data, the method further comprises: determining a target size of the random data; generating the random data based on the target size.

7. The method of claim 6, wherein, The determining the target size of the random data comprises: obtaining a first occupation rate of a processor and a second occupation rate of a memory; determining the target size of the random data according to the first occupation rate and / or the second occupation rate.

8. The method of claim 6, wherein, The determining the target size of the random data comprises: obtaining a security level and an encryption efficiency level of the first data; determining the target size of the random data according to the security level and / or the encryption efficiency level.

9. The method of claim 1, wherein, The dividing the first data to be encrypted into N sub-data segments comprises: obtaining a security level and an encryption efficiency level of the first data; determining a value of N according to the security level and / or the encryption efficiency level; dividing the first data into N sub-data segments based on the value of N.

10. The method of claim 1, wherein, The dividing the first data to be encrypted into N sub-data segments comprises: dividing the first data into N sub-data segments based on a preset length.

11. The method of claim 10, wherein, The determining the target configuration data segment according to at least one of the value of N, position information of each sub-data segment in the second data, a first byte length of each sub-data segment and the check code comprises: in a case where the first byte length of each sub-data segment is the preset length, determining the target configuration data segment according to the value of N, a starting position of each sub-data segment in the first data and the check code.

12. The method of any one of claims 1-11, wherein, The first order of the N sub-data segments in the first data is different from a second order of the N sub-data segments in the second data.

13. A data encryption apparatus, comprising: a first determining module configured to divide first data to be encrypted into N sub-data segments and determine a check code corresponding to each sub-data segment, wherein N is an integer greater than 1; a first obtaining module configured to add the N sub-data segments to different positions of preset random data respectively to obtain second data; a second determining module configured to determine a target configuration data segment according to at least one of the value of N, position information of each sub-data segment in the second data, a first byte length of each sub-data segment and the check code; a second obtaining module configured to update an initial configuration data segment of the second data based on the target configuration data segment to obtain encrypted data; the second determining module is configured to: determine a first configuration data segment corresponding to each sub-data segment according to at least one of the position information of each sub-data segment in the second data, the first byte length of each sub-data segment and the check code. combining a first configuration data segment corresponding to each of the N sub-data segments according to a first order corresponding to the N sub-data segments in the first data, to obtain a second configuration data segment corresponding to all of the N sub-data segments; recombining the value of N and the second configuration data segment to obtain the target configuration data segment.

14. The apparatus of claim 13, wherein, Further comprising a third determining module configured to: determine a second byte length occupied by configuration information corresponding to each of the N sub-data segments according to at least one of position information of each of the N sub-data segments in the second data, a first byte length corresponding to each of the N sub-data segments, and the check code; determine a target byte length corresponding to the target configuration data segment according to the value of N, a third byte length occupied by the value of N, and the second byte length; determine a preset starting position of the target configuration data segment in the encrypted data; determine an initial configuration data segment of the second data according to the target byte length and the preset starting position.

15. The apparatus of claim 14, wherein, The third determining module is configured to: determine, as the initial configuration data segment, a data segment in the second data with a length of the target byte length and starting from the preset starting position; or generate the initial configuration data segment based on the target byte length, and add the initial configuration data segment to the second data based on the preset starting position.

16. The apparatus of claim 13, wherein, Further comprising a third obtaining module configured to: divide the target configuration data segment to obtain a plurality of sub-target configuration data segments; update each of the initial configuration data segments in the second data based on each of the sub-target configuration data segments to obtain the encrypted data.

17. The apparatus of claim 16, wherein, The third obtaining module is configured to: sort the plurality of sub-target configuration data segments based on a position of each of the sub-target configuration data segments in the target configuration data segment to obtain a first sorting result; sort the plurality of initial configuration data segments in the second data based on a position of each of the initial configuration data segments in the second data to obtain a second sorting result; update an i-th corresponding initial configuration data segment in the second sorting result based on an i-th corresponding sub-target configuration data segment in the first sorting result to obtain the encrypted data.

18. The apparatus of claim 13, wherein, Further comprising a generating module configured to: determine a target size of the random data; generate the random data based on the target size.

19. The apparatus of claim 18, wherein, The generating module is configured to: obtain a first occupancy rate of a processor and a second occupancy rate of memory; determine the target size of the random data according to the first occupancy rate and / or the second occupancy rate.

20. The apparatus of claim 18, wherein, The generating module is configured to: obtain a security level and an encryption efficiency level of the first data; determine the target size of the random data according to the security level and / or the encryption efficiency level.

21. The apparatus of claim 13, wherein, The first determining module is configured to: obtain a security level and an encryption efficiency level of the first data; determine the value of N according to the security level and / or the encryption efficiency level; divide the first data into N sub-data segments based on the value of N.

22. The apparatus of claim 13, wherein, The first determining module is configured to: The first data is divided into N sub-data segments based on a preset length.

23. The apparatus of claim 22, wherein, The second determining module is configured to: In a case where a first byte length of each of the sub-data segments is the preset length, determine the target configuration data segment according to a value of the N, a starting position of each of the sub-data segments in the first data, and the check code.

24. The apparatus of any of claims 13-23, wherein, The first order corresponding to the N sub-data segments in the first data is different from a second order corresponding to the N sub-data segments in the second data. 25.An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12.

26. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-13. 27.A computer program product comprising computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1-12. 28.An intelligent driving vehicle comprising the data encryption device of any one of claims 13-24.

Citation Information

Patent Citations

  • A data encryption method and device

    CN109040090A

  • Data encryption method and device, electronic equipment and storage medium

    CN116132159A