Data processing method and device, electronic equipment and storage medium

By dividing data fragments and exorbitant operations on the three-dimensional model data files, combined with the public key encryption and decryption algorithm, the encryption operation complexity problem caused by the huge 3-dimensional model data files is solved, and data access efficiency and security are improved.

CN119004492APending Publication Date: 2024-11-22VORLD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310552938.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the prior art, the three-dimensional model data file has a large volume of encryption calculations, which affects the access efficiency of the data file.

Method used

By dividing the encrypted data, encrypting the data fragments with the initial key and XOR operation, generating the target encrypted data, combined with the public key encryption algorithm, reducing the complexity of encryption calculation.

Benefits of technology

It improves the encryption and decryption efficiency of three-dimensional model data files, supports segmented queries, ensures data security, and reduces the complexity of encrypted computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004492A_ABST
    Figure CN119004492A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining to-be-encrypted data, and determining an initial key; dividing the to-be-encrypted data to obtain a first data fragment sequence; encrypting a first fragment in the first data fragment sequence by adopting the initial key to obtain first encrypted data; for a data fragment in the first data fragment sub-sequence, performing an XOR operation on the data fragment and the first fragment to obtain second encrypted data corresponding to the data fragment; and generating target encrypted data of the to-be-encrypted data based on the first encrypted data and the second encrypted data. Therefore, the data fragment and the first fragment in the first data fragment sub-sequence can be processed through the XOR operation, and then the target encrypted data of the to-be-encrypted data is obtained, so that the complexity of encryption calculation can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] Data encryption technology refers to the process of converting data into ciphertext through encryption keys and encryption functions. The receiver restores the ciphertext to plaintext through decryption functions and decryption keys. In this way, data can be protected from being illegally stolen and read.

[0003] In the prior art, symmetric encryption algorithms, asymmetric encryption algorithms, etc. are usually used to encrypt data. For example, with the increasing number of 3D application scenarios, the accuracy of 3D models is getting higher and higher, and the corresponding 3D model data files are getting larger and larger, often reaching GB (Gigabyte). At the same time, the intellectual property rights and data security of 3D models are also receiving more and more attention. How to effectively protect the security of data files while ensuring the access efficiency of data files when the model data files are getting larger and larger has become a focus of the industry development.

[0004] It can be seen that how to reduce the computational complexity of encryption operations is a technical issue worthy of attention. Summary of the invention

[0005] In view of this, in order to solve some or all of the above technical problems, the embodiments of the present application provide a data processing method, device, electronic device and storage medium.

[0006] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:

[0007] Obtaining data to be encrypted and determining an initial key;

[0008] Dividing the data to be encrypted to obtain a first data segment sequence;

[0009] Encrypting a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence;

[0010] For a data segment in a first data segment subsequence, perform an XOR operation on the data segment and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is: a sequence composed of data segments in the first data segment sequence except the first segment;

[0011] Based on the first encrypted data and the second encrypted data, target encrypted data of the data to be encrypted is generated.

[0012] In a possible implementation manner, dividing the data to be encrypted includes:

[0013] Determine the byte length of the data to be encrypted to obtain a first length;

[0014] Determining whether the first length is an integer multiple of a preset length;

[0015] When the first length is an integer multiple of the preset length, the data to be encrypted is evenly divided into data segments of the preset length;

[0016] When the first length is not an integer multiple of the preset length, the data to be encrypted is padded so that the padded data to be encrypted is an integer multiple of the preset length, and the padded data to be encrypted is evenly divided into data segments of the preset length.

[0017] In a possible implementation manner, when the first length is not an integer multiple of the preset length, padding the data to be encrypted includes:

[0018] Determine the character length of the padding data of the data to be encrypted to obtain a second length;

[0019] Determine the character length of the target data to obtain a third length, wherein the target data corresponds to the second length;

[0020] Determine a random number having a length equal to a target length, wherein the target length is a difference between the second length and the third length;

[0021] Concatenating the random number and the target data to obtain complementary data;

[0022] The padding data is padded to a preset position of the data to be encrypted.

[0023] In a possible implementation, after determining the initial key, the method further includes:

[0024] Encrypting the initial key with a public key to obtain authorization data; and

[0025] After generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the method further includes:

[0026] Based on the authorization data, the target encrypted data is decrypted to obtain the data to be encrypted.

[0027] In a possible implementation, decrypting the target encrypted data based on the authorization data to obtain the data to be encrypted includes:

[0028] determining a private key of the public key;

[0029] Decrypting the authorization data using the private key to obtain the initial key;

[0030] Based on the initial key, the target encrypted data is decrypted to obtain the data to be encrypted.

[0031] In a possible implementation manner, after generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the method further includes:

[0032] Dividing the target encrypted data to obtain a second data segment sequence;

[0033] Decrypting the second fragment using the initial key to obtain first decrypted data, wherein the second fragment is the first data fragment in the second data fragment sequence;

[0034] For a data segment in a second data segment subsequence, perform an XOR operation on the data segment and the first decrypted data to obtain second decrypted data corresponding to the data segment; wherein the second data segment subsequence is: a sequence composed of data segments in the second data segment sequence except the second segment;

[0035] The data to be encrypted is generated based on the first decrypted data and the second decrypted data.

[0036] In a possible implementation, the generating the data to be encrypted based on the first decrypted data and the second decrypted data includes:

[0037] splicing the first decrypted data and each of the obtained second decrypted data to obtain intermediate data;

[0038] Determining whether the intermediate data includes padding data;

[0039] In the case where the intermediate data includes the padding data, the padding data in the intermediate data is deleted to obtain the data to be encrypted.

[0040] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0041] An acquisition unit, used to acquire data to be encrypted and determine an initial key;

[0042] A first dividing unit, used for dividing the data to be encrypted to obtain a first data segment sequence;

[0043] A first encryption unit, configured to encrypt a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence;

[0044] A first operation unit is configured to perform an XOR operation on a data segment in a first data segment subsequence and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is a sequence of data segments in the first data segment sequence except the first segment;

[0045] The first generating unit is used to generate target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data.

[0046] In a possible implementation manner, dividing the data to be encrypted includes:

[0047] Determine the byte length of the data to be encrypted to obtain a first length;

[0048] Determining whether the first length is an integer multiple of a preset length;

[0049] When the first length is an integer multiple of the preset length, the data to be encrypted is evenly divided into data segments of the preset length;

[0050] When the first length is not an integer multiple of the preset length, the data to be encrypted is padded so that the padded data to be encrypted is an integer multiple of the preset length, and the padded data to be encrypted is evenly divided into data segments of the preset length.

[0051] In a possible implementation manner, when the first length is not an integer multiple of the preset length, padding the data to be encrypted includes:

[0052] Determine the character length of the padding data of the data to be encrypted to obtain a second length;

[0053] Determine the character length of the target data to obtain a third length, wherein the target data corresponds to the second length;

[0054] Determine a random number having a length equal to a target length, wherein the target length is a difference between the second length and the third length;

[0055] Concatenating the random number and the target data to obtain complementary data;

[0056] The padding data is padded to a preset position of the data to be encrypted.

[0057] In a possible implementation manner, after determining the initial key, the device further includes:

[0058] A second encryption unit, configured to encrypt the initial key using a public key to obtain authorization data; and

[0059] After generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the device further includes:

[0060] The first decryption unit is used to decrypt the target encrypted data based on the authorization data to obtain the data to be encrypted.

[0061] In a possible implementation, decrypting the target encrypted data based on the authorization data to obtain the data to be encrypted includes:

[0062] determining a private key of the public key;

[0063] Decrypting the authorization data using the private key to obtain the initial key;

[0064] Based on the initial key, the target encrypted data is decrypted to obtain the data to be encrypted.

[0065] In a possible implementation manner, after generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the device further includes:

[0066] A second division unit, used for dividing the target encrypted data to obtain a second data segment sequence;

[0067] A second decryption unit, configured to use the initial key to decrypt the second fragment to obtain first decrypted data, wherein the second fragment is the first data fragment in the second data fragment sequence;

[0068] A second operation unit is configured to perform an XOR operation on a data segment in a second data segment subsequence and the first decrypted data to obtain second decrypted data corresponding to the data segment; wherein the second data segment subsequence is a sequence of data segments in the second data segment sequence except the second segment;

[0069] The second generating unit is used to generate the data to be encrypted based on the first decrypted data and the second decrypted data.

[0070] In a possible implementation, the generating the data to be encrypted based on the first decrypted data and the second decrypted data includes:

[0071] splicing the first decrypted data and each of the obtained second decrypted data to obtain intermediate data;

[0072] Determining whether the intermediate data includes padding data;

[0073] In the case where the intermediate data includes the padding data, the padding data in the intermediate data is deleted to obtain the data to be encrypted.

[0074] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0075] Memory for storing computer programs;

[0076] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method of any embodiment of the data processing method of the first aspect of the present application is implemented.

[0077] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the data processing method of the first aspect described above is implemented.

[0078] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code is executed on a device, a processor in the device implements a method as in any embodiment of the data processing method of the first aspect described above.

[0079] The data processing method provided by the embodiment of the present application can obtain the data to be encrypted and determine the initial key, then divide the data to be encrypted to obtain a first data fragment sequence, then use the initial key to encrypt the first fragment in the first data fragment sequence to obtain the first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence, then, for the data fragment in the first data fragment subsequence, perform an XOR operation on the data fragment and the first fragment to obtain the second encrypted data corresponding to the data fragment; wherein the first data fragment subsequence is: a sequence composed of data fragments other than the first fragment in the first data fragment sequence, finally, based on the first encrypted data and the second encrypted data, generate the target encrypted data of the data to be encrypted. Therefore, the data fragments in the first data fragment subsequence and the first fragment can be processed by XOR operation to obtain the target encrypted data of the data to be encrypted, thereby reducing the complexity of the encryption calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0081] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

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

[0083] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;

[0084] Figure 2 A flowchart of another data processing method provided in an embodiment of the present application;

[0085] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;

[0086] Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0087] Figure 5A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0088] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values ​​described in these embodiments do not limit the scope of the present application.

[0089] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.

[0090] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0091] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0092] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0093] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0094] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.

[0095] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered as part of the specification.

[0096] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0097] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0098] In order to solve the technical problem of large amount of calculation in encryption operation in the prior art, the present application provides a data processing method that can reduce the complexity of encryption calculation.

[0099] Figure 1 A flow chart of a data processing method provided for an embodiment of the present application. The method can be applied to one or more electronic devices such as smart phones, laptops, desktop computers, portable computers, servers, etc. In addition, the execution subject of the method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute the method, or a plurality of electronic devices can cooperate with each other to execute the method. When the above-mentioned execution subject is software, the method can be implemented as multiple software or software modules, or as a single software or software module. It is not specifically limited here.

[0100] like Figure 1 As shown, the method specifically includes:

[0101] Step 101, obtaining data to be encrypted and determining an initial key.

[0102] In this embodiment, the data to be encrypted may be any data to be encrypted. As an example, the data to be encrypted may include at least one of the following: three-dimensional model data, user information, commercial secret data, etc.

[0103] The initial key may be any key. For example, a key may be generated by a random number generator, manually by a user, or by using one or more key generation algorithms (such as AES (Advanced Encryption Standard)) and used as the initial key.

[0104] In addition, the length of the initial key can be determined according to actual needs. For example, the length of the initial key can be 128 bits, 256 bits, etc.

[0105] Step 102: divide the data to be encrypted to obtain a first data segment sequence.

[0106] In this embodiment, the data to be encrypted may be divided according to a fixed length, or a certain multiple of a fixed length, so as to obtain a first data segment sequence.

[0107] The data fragments in the first data fragment sequence may be parts of the data to be encrypted obtained by division.

[0108] For example, the data to be encrypted may be divided into n L (e.g., L is a multiple of 1024 (i.e., the above fixed length)) byte length segments, thereby obtaining a first data segment sequence X1, X2, ..., Xn. Where n represents the number of data segments in the first data segment sequence. For example, n may be the quotient of the length of the data to be encrypted and the above L.

[0109] Step 103: Use the initial key to encrypt the first fragment in the first data fragment sequence to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence.

[0110] In this embodiment, one or more symmetric encryption algorithms selected from the group consisting of the DES algorithm, the 3DES algorithm, the TDEA (Triple Data Encryption Algorithm) algorithm, the Blowfish algorithm, the RC5 (a variable encryption algorithm) algorithm, and the IDEA (International Data Encryption Algorithm) algorithm can be used to encrypt the first fragment in the first data fragment sequence using the initial key to obtain the first encrypted data.

[0111] The first encrypted data may be an encryption result obtained by encrypting the first fragment in the first data fragment sequence using the initial key.

[0112] Step 104, for a data fragment in a first data fragment subsequence, perform an XOR operation on the data fragment and the first fragment to obtain second encrypted data corresponding to the data fragment; wherein the first data fragment subsequence is: a sequence composed of data fragments in the first data fragment sequence except the first fragment.

[0113] In this embodiment, the second encrypted data corresponding to the data segment may be a result obtained by performing an XOR operation on the data segment and the first segment.

[0114] As an example, if the first data segment subsequence includes "X2, ..., Xn", and the first segment is X1, then X2, ..., Xn can be Xored with X1 to generate f(X2), f(X3), ..., f(Xn). Wherein, f(Xn) is the result obtained by performing an Xor operation on Xn and X1, and n is a positive integer greater than 1.

[0115] In this way, n second encrypted data can be obtained.

[0116] Step 105: Generate target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data.

[0117] In this embodiment, the first encrypted data and the second encrypted data may be concatenated in a preset order to obtain target encrypted data of the data to be encrypted. Alternatively, preset characters or randomly generated characters may be concatenated with the first encrypted data and the second encrypted data in a preset order to obtain target encrypted data of the data to be encrypted.

[0118] It should be noted that the above numbers do not limit the execution order of the above steps.

[0119] For example, the above-mentioned “determining the initial key” may be performed before “obtaining the data to be encrypted”, may be performed after “obtaining the data to be encrypted”, or may be performed simultaneously with “obtaining the data to be encrypted”.

[0120] For another example, determining the initial key may be performed before the above step 102, may be performed after the above step 102, or may be performed simultaneously with the above step 102.

[0121] The data processing method provided by the embodiment of the present application can obtain the data to be encrypted and determine the initial key, then divide the data to be encrypted to obtain a first data fragment sequence, then use the initial key to encrypt the first fragment in the first data fragment sequence to obtain the first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence, then, for the data fragment in the first data fragment subsequence, perform an XOR operation on the data fragment and the first fragment to obtain the second encrypted data corresponding to the data fragment; wherein the first data fragment subsequence is: a sequence composed of data fragments other than the first fragment in the first data fragment sequence, finally, based on the first encrypted data and the second encrypted data, generate the target encrypted data of the data to be encrypted. Therefore, the data fragments in the first data fragment subsequence and the first fragment can be processed by XOR operation to obtain the target encrypted data of the data to be encrypted, thereby reducing the complexity of the encryption calculation.

[0122] In some optional implementations of this embodiment, after the initial key is determined, the initial key may be encrypted with a public key to obtain authorization data.

[0123] The authorization data may be a result obtained by encrypting the initial key with a public key.

[0124] In addition, one or more asymmetric encryption algorithms such as RSA (Rivest-Shamir-Adleman), ElGamal, backpack algorithm, and Rabin (a special case of the RSA method) can be used to encrypt the initial key using a public key to obtain authorization data.

[0125] On this basis, after executing the above step 105, the target encrypted data may be decrypted based on the authorization data to obtain the data to be encrypted.

[0126] The data to be encrypted may be a result obtained by decrypting the target encrypted data based on the authorization data.

[0127] Here, since there are multiple ways to obtain the target encrypted data, accordingly, multiple ways can also be used to decrypt the target encrypted data based on the authorization data to obtain the data to be encrypted. Among them, the way to encrypt and obtain the target encrypted data can correspond to the way to decrypt and obtain the data to be encrypted.

[0128] It can be understood that in the above optional implementation method, the public key can be used to encrypt the initial key to obtain authorization data, and then in the decryption process, the target encrypted data is decrypted based on the authorization data to obtain the data to be encrypted. In this way, the security of the data in the encryption and decryption process can be further improved.

[0129] In some application scenarios of the above optional implementations, the following method may be used to decrypt the target encrypted data based on the authorization data to obtain the data to be encrypted:

[0130] First, the private key of the public key is determined.

[0131] Among them, the above-mentioned private key and the above-mentioned public key can be the corresponding private key and public key in the same encryption and decryption algorithm.

[0132] Afterwards, the authorization data is decrypted using the private key to obtain the initial key.

[0133] Here, a decryption algorithm corresponding to the encryption algorithm for obtaining the authorization data may be adopted, and the authorization data may be decrypted using the private key, thereby obtaining the initial key.

[0134] Then, based on the initial key, the target encrypted data is decrypted to obtain the data to be encrypted.

[0135] Here, a decryption algorithm corresponding to the encryption algorithm for obtaining the target encrypted data may be adopted, and the target encrypted data may be decrypted using the initial key, thereby obtaining the data to be encrypted.

[0136] It can be understood that in the above application scenarios, symmetric encryption algorithms and asymmetric encryption algorithms can be combined to encrypt and decrypt part of the encrypted data (for data that occupies more storage space, this part is a smaller part) and use XOR operation to encrypt another part of the data (for data that occupies more storage space, this part is a larger part). In this way, the computational complexity of the encryption and decryption process can be reduced, thereby improving data access efficiency, and improving data security, and supporting segmented queries.

[0137] In this embodiment, the above step 102 can be performed in a variety of ways. For example, Figure 2 The above step 102 is performed in the manner shown. Figure 2 A flow chart of another data processing method provided in an embodiment of the present application. Figure 2 As shown, the method specifically includes:

[0138] Step 201, determine the byte length of the data to be encrypted to obtain a first length.

[0139] In this embodiment, the first length may be the byte length of the data to be encrypted.

[0140] Step 202: Determine whether the first length is an integer multiple of a preset length.

[0141] In this embodiment, the preset length may be a preset length, for example, the preset length may be a multiple of 1024, for example, 1024.

[0142] Step 203: When the first length is an integer multiple of the preset length, the data to be encrypted is evenly divided into data segments of the preset length.

[0143] Step 204, when the first length is not an integer multiple of the preset length, padding the data to be encrypted so that the padded data to be encrypted is an integer multiple of the preset length, and evenly dividing the padded data to be encrypted into data segments of the preset length.

[0144] In this embodiment, illustratively, if the first length is 2040 bits and the preset length is 1024 bits. Then, it can be determined that the first length is not an integer multiple of the preset length, that is, the first length cannot be divided by the preset length. Therefore, the data to be encrypted can be padded to obtain padded data to be encrypted with a length of 2048 bits (or other integer multiples of 1024, such as 4096 bits). Further, if the length of the padded data to be encrypted is 2048, then the data to be encrypted can be evenly divided into 2 data segments with a length of 1024.

[0145] In addition, the data used to fill in the data to be encrypted (ie, the filling data) can be determined in a variety of ways. For example, data of a required length can be intercepted from the preset data as the filling data.

[0146] In some optional implementations of this embodiment, when the first length is not an integer multiple of the preset length, the following method may be used to pad the data to be encrypted:

[0147] First, the character length of the padding data of the data to be encrypted is determined to obtain a second length.

[0148] The second length may be the character length of the padding data of the data to be encrypted. For example, if the character length of the data to be encrypted is 2040 bits, and the character length of the data to be encrypted needs to be padded to 2048 bits, then the second length may be the difference between 2048 and 2040.

[0149] Afterwards, the character length of the target data is determined to obtain a third length, wherein the target data corresponds to the second length.

[0150] For example, the target data and the second length may have the following corresponding relationship: the target data may represent the second length, or the target data may be represented as: the difference between the second length and the predetermined length, wherein the storage location of the predetermined length may be used to store the second length or the difference between the second length and the predetermined length.

[0151] The third length may be the character length of the target data.

[0152] Then, a random number having a target length is determined, wherein the target length is the difference between the second length and the third length.

[0153] Then, the random number and the target data are concatenated to obtain the completed data.

[0154] Finally, the padding data is padded to a preset position of the data to be encrypted.

[0155] Specifically, in the case where the target data is represented as the difference between the second length and the predetermined length, if the predetermined length is 2 bits, which is used to store data representing the second length "8", then the padding data can be composed of two parts. The length of the first part is 8-2=6 bits, and the 6-bit data can be randomly generated, and the length of the second part is 2 bits, and the 2-bit data can represent the second length "8", or the difference between the second length and the predetermined length, that is, 6.

[0156] It can be understood that in the above optional implementation method, the above method can be used to complete the encrypted data. In this way, during the decryption process, it can be more quickly identified which data belongs to the completed data and which data belongs to the encrypted data, thereby ensuring that the encrypted data can be correctly restored after encryption and decryption.

[0157] It should be noted that, in addition to the above contents, this embodiment may also include Figure 1 The corresponding technical features described in the corresponding embodiments are realized Figure 1 For details on the technical effects of the data processing method shown, please refer to Figure 1 For the sake of brevity, the relevant description is not repeated here.

[0158] The data processing method provided in the embodiment of the present application obtains a first length through the byte length of the data to be encrypted, and pads the data to be encrypted with a multiple relationship between the first length and the preset length, so that the padded data to be encrypted is an integer multiple of the preset length, thereby ensuring the execution of the XOR operation.

[0159] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application is shown in FIG. 1. In this embodiment, the method may continue to perform the following steps 301 to 304 after the above step 105.

[0160] Specifically, if Figure 3 As shown, the method specifically includes:

[0161] Step 301: divide the target encrypted data to obtain a second data segment sequence.

[0162] In this embodiment, each data fragment in the second data fragment sequence may be each part of the target encrypted data obtained by division.

[0163] For example, the target encrypted data may be divided into n L (e.g., L is a multiple of 1024 (i.e., the above fixed length)) byte length segments, thereby obtaining a second data segment sequence Y1, Y2, ..., Yn. Where n represents the number of data segments in the second data segment sequence. For example, n may be the quotient of the length of the target encrypted data and the above L.

[0164] Here, the division method of the above step 301 may correspond to the division method of the above step 102. Specifically, if the specific method of dividing the data to be encrypted is: dividing the data to be encrypted into data segments with a length of 1024 bits; then, the specific method of dividing the target encrypted data is: dividing the target encrypted data into data segments with a length of 1024 bits. If the specific method of dividing the data to be encrypted is: dividing the data to be encrypted into data segments with a length of 1024, 2048, 4096... bits; then, the specific method of dividing the target encrypted data is: dividing the target encrypted data into data segments with a length of 1024, 2048, 4096... bits.

[0165] Step 302: Decrypt the second fragment using the initial key to obtain first decrypted data, wherein the second fragment is the first data fragment in the second data fragment sequence.

[0166] In this embodiment, the first decrypted data may be a result obtained by decrypting the second fragment using the initial key.

[0167] Here, the decryption algorithm for decrypting the second fragment using the initial key may correspond to the encryption algorithm for decrypting the second fragment. Thus, the first decrypted data obtained may be the first fragment.

[0168] Step 303: For a data fragment in a second data fragment subsequence, perform an XOR operation on the data fragment and the first decrypted data to obtain second decrypted data corresponding to the data fragment; wherein the second data fragment subsequence is: a sequence composed of data fragments in the second data fragment sequence except the second fragment.

[0169] In this embodiment, the second encrypted data corresponding to the data segment may be a result obtained by performing an XOR operation on the data segment and the first segment.

[0170] As an example, if the second data segment subsequence includes "Y2, ..., Yn", and the second segment is Y1, then Y2, ..., Yn can be XORed with Y1 respectively to generate f(Y2), f(Y3), ..., f(Yn). Wherein, f(Yn) is the result obtained by performing an XOR operation on Yn and Y1, and n is a positive integer greater than 1.

[0171] Thus, n second decrypted data can be obtained.

[0172] Step 304: Generate the data to be encrypted based on the first decrypted data and the second decrypted data.

[0173] In this embodiment, the first decrypted data and the second decrypted data may be concatenated in the same order as the preset order described in step 105 to obtain the data to be encrypted. Alternatively, the preset characters or randomly generated characters described in step 105, the first fragment corresponding to the first encrypted data, and the first data fragment subsequence corresponding to the second encrypted data may be extracted in the preset order to obtain the data to be encrypted.

[0174] It should be noted that, in addition to the contents recorded above, this embodiment may also include the technical features described in the above embodiments, so as to achieve the technical effects of the data processing method shown above. Please refer to the above description for details. For the sake of brevity, it will not be repeated here.

[0175] The data processing method provided in the embodiment of the present application can process the data fragment and the second fragment in the second data fragment subsequence through an XOR operation to obtain the data to be encrypted, thereby reducing the complexity of the decryption calculation and improving the data query efficiency.

[0176] In some optional implementations of this embodiment, the following method may be used to generate the data to be encrypted based on the first decrypted data and the second decrypted data:

[0177] First, the first decrypted data and each of the obtained second decrypted data are concatenated to obtain intermediate data.

[0178] The first decrypted data and each of the second decrypted data may be spliced ​​in the same manner as the above splicing to obtain the completed data, thereby obtaining the intermediate data.

[0179] The intermediate data may be a result obtained by concatenating the first decrypted data and each of the second decrypted data.

[0180] Afterwards, it is determined whether the intermediate data includes the padding data.

[0181] The spliced ​​data may be part of the preset data, or the spliced ​​data may include data for representing the number of bits of the spliced ​​data, thereby determining whether the intermediate data includes the padding data.

[0182] Then, in the case that the intermediate data includes the padding data, the padding data in the intermediate data is deleted to obtain the data to be encrypted.

[0183] Here, as an example, the spliced ​​data may be part of the preset data, or the spliced ​​data may include data for representing the number of bits of the spliced ​​data, and thus the padding data may be identified based on this.

[0184] It can be understood that in the above optional implementation, when the intermediate data includes the padding data, the padding data in the intermediate data can be deleted, thereby more accurately restoring the data to be encrypted.

[0185] The following is an illustrative explanation using the example of the data to be encrypted being three-dimensional model data, but it should be noted that the embodiments of the present application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of the present application.

[0186] With more and more 3D application scenarios and higher precision of 3D models, the corresponding 3D model data files are getting larger and larger, often reaching GB. At the same time, the intellectual property rights and data security of 3D models are also receiving more and more attention. How to effectively protect the security of data files while ensuring the access efficiency of data files when the model data files are getting larger and larger has become a focus of industry development.

[0187] The data file is encrypted using a symmetric encryption algorithm, which has a much higher computational complexity than the Xor operation. It has little impact on small files, but for data files that are often GB or larger, such as 3D model data files, the reading and writing efficiency cannot meet the requirements.

[0188] The encryption process may include the following steps:

[0189] Before encrypting the model data file, a 128-bit key K is first generated by a random number generator or manually by the user as a starting key (ie, the above-mentioned initial key).

[0190] This K is encrypted with the user's public key Pb to generate authorization for the user (that is, the above-mentioned authorization data).

[0191] After that, the model data file is divided into n segments of L (L is a multiple of 1024) bytes in length, X1, X2, ..., Xn. The first segment of data X1 (i.e. the first segment mentioned above) is encrypted with K to generate ciphertext F(X1) (i.e. the first encrypted data mentioned above);

[0192] Perform an Xor operation on X2, ..., Xn (i.e., the data fragments in the first data fragment subsequence) and X1 to generate f(X2), f(X3), ..., f(Xn) (i.e., the second encrypted data);

[0193] Here, if the length of the encrypted model data file is less than L or the length of the last data segment is less than L, it is padded to L and then the above operation is performed.

[0194] The decryption process may include the following steps:

[0195] Decrypt the received user authorization using the user's private key Pr to obtain the decryption key K (that is, the initial key mentioned above);

[0196] Divide the encrypted model data file into n segments of L (L is a multiple of 1024) bytes in length, Y1, Y2, ..., Yn (i.e. the second data segment sequence mentioned above). Decrypt the first segment Y1 (i.e. the second segment mentioned above) with K to generate plaintext X1 (i.e. the first segment mentioned above or the first decrypted data mentioned above);

[0197] Perform an Xor operation on Y2, ..., Yn and X1 to generate X2, X3, ..., Xn (i.e., the first data fragment sequence mentioned above);

[0198] The padded data is deleted to obtain the data to be encrypted.

[0199] This method, through the comprehensive application of asymmetric encryption and decryption algorithms, symmetric encryption and decryption algorithms and XOR algorithms, can improve the access efficiency of model data files while ensuring data security, and support segmented access to model data files.

[0200] Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Specifically comprising:

[0201] The acquisition unit 401 is used to acquire the data to be encrypted and determine the initial key;

[0202] A first division unit 402 is used to divide the data to be encrypted to obtain a first data segment sequence;

[0203] A first encryption unit 403 is configured to encrypt a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence;

[0204] A first operation unit 404 is configured to perform an XOR operation on a data segment in a first data segment subsequence and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is a sequence of data segments in the first data segment sequence except the first segment;

[0205] The first generating unit 405 is configured to generate target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data.

[0206] In a possible implementation manner, dividing the data to be encrypted includes:

[0207] Determine the byte length of the data to be encrypted to obtain a first length;

[0208] Determining whether the first length is an integer multiple of a preset length;

[0209] When the first length is an integer multiple of the preset length, the data to be encrypted is evenly divided into data segments of the preset length;

[0210] When the first length is not an integer multiple of the preset length, the data to be encrypted is padded so that the padded data to be encrypted is an integer multiple of the preset length, and the padded data to be encrypted is evenly divided into data segments of the preset length.

[0211] In a possible implementation manner, when the first length is not an integer multiple of the preset length, padding the data to be encrypted includes:

[0212] Determine the character length of the padding data of the data to be encrypted to obtain a second length;

[0213] Determine the character length of the target data to obtain a third length, wherein the target data corresponds to the second length;

[0214] Determine a random number having a length equal to a target length, wherein the target length is a difference between the second length and the third length;

[0215] Concatenating the random number and the target data to obtain complementary data;

[0216] The padding data is padded to a preset position of the data to be encrypted.

[0217] In a possible implementation manner, after determining the initial key, the device further includes:

[0218] A second encryption unit (not shown in the figure), used to encrypt the initial key with a public key to obtain authorization data; and

[0219] After generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the device further includes:

[0220] A first decryption unit (not shown in the figure) is used to decrypt the target encrypted data based on the authorization data to obtain the data to be encrypted.

[0221] In a possible implementation, decrypting the target encrypted data based on the authorization data to obtain the data to be encrypted includes:

[0222] determining a private key of the public key;

[0223] Decrypting the authorization data using the private key to obtain the initial key;

[0224] Based on the initial key, the target encrypted data is decrypted to obtain the data to be encrypted.

[0225] In a possible implementation manner, after generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the device further includes:

[0226] A second division unit (not shown in the figure), used for dividing the target encrypted data to obtain a second data segment sequence;

[0227] A second decryption unit (not shown in the figure), configured to use the initial key to decrypt the second fragment to obtain first decrypted data, wherein the second fragment is the first data fragment in the second data fragment sequence;

[0228] A second operation unit (not shown in the figure) is used for performing an XOR operation on a data segment in a second data segment subsequence and the first decrypted data to obtain second decrypted data corresponding to the data segment; wherein the second data segment subsequence is a sequence of data segments in the second data segment sequence except the second segment;

[0229] The second generating unit (not shown in the figure) is used to generate the data to be encrypted based on the first decrypted data and the second decrypted data.

[0230] In a possible implementation, the generating the data to be encrypted based on the first decrypted data and the second decrypted data includes:

[0231] splicing the first decrypted data and each of the obtained second decrypted data to obtain intermediate data;

[0232] Determining whether the intermediate data includes padding data;

[0233] In the case where the intermediate data includes the padding data, the padding data in the intermediate data is deleted to obtain the data to be encrypted.

[0234] The data processing device provided in this embodiment may be as follows Figure 4 The data processing device shown in can execute all the steps of the data processing methods described above, thereby achieving the technical effects of the data processing methods described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.

[0235] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 5 The electronic device 500 shown includes: at least one processor 501, a memory 502, at least one network interface 504 and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 505 is not shown in FIG. Figure 5 Various buses are labeled as bus system 505 .

[0236] The user interface 503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0237] It can be understood that the memory 502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0238] In some implementations, the memory 502 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 5021 and an application program 5022 .

[0239] Among them, the operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 5022.

[0240] In this embodiment, by calling the program or instruction stored in the memory 502, specifically, the program or instruction stored in the application 5022, the processor 501 is used to execute the method steps provided by each method embodiment, for example, including:

[0241] Obtaining data to be encrypted and determining an initial key;

[0242] Dividing the data to be encrypted to obtain a first data segment sequence;

[0243] Encrypting a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence;

[0244] For a data segment in a first data segment subsequence, perform an XOR operation on the data segment and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is: a sequence composed of data segments in the first data segment sequence except the first segment;

[0245] Based on the first encrypted data and the second encrypted data, target encrypted data of the data to be encrypted is generated.

[0246] The method disclosed in the above embodiment of the present application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.

[0247] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.

[0248] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0249] The electronic device provided in this embodiment may be Figure 5 The electronic device shown in can execute all the steps of the data processing methods described above, thereby achieving the technical effects of the data processing methods described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.

[0250] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0251] When one or more programs in the storage medium can be executed by one or more processors, the data processing method executed on the electronic device side can be implemented.

[0252] The processor is used to execute the data processing program stored in the memory to implement the following steps of the data processing method performed on the electronic device side:

[0253] Obtaining data to be encrypted and determining an initial key;

[0254] Dividing the data to be encrypted to obtain a first data segment sequence;

[0255] Encrypting a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence;

[0256] For a data segment in a first data segment subsequence, perform an XOR operation on the data segment and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is: a sequence composed of data segments in the first data segment sequence except the first segment;

[0257] Based on the first encrypted data and the second encrypted data, target encrypted data of the data to be encrypted is generated.

[0258] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0259] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0260] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0261] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining data to be encrypted and determining an initial key; Dividing the data to be encrypted to obtain a first data segment sequence; Encrypting a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence; For a data segment in a first data segment subsequence, perform an XOR operation on the data segment and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is: a sequence composed of data segments in the first data segment sequence except the first segment; Based on the first encrypted data and the second encrypted data, target encrypted data of the data to be encrypted is generated.

2. The method according to claim 1, characterized in that The dividing the data to be encrypted comprises: Determine the byte length of the data to be encrypted to obtain a first length; Determining whether the first length is an integer multiple of a preset length; When the first length is an integer multiple of the preset length, the data to be encrypted is evenly divided into data segments of the preset length; When the first length is not an integer multiple of the preset length, the data to be encrypted is padded so that the padded data to be encrypted is an integer multiple of the preset length, and the padded data to be encrypted is evenly divided into data segments of the preset length.

3. The method according to claim 2, characterized in that When the first length is not an integer multiple of the preset length, padding the data to be encrypted includes: Determine the character length of the padding data of the data to be encrypted to obtain a second length; Determine the character length of the target data to obtain a third length, wherein the target data corresponds to the second length; Determine a random number having a length equal to a target length, wherein the target length is a difference between the second length and the third length; Concatenating the random number and the target data to obtain complementary data; The padding data is padded to a preset position of the data to be encrypted.

4. The method according to any one of claims 1 to 3, characterized in that: After determining the initial key, the method further includes: Encrypting the initial key with a public key to obtain authorization data; and After generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the method further includes: Based on the authorization data, the target encrypted data is decrypted to obtain the data to be encrypted.

5. The method according to claim 4, characterized in that The decrypting the target encrypted data based on the authorization data to obtain the data to be encrypted includes: determining a private key of the public key; Decrypting the authorization data using the private key to obtain the initial key; Based on the initial key, the target encrypted data is decrypted to obtain the data to be encrypted.

6. The method according to any one of claims 1 to 3, characterized in that: After generating target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data, the method further includes: Dividing the target encrypted data to obtain a second data segment sequence; Decrypting the second fragment using the initial key to obtain first decrypted data, wherein the second fragment is the first data fragment in the second data fragment sequence; For a data segment in a second data segment subsequence, perform an XOR operation on the data segment and the first decrypted data to obtain second decrypted data corresponding to the data segment; wherein the second data segment subsequence is: a sequence composed of data segments in the second data segment sequence except the second segment; The data to be encrypted is generated based on the first decrypted data and the second decrypted data.

7. The method according to claim 6, characterized in that The step of generating the data to be encrypted based on the first decrypted data and the second decrypted data includes: splicing the first decrypted data and each of the obtained second decrypted data to obtain intermediate data; Determining whether the intermediate data includes padding data; In the case where the intermediate data includes the padding data, the padding data in the intermediate data is deleted to obtain the data to be encrypted.

8. A data processing device, characterized in that: The device comprises: An acquisition unit, used to acquire data to be encrypted and determine an initial key; A first dividing unit, used for dividing the data to be encrypted to obtain a first data segment sequence; A first encryption unit, configured to encrypt a first fragment in the first data fragment sequence by using the initial key to obtain first encrypted data, wherein the first fragment is the first data fragment in the first data fragment sequence; A first operation unit is configured to perform an XOR operation on a data segment in a first data segment subsequence and the first segment to obtain second encrypted data corresponding to the data segment; wherein the first data segment subsequence is a sequence of data segments in the first data segment sequence except the first segment; The first generating unit is used to generate target encrypted data of the data to be encrypted based on the first encrypted data and the second encrypted data.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method described in any one of claims 1 to 7 is implemented.

10. 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 described in any one of claims 1 to 7 is implemented.