Encryption and decryption processing method and device, equipment and storage medium
By splicing the ciphertext sequences of the encrypted data objects and their adjacent data objects, chain ciphertext data is formed, which solves the problem of insufficient security of confidential data during data transmission in the prior art, and achieves more efficient data encryption and security guarantees.
Patent Information
- Application Number
- CN202311400075.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to effectively ensure the security of confidential data during data transmission, resulting in the risk of data leakage.
By obtaining the first ciphertext sequence of the data object to be encrypted and the second ciphertext sequence of the adjacent data object, the sequence extraction length is determined based on the sequence length and sequence extraction parameters of the second ciphertext sequence, the ciphertext sub-sequence is obtained, and it is spliced with the first ciphertext sequence to form chain ciphertext data to enhance the encryption security of the data.
It effectively avoids the risk of data leakage caused by only encrypted data objects to be encrypted separately, and improves the effectiveness and security of data encryption.
Smart Images

Figure CN119892385A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an encryption and decryption processing method, device, equipment and storage medium. Background Art
[0002] With the development of the Internet, more and more services are provided through the Internet, and more and more data are transmitted through the Internet. However, while providing convenience, the Internet also brings certain risks. Since data is transmitted online, the security of confidential data of the organization cannot be guaranteed during the transmission process, which will affect the user experience of the organization. Therefore, how to encrypt data more securely and effectively and reduce the risk of data leakage during data transmission is a focus of increasing concern for users and service providers. Summary of the invention
[0003] In a first aspect, an embodiment of the present application provides an encryption processing method, including:
[0004] Acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted;
[0005] determining a sequence extraction length of the second ciphertext sequence according to a sequence length of the second ciphertext sequence and a sequence extraction parameter of the second ciphertext sequence;
[0006] Performing sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence;
[0007] The ciphertext subsequence is concatenated with the first ciphertext sequence to obtain chained ciphertext data of the data object to be encrypted.
[0008] It can be seen that in the embodiment of the present application, in the process of encrypting the data object to be encrypted, firstly, the first ciphertext sequence of the data object to be encrypted and the second ciphertext sequence of the adjacent data object of the data object to be encrypted are obtained, and then the sequence extraction length of the second ciphertext sequence is determined according to the sequence length of the second ciphertext sequence and the sequence extraction parameter, and on this basis, the second ciphertext sequence is sequence extracted according to the sequence extraction length to obtain a ciphertext subsequence, and finally the ciphertext subsequence is concatenated with the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted, thereby, on the basis of performing a single encryption process on the data object to be encrypted to obtain the first ciphertext sequence, in combination with the second ciphertext sequence of the adjacent data object of the data object to be encrypted, the ciphertext subsequence in the second ciphertext sequence is concatenated with the first ciphertext sequence of the data object to be encrypted to obtain the chained ciphertext data of the data object to be encrypted, thereby avoiding the leakage of the data object to be encrypted when only the data object to be encrypted is encrypted alone, thereby improving the effectiveness of data encryption.
[0009] In a second aspect, an embodiment of the present application provides a decryption processing method, including:
[0010] Determining a data extraction length of the ciphertext data according to a data length of the ciphertext data in the encrypted data and a data extraction parameter of the ciphertext data;
[0011] Extracting the ciphertext data according to the data extraction length to obtain ciphertext sub-data;
[0012] Determining chained ciphertext data in the encrypted data that matches the ciphertext sub-data;
[0013] The chained ciphertext data is decrypted to obtain a data object; the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of the second ciphertext sequence of the adjacent data object.
[0014] In a third aspect, an embodiment of the present application provides an encryption processing device, including:
[0015] An acquisition module, used to acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted;
[0016] A determination module, configured to determine a sequence extraction length according to a sequence length of the second ciphertext sequence and a sequence extraction parameter corresponding to the second ciphertext sequence;
[0017] An extraction module, configured to perform sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence;
[0018] The concatenation module is used to concatenate the ciphertext subsequence with the first ciphertext sequence to obtain the chain ciphertext data of the data object to be encrypted.
[0019] In a fourth aspect, an embodiment of the present application provides a decryption processing device, including:
[0020] A length determination module, used to determine the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data;
[0021] A data extraction module, used to extract the ciphertext data according to the data extraction length to obtain ciphertext sub-data;
[0022] A data determination module, used to determine the chained ciphertext data matching the ciphertext sub-data in the encrypted data;
[0023] A decryption module is used to decrypt the chained ciphertext data to obtain a data object; the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of the second ciphertext sequence of the adjacent data object.
[0024] In a fifth aspect, an embodiment of the present application provides an encryption processing device, comprising: a processor; and a memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, cause the processor to execute the encryption processing method described in the first aspect.
[0025] In a sixth aspect, an embodiment of the present application provides a decryption processing device, comprising: a processor; and a memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, cause the processor to execute the decryption processing method described in the second aspect.
[0026] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the encryption processing method as described in the first aspect.
[0027] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the decryption processing method as described in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0029] Figure 1 A schematic diagram of an implementation environment of an encryption processing method provided in an embodiment of the present application;
[0030] Figure 2 A flowchart of an encryption processing method provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of object name encryption provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of chained ciphertext data provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of a sequence extraction parameter processing process provided in an embodiment of the present application;
[0034] Figure 6 A flowchart of an encryption processing method applied to a data object encryption scenario provided by an embodiment of the present application;
[0035] Figure 7 A flowchart of an encryption processing method applied to a text encryption scenario provided in an embodiment of the present application;
[0036] Figure 8 A processing flow chart of an encryption processing method applied to a video encryption scenario provided in an embodiment of the present application;
[0037] Fig. 9 A decryption processing method processing flow chart provided in an embodiment of the present application;
[0038] Fig.10 A processing flow chart of a decryption processing method applied to a data object decryption scenario provided in an embodiment of the present application;
[0039] Fig.11 A schematic diagram of an encryption processing device provided in an embodiment of the present application;
[0040] Fig.12 A schematic diagram of a decryption processing device provided in an embodiment of the present application;
[0041] Fig.13 A schematic diagram of the structure of an encryption processing device provided in an embodiment of the present application;
[0042] Fig.14 A schematic diagram of the structure of a decryption processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0044] The encryption and decryption processing method provided in one or more embodiments of this specification can be applied to the implementation environment of encryption and decryption processing, such as Figure 1As shown, the implementation environment at least includes an encryption server 101 for performing encryption processing and a decryption server 102 for performing decryption processing.
[0045] Among them, the encryption server 101 can be a server, or a server cluster composed of several servers, or one or more cloud servers in a cloud computing platform, which is used to perform chain encryption processing on the encrypted data, obtain the chain ciphertext data of the data object to be encrypted, and send the encrypted data containing the chain ciphertext data to the decryption server 102.
[0046] The decryption server 102 can be a single server, or a server cluster consisting of several servers, or one or more cloud servers in a cloud computing platform, and is used to decrypt the chained ciphertext data in the encrypted data received from the encryption server 101 to obtain a data object.
[0047] In this implementation environment, after the encryption server 101 obtains the first ciphertext sequence of the data object to be encrypted and the second ciphertext sequence of the adjacent data object, it first determines the sequence extraction length of the second ciphertext sequence according to the sequence length of the second ciphertext sequence and the sequence extraction parameter, and then performs sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence, and then concatenates the ciphertext subsequence with the first ciphertext sequence to obtain the chain ciphertext data of the data object to be encrypted.
[0048] On this basis, the encryption server 101 may send the chained ciphertext data containing the data object to be encrypted to the decryption server 102, so that the decryption server 102 decrypts the chained ciphertext data to obtain the data object.
[0049] This specification provides an encryption processing method embodiment:
[0050] In actual applications, when storing, transmitting and using data to be encrypted with a high security level, in addition to the file content, it is also necessary to ensure that other information associated with the file will not be leaked and there is no risk of leakage. If the associated information associated with the file is encrypted at the same time as the file, it is necessary to use other methods to record the auxiliary information used for decryption, which still has the risk of leakage. In addition, the auxiliary information must be stored and used together with the file, making this encryption method inflexible for various encryption scenarios.
[0051] To this end, the encryption processing method provided in the present embodiment first obtains a first ciphertext sequence obtained after individually encrypting a data object to be encrypted, and a second ciphertext data obtained after individually encrypting an adjacent data object to the data object to be encrypted, and then, performs sequence extraction on the second ciphertext sequence according to the sequence extraction length of the second ciphertext sequence to obtain a ciphertext subsequence, and concatenates the ciphertext subsequence with the first ciphertext sequence to obtain chained ciphertext data of the data object to be encrypted. In this way, in the process of encrypting the data object to be encrypted, after individually encrypting the data object to be encrypted to obtain the first ciphertext sequence, the ciphertext subsequence in the second ciphertext sequence is concatenated with the first ciphertext sequence with the help of the second ciphertext sequence of the adjacent data object to the data object to be encrypted to obtain the chained ciphertext data of the data object to be encrypted, thereby avoiding leakage of the data object to be encrypted when only the data object to be encrypted is encrypted individually, thereby improving the effectiveness of data encryption.
[0052] Reference Figure 2 The encryption processing method provided in this embodiment includes steps S202 to S208.
[0053] Step S202: Acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of adjacent data objects of the data object to be encrypted.
[0054] The data object in this embodiment includes data that can be stored, transmitted and used; optionally, the data object to be encrypted includes at least one of the following: a file, a video, and a voice stream. The data object to be encrypted refers to a data object that needs to be encrypted during storage, transmission and / or use. It should be noted that in order to distinguish data objects, different data objects have different object names.
[0055] In the specific implementation, in the process of encrypting multiple data objects to be encrypted, firstly, multiple data objects to be encrypted are obtained, and then each of the multiple data objects to be encrypted is encrypted to obtain a ciphertext sequence of each data object to be encrypted; then, based on the ciphertext sequence of adjacent data objects of each data object to be encrypted, the ciphertext sequence of each data object to be encrypted is updated to obtain chained ciphertext data of each data object to be encrypted.
[0056] In this embodiment, the multiple data objects to be encrypted may be multiple data objects that are stored, transmitted and used at the same time; or they may be multiple data objects to be encrypted obtained by splitting a data object, which is not limited in this embodiment. Optionally, the multiple data objects to be encrypted may be multiple data objects to be encrypted contained in a data object set containing the data object to be encrypted. The data object to be encrypted and the adjacent data objects are in the same data object set. The ciphertext sequence may be the encryption result expressed in the form of an array obtained after encrypting each data object to be encrypted.
[0057] In the specific execution process, in order to ensure that the encryption results of each data object to be encrypted are different after the encryption processing is performed on each data object to be encrypted, so as to distinguish the data objects to be encrypted, in the process of encrypting each data object to be encrypted to obtain the ciphertext sequence of each data to be encrypted, the encryption parameters of each data object to be encrypted are generated according to the pre-configured encryption configuration length, and the encryption processing is performed on each data object to be encrypted according to the encryption parameters of each data object to be encrypted to obtain the ciphertext sequence of each data object to be encrypted; in an optional implementation manner provided by this embodiment, taking a data object to be encrypted as an example, the following operations are performed in the process of encrypting the data object to be encrypted to obtain the first ciphertext sequence:
[0058] Generating encryption parameters of the data object to be encrypted according to the encryption configuration length of the data object to be encrypted;
[0059] Based on the encryption parameters, the data object to be encrypted is encrypted to obtain the first ciphertext sequence.
[0060] Optionally, the encryption parameter refers to a salt value used for encryption processing; the encryption configuration length includes the length of a preset salt value.
[0061] Specifically, a character string of an encryption configuration length is randomly generated for the data object to be encrypted as an encryption parameter of the data object to be encrypted, and the data object to be encrypted is encrypted with salt. In this way, by randomly generating encryption parameters, it is ensured that the ciphertext sequences of the same data object to be encrypted in multiple data objects to be encrypted are different, thereby avoiding the leakage of the same data object to be encrypted due to the same ciphertext sequences of the same data object to be encrypted.
[0062] It should be noted that since the ciphertext sequence is the encryption result represented in the form of an array, if the encryption result of each data object to be encrypted obtained after the encryption process is not in the form of an array, the encryption result is converted into the form of an array to obtain the ciphertext sequence of each data object to be encrypted.
[0063] In the process of encrypting the data object to be encrypted, in addition to encrypting the data object to be encrypted according to the encryption parameters, in this embodiment, the object name of the data object to be encrypted is also encrypted based on the encryption parameters of the data object to be encrypted to obtain the ciphertext name of the data object to be encrypted, thereby ensuring the comprehensiveness of the encryption. Based on this, in an optional implementation manner provided by this embodiment, in the process of encrypting the data object to be encrypted, the following operations are further performed:
[0064] Based on the encryption parameters of the data object to be encrypted, encrypt the object name of the data object to be encrypted to obtain an initial encrypted name;
[0065] The encryption parameter and the initial encryption name are concatenated to obtain the ciphertext name of the data object to be encrypted.
[0066] The above provides a process for encrypting the object name of a data object to be encrypted. In the process of encrypting the object name of each data object to be encrypted among multiple data objects to be encrypted, the object name of each data object to be encrypted is encrypted based on the encryption parameters of each data object to be encrypted to obtain an initial encrypted name, thereby ensuring that the encryption method of each data object to be encrypted is consistent. After obtaining the initial encrypted name, the encryption parameters of each data object to be encrypted and the initial encrypted name are concatenated to obtain the ciphertext name of each data object to be encrypted, so that the ciphertext name of each data object to be encrypted includes the encryption parameters for encryption processing, so that decryption processing is performed based on the encryption parameters during the decryption processing.
[0067] In order to prevent the data format of the data object to be encrypted from being disclosed, the object name includes not only the name of the data object to be encrypted but also the data format of the data object to be encrypted; Figure 3As shown, multiple data objects to be encrypted include files a.com, b.com, c.com, d.com and e.com, and salt values of each file are randomly generated as salt1, salt2, salt3, salt4 and salt5. Based on salt1, a.com is encrypted with salt to obtain an initial encryption name of a.com as encryption1. Based on salt2, b.com is encrypted with salt to obtain an initial encryption name of b.com as encryption2. By analogy, the initial encryption name of c.com is encryption3, the initial encryption name of d.com is encryption4, and the initial encryption name of e.com is encryption5. Then, the salt value of each file is concatenated to the initial encryption name of each file, and the ciphertext name of a.com is encryption1salt1, the ciphertext name of b.com is encryption2salt2, the ciphertext name of c.com is encryption3salt3, the ciphertext name of d.com is encryption4salt4, and the ciphertext name of e.com is encryption5salt5.
[0068] By encrypting each of the multiple data objects to be encrypted, a ciphertext sequence of each data object to be encrypted is obtained, and the encryption of the file name and file format is realized. On this basis, by modifying the content of the ciphertext sequence of each data object to be encrypted, a virtual chain relationship is satisfied between the multiple data objects to be encrypted, and the relationship between the multiple data objects to be encrypted is represented based on the virtual chain relationship, and the relationship between the multiple data objects to be encrypted is encrypted.
[0069] In the specific implementation, in the process of modifying the content of the ciphertext sequence so that multiple data objects to be encrypted satisfy a virtual chain relationship, first determine the adjacent data objects of each data object to be encrypted; in order to satisfy a virtual chain relationship between multiple data objects to be encrypted, build an implicit chain based on multiple data objects to be encrypted. Since it can be called a chain, the previous node on the chain must record the information of the next node. This is a one-way chain. If the next node also records the information of the previous node, it is a two-way chain. The implicit chain in this embodiment is a two-way chain. Not only can the chain tail be found from the chain head, but also the chain head can be found from the chain tail. The implicit chain in this embodiment has two core functions. One is that it can determine which data objects to be encrypted are on the implicit chain, and the other is that the data objects to be encrypted that constitute the implicit chain have a sequential relationship. Therefore, the data objects to be encrypted of all other nodes can be found one by one based on the data objects to be encrypted of any node in the implicit chain.
[0070] Based on this, in the process of modifying the content of the ciphertext sequence to make multiple data objects to be encrypted satisfy a virtual chain relationship, the adjacent data objects of each data object to be encrypted are first determined, that is, the object order between the multiple data objects to be encrypted that construct the implicit chain is determined; optionally, the multiple data objects to be encrypted are divided into chain head data objects, chain body data objects and chain tail data objects; wherein the number of adjacent data objects of the chain head data object and the chain tail data object is one, and the number of adjacent data objects of the chain body data object is two.
[0071] In the specific process of constructing a virtual chain relationship, the adjacent data objects of each data object to be encrypted are determined by determining a chain head data object, a chain tail data object and a chain body data object sequence among multiple data objects to be encrypted, and the ciphertext sequence of each data object to be encrypted is updated based on the adjacent data objects of each data object to be encrypted to obtain the chain ciphertext data of each data object to be encrypted.
[0072] In an optional implementation manner provided by this embodiment, in the process of determining adjacent data objects of each data object to be encrypted, the following operations are performed:
[0073] Randomly determine a chain head data object, a chain body data object sequence, and a chain tail data object among the multiple data objects to be encrypted;
[0074] Concatenate the chain head data object, the chain body data object sequence and the chain tail data object to obtain a data object sequence;
[0075] At least one adjacent data object of each of the to-be-encrypted data objects is determined according to the data object sequence.
[0076] Optionally, the chain body data object sequence is formed by randomly arranging the data objects to be encrypted other than the chain head data object and the chain tail data object among the multiple data objects to be encrypted.
[0077] Specifically, a chain head data object and a chain tail data object are randomly selected from multiple data objects to be encrypted, and the remaining data objects except the chain head data object and the chain tail data object in the multiple data objects to be encrypted are used as chain body data objects, and the chain body data objects are randomly sorted to obtain a chain body data object sequence, and finally the chain head data object, the chain body data object sequence and the chain tail data object are spliced to obtain a data object sequence, and the adjacent data objects of each data object to be encrypted are determined according to the data object sequence.
[0078] For example, multiple data objects to be encrypted include data object 1 to be encrypted, data object 2 to be encrypted, data object 3 to be encrypted and data object 4 to be encrypted, data object 1 to be encrypted is randomly determined to be the chain head data object, data object 4 to be encrypted is the chain tail data object, data object 2 to be encrypted and data object 3 to be encrypted constitute a chain body data object sequence, then the spliced data object sequence is data object 1 to be encrypted-data object 2 to be encrypted-data object 3 to be encrypted-data object 4 to be encrypted; based on the data object sequence, it is determined that the adjacent data object of data object 1 to be encrypted is data object 2 to be encrypted, the adjacent data objects of data object 2 to be encrypted include data object 1 to be encrypted and data object 3 to be encrypted, the adjacent data objects of data object 3 to be encrypted include data object 2 to be encrypted and data object 4 to be encrypted, and the adjacent data object of data object 4 to be encrypted is data object 3 to be encrypted.
[0079] In order to ensure the relationship between multiple data objects to be encrypted, in this embodiment, when the adjacent data objects of each data object to be encrypted are determined, the ciphertext sequence of each data object to be encrypted is updated based on the ciphertext sequence and sequence extraction length of the adjacent data objects of each data object to be encrypted to obtain the chained ciphertext data of each data object to be encrypted.
[0080] In this embodiment, the ciphertext subsequence corresponding to the sequence extraction length in the ciphertext sequence of each data object to be encrypted is concatenated with the adjacent data objects to update the ciphertext sequence of the adjacent data objects, so that the ciphertext sequence of each data object to be encrypted contains part of the ciphertext sequence of the adjacent data objects, thereby representing the relationship between the data objects to be encrypted.
[0081] The following takes a data object to be encrypted as an example to specifically explain the ciphertext sequence and sequence extraction length of adjacent data objects based on the data object to be encrypted, and the updating process of the ciphertext sequence of the data object to be encrypted; wherein, the first ciphertext sequence is the encryption result obtained by encrypting the data object to be encrypted based on the encryption parameters of the data object to be encrypted, and the second ciphertext sequence is the encryption result obtained by encrypting adjacent data objects based on the encryption parameters of the adjacent data objects of the data object to be encrypted; the encryption parameters of the data object to be encrypted and the encryption parameters of the adjacent data objects are consistent in length.
[0082] In the process of updating the ciphertext sequence of the data object to be encrypted based on the ciphertext sequence of the adjacent data objects of the data object to be encrypted and the sequence extraction length, the first ciphertext sequence of the data object to be encrypted and the second ciphertext sequence of the adjacent data objects of the data object to be encrypted are first obtained.
[0083] Step S204: determining a sequence extraction length of the second ciphertext sequence according to the sequence length of the second ciphertext sequence and a sequence extraction parameter of the second ciphertext sequence.
[0084] The sequence length includes the length of the array contained in the second ciphertext sequence; the sequence extraction parameter includes the parameter calculated according to the preset algorithm; the sequence extraction length includes the length of the array extracted from the second ciphertext sequence.
[0085] During specific implementation, in order to concatenate the ciphertext subsequences in the second ciphertext sequence to the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted, in this embodiment, the sequence extraction length of the second ciphertext sequence is calculated; optionally, the sequence extraction length of the second ciphertext sequence is calculated based on the sequence length of the second ciphertext sequence and the sequence extraction parameters.
[0086] In an optional implementation manner provided by this embodiment, in the process of determining the sequence extraction length of the second ciphertext sequence according to the sequence length of the second ciphertext sequence and the sequence extraction parameter of the second ciphertext sequence, the following operations are performed:
[0087] Selecting a random value in a preset value interval by a random algorithm, and taking the ratio of the random value to a preset threshold as the sequence extraction parameter;
[0088] A sequence extraction length of the second ciphertext sequence is determined according to the sequence length and the sequence extraction parameter.
[0089] Specifically, a random value is selected in a preset value range through a random algorithm, and then the ratio of the random value to a preset threshold is calculated as a sequence extraction parameter, and the product of the sequence extraction parameter and the sequence length is calculated as the sequence extraction length of the second ciphertext sequence.
[0090] For example, the length of the ciphertext sequence of the data object 1 to be encrypted is 200, using the formula:
[0091] Sequence extraction length = sequence length × random (5, 20) ÷ 100;
[0092] When random(5, 20)=20, the sequence extraction length of the ciphertext sequence of the to-be-encrypted data object 1 is 40. Here, random(5, 20) is a random value, and 100 is a preset threshold.
[0093] It should be noted that, in the present embodiment, after obtaining the sequence extraction length of the second ciphertext sequence, it is also possible to verify whether the sequence extraction length of the second ciphertext sequence is equal to the sequence extraction lengths of the ciphertext sequences of other data objects to be encrypted. If they are equal, the sequence extraction length of the second ciphertext sequence is re-determined in the above manner until it is no longer equal to the sequence extraction lengths of the ciphertext sequences of other data objects to be encrypted. If they are not equal, the following step S206 is executed based on the sequence extraction length, and the second ciphertext sequence is sequence extracted according to the sequence extraction length to obtain a ciphertext subsequence. In this way, by calculating unequal sequence extraction lengths for the ciphertext sequences of different data objects to be encrypted, the data size of each data object to be encrypted can be hidden.
[0094] Step S206: performing sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence.
[0095] The ciphertext subsequence includes a partial sequence extracted from the second ciphertext sequence according to the sequence extraction length. Optionally, the ciphertext subsequence includes a first ciphertext subsequence and / or a second ciphertext subsequence. The first ciphertext subsequence includes a ciphertext subsequence spliced to the first position of the first ciphertext sequence, and the second ciphertext subsequence includes a ciphertext subsequence spliced to the second position of the first ciphertext sequence. Taking the ciphertext sequence as the origin, the first position and the second position are described, the first position is the left side (or front part) of the ciphertext sequence, and the second position is the right side (or back part) of the ciphertext sequence.
[0096] The sequence extraction length of the second ciphertext sequence is determined above. In this step, sequence extraction is performed on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence.
[0097] In an optional implementation manner provided by this embodiment, the following method is used to extract the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence:
[0098] Determining a sequence extraction position of the second ciphertext sequence according to a positional relationship between the adjacent data object and the data object to be encrypted;
[0099] According to the sequence extraction length and the sequence extraction position, sequence extraction is performed on the second ciphertext sequence to obtain a ciphertext subsequence.
[0100] Specifically, in order to ensure the regularity of chained ciphertext data, in the process of extracting the second ciphertext sequence according to the sequence extraction length, the sequence extraction position of the second ciphertext sequence is determined according to the positional relationship between the adjacent data objects and the data object to be encrypted, and the second ciphertext sequence is extracted according to the sequence extraction length and the sequence extraction position to obtain a ciphertext subsequence.
[0101] Since there is a sequence between the data objects to be encrypted, with the data object to be encrypted as the origin (or base point), the data object to be encrypted adjacent to the left (or previous node) of the data object to be encrypted is determined as the first adjacent data object, and the data object to be encrypted adjacent to the right (or next node) of the data object to be encrypted is determined as the second adjacent data object. Optionally, if the adjacent data object is the first adjacent data object of the data object to be encrypted, the sequence extraction position of the second ciphertext sequence is determined to be the second extraction position of the second ciphertext sequence; if the adjacent data object is the second adjacent data object of the data object to be encrypted, the sequence extraction position of the second ciphertext sequence is determined to be the first extraction position of the second ciphertext sequence. Optionally, the first extraction position is the starting position of the second ciphertext sequence; the second extraction position is the ending position of the second ciphertext sequence; for example, the second ciphertext sequence is "mnbvcx", if the sequence extraction position is the first extraction position, that is, the starting position, then starting from m, sequence extraction is performed along the direction of "mnbvcx", if the sequence extraction length is 2, the obtained ciphertext subsequence is mn; if the sequence extraction position is the second extraction position, that is, the ending position, that is, starting from x, sequence extraction is performed along the direction of "xcvbnm", if the sequence extraction length is 2, the obtained ciphertext subsequence is cx.
[0102] Furthermore, for a data object to be encrypted, there is a situation where sequence extraction needs to be performed from the first extraction position and the second extraction position respectively. In order to distinguish the ciphertext subsequences extracted from the first extraction position and the second extraction position of the same data object to be encrypted, optionally, with the ciphertext sequence as the origin, the ciphertext subsequence obtained by sequence extraction from the first extraction position of the ciphertext sequence is taken as the left ciphertext subsequence, and the ciphertext subsequence obtained by sequence extraction from the second extraction position of the ciphertext sequence is taken as the right ciphertext subsequence. That is, the above extraction is the right ciphertext subsequence of the first adjacent data object, and / or the left ciphertext subsequence of the second adjacent data object.
[0103] It should be noted that if the number of adjacent data objects is two, the first ciphertext sequence is updated based on each adjacent data object according to the method provided in this embodiment to obtain a chain ciphertext sequence of the data object to be encrypted. Specifically, the above-mentioned process of extracting the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence can be implemented in the following manner: according to the sequence extraction length of the first adjacent data object in the adjacent data objects, sequence extraction is performed from the second extraction position (or end position) of the ciphertext sequence of the first adjacent data object to obtain a first ciphertext subsequence, and / or, according to the sequence extraction length of the second adjacent data object in the adjacent data object, sequence extraction is performed from the first extraction position (or starting position) of the ciphertext sequence of the second adjacent data object to obtain a second ciphertext subsequence.
[0104] In addition, step S206 can also be replaced by performing sequence extraction on the second ciphertext sequence according to the sequence extraction length and the positional relationship between the adjacent data object and the data object to be encrypted to obtain a ciphertext subsequence, and forming a new implementation method with other processing processes provided in this embodiment.
[0105] Step S208: concatenate the ciphertext subsequence with the first ciphertext sequence to obtain chained ciphertext data of the data object to be encrypted.
[0106] The above-mentioned step extracts the second ciphertext sequence according to the sequence extraction length of the second ciphertext sequence to obtain a ciphertext subsequence of the second ciphertext sequence. This step obtains chained ciphertext data of the data object to be encrypted by concatenating the ciphertext subsequences of adjacent data objects of the data object to be encrypted with the first ciphertext sequence of the data object to be encrypted.
[0107] In order to enable the data object to be encrypted to represent its relationship with adjacent data objects, in an optional implementation manner provided by this embodiment, in the process of concatenating the ciphertext subsequence with the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted, the following operations are performed:
[0108] Determining, according to the positional relationship, a sequence splicing position of the ciphertext subsequence in the first ciphertext sequence;
[0109] Based on the sequence splicing position, the ciphertext subsequence is spliced to the first ciphertext sequence to obtain the chain ciphertext data.
[0110] In order to ensure the regularity of chained ciphertext data, the sequence extraction position of the second ciphertext sequence is determined based on the positional relationship between the adjacent data object and the data object to be encrypted, and then the second ciphertext sequence is sequence extracted based on the sequence extraction position and the sequence extraction length. On this basis, in order to ensure the regularity of chained ciphertext data, the sequence splicing position of the ciphertext subsequence in the first ciphertext sequence is determined based on the positional relationship between the adjacent data object and the data object to be encrypted, and the ciphertext subsequence is spliced to the first ciphertext sequence based on the sequence splicing position to obtain the chained ciphertext data of the data object to be encrypted. Specifically, if the adjacent data object is the first adjacent data object of the data object to be encrypted, the sequence splicing position is determined to be the first position of the first ciphertext sequence, and if the adjacent data object is the second adjacent data object of the data object to be encrypted, the sequence splicing position is determined to be the second position of the first ciphertext sequence.
[0111] Optionally, the chained ciphertext data is composed of a first ciphertext sequence and a ciphertext subsequence. Optionally, the ciphertext subsequence includes a first ciphertext subsequence and / or a second ciphertext subsequence; taking the first ciphertext sequence as the origin (or base point), if the splicing position of the ciphertext subsequence in the chained ciphertext data is located to the left (or front) of the first ciphertext sequence, then the ciphertext subsequence is the first ciphertext subsequence, and the sequence splicing position of the first ciphertext subsequence in the first ciphertext sequence is the first position; if the splicing position of the ciphertext subsequence in the chained ciphertext data is located to the right (or back) of the first ciphertext sequence, then the ciphertext subsequence is the second ciphertext subsequence, and the sequence splicing position of the second ciphertext subsequence in the first ciphertext sequence is the second position.
[0112] The data object to be encrypted adjacent to the left of the above-mentioned data object to be encrypted is determined as the first adjacent data object, and the data object to be encrypted adjacent to the right of the data object to be encrypted is determined as the second adjacent data object. Optionally, the ciphertext subsequence of the first adjacent data object is determined as the first ciphertext subsequence, and the ciphertext sequence of the second adjacent data object is determined as the second ciphertext subsequence.
[0113] Specifically, in the process of splicing the ciphertext subsequence with the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted, the first ciphertext subsequence obtained by sequence extraction from the second extraction position of the ciphertext sequence of the first adjacent data object to be encrypted is spliced to the first position of the first ciphertext sequence, and / or the second ciphertext subsequence obtained by sequence extraction from the first extraction position of the ciphertext sequence of the second adjacent data object to be encrypted is spliced to the second position of the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted. Optionally, the first ciphertext subsequence is spliced to the first position of the first ciphertext sequence, and / or the second ciphertext subsequence is spliced to the second position of the first ciphertext sequence.
[0114] Optionally, the chained ciphertext data of the data object to be encrypted consists of a ciphertext subsequence of a first adjacent data object of the data object to be encrypted, a ciphertext sequence of the data object to be encrypted, and a ciphertext subsequence of a second adjacent data object of the data object to be encrypted.
[0115] Continuing to take the data object sequence of to-be-encrypted data object 1-to-be-encrypted data object 2-to-be-encrypted data object 3-to-be-encrypted data object 4 as an example, in order to distinguish the ciphertext sequence of the data object to be encrypted from the ciphertext sequence of the adjacent data objects, the ciphertext sequence of the data object to be encrypted is taken as the first ciphertext sequence, and the ciphertext sequence of the adjacent data objects is taken as the second ciphertext sequence. The following is an explanation based on the ciphertext sequence of each data object to be encrypted; Figure 4 As shown, Figure 4It contains 4 chained ciphertext data, namely: the chained ciphertext data of data object 1 to be encrypted: "array 1 (the array before a in the ciphertext sequence of data object 1 to be encrypted) + a + b"; the chained ciphertext data of data object 2 to be encrypted: "a + b + array 2 (the array between b and c in the ciphertext sequence of data object 2 to be encrypted) + c + d"; the chained ciphertext data of data object 3 to be encrypted: "c + d + array 3 (the array between d and e in the ciphertext sequence of data object 3 to be encrypted) + e + f"; the chained ciphertext data of data object 4 to be encrypted: "e + f + array 4 (the array after f in the ciphertext sequence of data object 4 to be encrypted)";
[0116] Among them, array 1+a is the ciphertext sequence of the data object 1 to be encrypted, and a is the right ciphertext subsequence of the data object 1 to be encrypted;
[0117] b+array2+c is the ciphertext sequence of the data object 2 to be encrypted, b is the left ciphertext subsequence of the data object 2 to be encrypted, and c is the right ciphertext subsequence of the data object 2 to be encrypted;
[0118] d+array3+e is the ciphertext sequence of the data object 3 to be encrypted, d is the left ciphertext subsequence of the data object 3 to be encrypted, and e is the right ciphertext subsequence of the data object 3 to be encrypted;
[0119] f+array 4 is the ciphertext sequence of the data object 4 to be encrypted, and f is the left ciphertext subsequence of the data object 4 to be encrypted;
[0120] Furthermore, the chained ciphertext data of the data object 1 to be encrypted consists of the ciphertext sequence of the data object 1 to be encrypted and the second ciphertext subsequence (the left ciphertext subsequence of the data object 2 to be encrypted); the chained ciphertext data of the data object 2 to be encrypted consists of the first ciphertext subsequence (the right ciphertext subsequence of the data object 1 to be encrypted), the ciphertext sequence of the data object 2 to be encrypted, and the second ciphertext subsequence (the left ciphertext subsequence of the data object 3 to be encrypted); the chained ciphertext data of the data object 3 to be encrypted consists of the first ciphertext subsequence (the right ciphertext subsequence of the data object 2 to be encrypted), the ciphertext sequence of the data object 3 to be encrypted, and the second ciphertext subsequence (the left ciphertext subsequence of the data object 4 to be encrypted); the chained ciphertext data of the data object 4 to be encrypted consists of the first ciphertext subsequence (the right ciphertext subsequence of the data object 3 to be encrypted) and the ciphertext sequence of the data object 4 to be encrypted. Optionally, the first ciphertext subsequence of the chained ciphertext data of the data object to be encrypted includes the right ciphertext subsequence of the first adjacent data object of the data object to be encrypted; the second ciphertext subsequence of the chained ciphertext data of the data object to be encrypted includes the left ciphertext subsequence of the second adjacent data object of the data object to be encrypted.
[0121] In the specific splicing process, the right ciphertext subsequence of the first adjacent data object of the data object to be encrypted (that is, the ciphertext subsequence obtained by sequence extraction from the second extraction position of the ciphertext sequence of the first adjacent data object) is spliced to the first position of the first ciphertext sequence, and / or, the left ciphertext subsequence of the second adjacent data object of the data object to be encrypted (that is, the ciphertext subsequence obtained by sequence extraction from the first extraction position of the ciphertext sequence of the second adjacent data object) is spliced to the second position of the first ciphertext sequence, so as to obtain the chain ciphertext data of the data object to be encrypted.
[0122] Optionally, the right ciphertext subsequence of the first adjacent data object of the data object to be encrypted and the left ciphertext subsequence of the data object to be encrypted constitute a link identifier between the data object to be encrypted and the first adjacent data object, and the chain ciphertext data of the data object to be encrypted and the first adjacent data object both contain the link identifier; similarly, the left ciphertext subsequence of the second adjacent data object of the data object to be encrypted and the right ciphertext subsequence of the data object to be encrypted constitute a link identifier between the data object to be encrypted and the second adjacent data object, and the chain ciphertext data of the data object to be encrypted and the second adjacent data object both contain the link identifier, and the relationship between the data objects to be encrypted is characterized based on the link identifier.
[0123] The above is an explanation of the process of determining the chain ciphertext data of a data object to be encrypted as an example. Any data object to be encrypted among multiple data objects to be encrypted is determined in the above manner. Please refer to the above related content, and this embodiment will not be repeated here.
[0124] In the following, in the process of determining the chained ciphertext data of each data object to be encrypted in a data object sequence including multiple data objects to be encrypted, sequence extraction of the ciphertext sequence of each data object to be encrypted and concatenation between the data objects to be encrypted are specifically described.
[0125] Continuing to take the data object sequence of data object 1 to be encrypted - data object 2 to be encrypted - data object 3 to be encrypted - data object 4 to be encrypted as an example, the generation of chain ciphertext data of each data object to be encrypted is described. The calculated sequence extraction length of data object 1 to be encrypted is 40, the sequence extraction length of data object 2 to be encrypted is 30, the sequence extraction length of data object 3 to be encrypted is 100, and the sequence extraction length of data object 4 to be encrypted is 10;
[0126] The above Figure 4 The composition of the chain ciphertext data in Figure 4 The composition process of the chain ciphertext data is described in detail; Figure 4As shown, the last 40 arrays a in the ciphertext sequence of the data object 1 to be encrypted are extracted as the right ciphertext subsequence of the data object 1 to be encrypted, and the right ciphertext subsequence is spliced to the first position of the ciphertext sequence of the data object 2 to be encrypted, that is, it is spliced to the left of the ciphertext sequence of the data object 2 to be encrypted. The first 30 arrays b in the ciphertext sequence of the data object 2 to be encrypted are extracted as the left ciphertext subsequence of the data object 2 to be encrypted, and the left ciphertext subsequence is spliced to the second position of the ciphertext sequence of the data object 1 to be encrypted, that is, it is spliced to the right of the ciphertext sequence of the data object 1 to be encrypted. At this point, the link identifier of the data object 1 to be encrypted and the data object 2 to be encrypted is a+b, and the chain ciphertext data of the data object 1 to be encrypted is array 1+a+b. Since the data object 2 to be encrypted also has a second adjacent data object to be encrypted as the data object 3 to be encrypted, the last 30 arrays c in the ciphertext sequence of the data object 2 to be encrypted are extracted as the right ciphertext subsequence of the data object 2 to be encrypted, and the right ciphertext subsequence is spliced to the second position of the ciphertext sequence of the data object 1 to be encrypted, that is, it is spliced to the right of the ciphertext sequence of the data object 1 to be encrypted. The sequence is spliced to the first position of the ciphertext sequence of the data object 3 to be encrypted, the first 100 arrays d in the ciphertext sequence of the data object 3 to be encrypted are extracted as the left ciphertext subsequence of the data object 3 to be encrypted, and the left ciphertext subsequence is spliced to the second position of the ciphertext sequence of the data object 2 to be encrypted, the last 100 arrays e in the ciphertext sequence of the data object 3 to be encrypted are extracted as the right ciphertext subsequence of the data object 3 to be encrypted, and the right ciphertext subsequence is spliced to the first position of the ciphertext sequence of the data object 4 to be encrypted, the first 10 arrays f in the ciphertext sequence of the data object 4 to be encrypted are used as the left ciphertext subsequence of the data object 4 to be encrypted, and the left ciphertext subsequence is spliced to the second position of the ciphertext sequence of the data object 3 to be encrypted, thereby obtaining the chained ciphertext data of the data object 2 to be encrypted as a+b+array 2+c+d, the chained ciphertext data of the data object 3 to be encrypted as c+d+array 3+e+f, and the chained ciphertext data of the data object 4 to be encrypted as e+f+array 4. The link identifiers of the data object to be encrypted 2 and the data object to be encrypted 3 are c+d, and the link identifiers of the data object to be encrypted 3 and the data object to be encrypted 4 are e+f.
[0127] After the implicit chain is constructed by chained ciphertext data of each data object to be encrypted including link identifiers, the link identifiers can be used to verify whether the data objects on the implicit chain are complete; specifically, if the link identifier of the previous data object to be encrypted on the implicit chain is consistent with the link identifier of the next data object to be encrypted, it means that the data object to be encrypted on the implicit chain is complete; if the link identifier of the previous data object to be encrypted on the implicit chain is inconsistent with the link identifier of the next data object to be encrypted, it means that the data object to be encrypted on the implicit chain is incomplete;
[0128] The data size of the data object to be encrypted can also be hidden through the link identifier. Since adjacent data objects to be encrypted have ciphertext subsequences determined by unequal sequence extraction lengths, each data object to be encrypted is equivalent to increasing at least one random value, which effectively hides the data size of the data object to be encrypted.
[0129] The link identifier also constrains the object order of the data objects on the implicit chain. Since the link identifiers of adjacent data objects to be encrypted are the same, the adjacent data objects of each data object to be encrypted can be determined based on the link identifier, thereby obtaining the object order of the data objects on the implicit chain.
[0130] In the specific execution process, after obtaining the chain ciphertext data of each data object to be encrypted, the chain ciphertext data of each data object to be encrypted is transmitted, stored and used, thereby preventing the data object to be encrypted from being leaked. In order to further avoid the risk of data leakage during data transmission based on the chain ciphertext data of the data object to be encrypted, in an optional implementation manner provided by this embodiment, during the data transmission process, the following operation is performed:
[0131] Acquire chained ciphertext data of each data object to be encrypted in the data object set including the data object to be encrypted, and combine the chained ciphertext data of each data object to be encrypted to obtain initial encrypted data;
[0132] The interference ciphertext data is added to the initial encrypted data to obtain encrypted data.
[0133] Optionally, the interference ciphertext data is obtained by encrypting the interference data object. Optionally, the interference ciphertext data has the same data format as the chain ciphertext data.
[0134] Specifically, the chained ciphertext data of each data object to be encrypted in the data object set are combined to obtain initial encrypted data. On this basis, the interference ciphertext data is added to the initial encrypted data to obtain encrypted data. The chained ciphertext data is obfuscated by assisting the transmission of the chained ciphertext data of the data object to be encrypted with the help of the interference data ciphertext data.
[0135] After the encrypted data is obtained, the encrypted data can be stored, and the encrypted data can also be sent to a decryption server to filter out the chain ciphertext data in the encrypted data and decrypt the chain ciphertext data to obtain a data object.
[0136] In addition, step S208 can also be replaced by concatenating the ciphertext subsequence with the first ciphertext sequence based on the positional relationship between the adjacent data object and the data object to be encrypted, to obtain the chained ciphertext data of the data object to be encrypted, and forming a new implementation method together with other processing processes provided in this embodiment.
[0137] In summary, the encryption processing method provided in this embodiment, after obtaining the first ciphertext sequence of the data object to be encrypted and the second ciphertext sequence of the adjacent data object to be encrypted, performs sequence extraction on the second ciphertext sequence according to the sequence extraction length of the second ciphertext sequence, and concatenates the ciphertext subsequence obtained by sequence extraction with the first ciphertext sequence to obtain the chain ciphertext data of the data object to be encrypted, and concatenates the ciphertext subsequence of the adjacent data object with the first ciphertext sequence to obtain the chain ciphertext data of the data object to be encrypted, thereby realizing encryption of multiple dimensions of the data object to be encrypted and improving the effectiveness of the encryption result of the data object to be encrypted.
[0138] Generally speaking, the encryption processing method provided in this embodiment, in the process of encrypting multiple data objects to be encrypted in a data object set including the data objects to be encrypted, after obtaining the multiple data objects to be encrypted in the data object set, first encrypts the multiple data objects to be encrypted separately to obtain the ciphertext sequence of each data object to be encrypted, and encrypts the object name and object format of each data object to be encrypted. Then, by determining the adjacent data objects of each data object to be encrypted, the ciphertext sequence of each data object to be encrypted is updated with the help of the ciphertext sequence and sequence extraction length of the adjacent data objects, and the chain ciphertext data of each data object to be encrypted is obtained, so as to encrypt the relationship between the data size and the multiple data objects to be encrypted. In this way, all information of the multiple data objects to be encrypted is uniformly processed and encrypted, without the need to use other methods to record data, which improves both the convenience of encryption and the encryption effect.
[0139] The following is a detailed description of the decryption process of the decryption server after receiving the encrypted data. The decryption server implements the decryption process in the following manner:
[0140] Determining a data extraction length of the ciphertext data according to a data length of the ciphertext data in the encrypted data and a data extraction parameter of the ciphertext data;
[0141] Extracting the ciphertext data according to the data extraction length to obtain ciphertext sub-data;
[0142] Determining chained ciphertext data in the encrypted data that matches the ciphertext sub-data;
[0143] The chain ciphertext data is decrypted to obtain a data object.
[0144] Optionally, the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of a second ciphertext sequence of the adjacent data object.
[0145] The following is a detailed description of the operations in the decryption process.
[0146] (1) Determine the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data.
[0147] After the encryption server generates encrypted data including multiple ciphertext data in the above manner, it sends the encrypted data to the decryption server. The decryption server obtains the encrypted data. Optionally, the encrypted data includes multiple ciphertext data.
[0148] Since the encrypted data includes interference ciphertext data and chain ciphertext data, the interference ciphertext data confuses the chain ciphertext data and has no use meaning. Therefore, in the decryption process, the chain ciphertext data is screened out from the multiple ciphertext data in the encrypted data. Because the chain ciphertext data contains a chain identifier, and the chain identifier is determined based on the sequence extraction length of each data object to be encrypted, therefore, in this embodiment, to screen out the chain ciphertext data in the ciphertext data, first calculate the data extraction length of each ciphertext data.
[0149] Since the formula for calculating the sequence extraction length is sequence extraction length = sequence length × random (5, 20) ÷ 100, in order to ensure that the ciphertext sub-data determined according to the data extraction length is within the link identifier, in an optional implementation provided by this embodiment, the following method is used to implement the process of determining the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data:
[0150] Reading a starting point value of a numerical interval, and taking a ratio of the starting point value to a preset threshold as the data extraction parameter;
[0151] The data extraction length of the ciphertext data is determined according to the data length and the data extraction parameter.
[0152] Specifically, let random(5, 20) = 5, and use the formula:
[0153] Data extraction length = data length of ciphertext data × 5 ÷ 100 Calculate the data extraction length of the ciphertext data.
[0154] Ignoring the above-mentioned data object 1 to be encrypted and data object 2 to be encrypted, taking data object 3 to be encrypted and data object 4 to be encrypted as examples, the reason for calculating the data extraction length using the starting point value of the numerical interval is specifically described. Figure 5 As shown, the sequence length of the ciphertext sequence of the data object 3 to be encrypted is 1000, and the sequence length of the ciphertext sequence of the data object 4 to be encrypted is 100. Taking random(5,20)=10 as an example, the sequence extraction length of the data object 3 to be encrypted is calculated to be 100, and the sequence extraction length of the data object 4 to be encrypted is 10. Then the data length of the chained ciphertext data of the data object 3 to be encrypted is 900+100+10; the data length of the chained ciphertext data of the data object 4 to be encrypted is 100+10+90. In the decryption process, if calculated according to random(5,20)=5, the data extraction length of the chained ciphertext data of the data object 3 to be encrypted is less than the array length of the link identifier of the data object 3 to be encrypted and the data object 4 to be encrypted, which is 100+10=110, then the data object 4 to be encrypted must contain the chained ciphertext data of the data object 3 to be encrypted. The ciphertext sub-data determined by the data extraction length of the chain ciphertext data of the data object 3 to be encrypted can be screened out, and the chain ciphertext data of the data object 3 to be encrypted and the data object 4 to be encrypted can be screened out; if calculated according to random(5,20)=20, the data extraction length of the chain ciphertext data of the data object 3 to be encrypted is greater than the array length of the link identifier of the data object 3 to be encrypted and the data object 4 to be encrypted 100+10=110, therefore, the data object 4 to be encrypted does not contain the ciphertext sub-data determined by the data extraction length of the chain ciphertext data of the data object 3 to be encrypted, and it is impossible to determine that the data object 3 to be encrypted and the data object 4 to be encrypted have chain ciphertext data; based on the above reasons, since the random value is taken between 5 and 20 in the process of calculating the sequence extraction length, the data extraction length is calculated with the minimum value to ensure accurate and effective determination of the chain ciphertext data.
[0155] (2) Extracting the ciphertext data according to the data extraction length to obtain ciphertext sub-data.
[0156] In the above process, the data extraction length of the ciphertext data is calculated. In this operation, data extraction is performed on the ciphertext data based on the data extraction length to obtain ciphertext sub-data of the ciphertext data, so as to detect whether there is chain ciphertext data matching the ciphertext data based on the ciphertext sub-data.
[0157] Optionally, the ciphertext sub-data includes first ciphertext sub-data and second ciphertext sub-data. Ciphertext sub-data are extracted with the ciphertext data as the origin (or base point). The ciphertext sub-data extracted from the starting position of the ciphertext data is the first ciphertext sub-data. The ciphertext sub-data extracted from the ending position of the ciphertext data is the second ciphertext sub-data. Optionally, the starting position of the ciphertext data is the first extraction position of the ciphertext data; the ending position of the ciphertext data is the second extraction position of the ciphertext data.
[0158] In an optional implementation manner provided by this embodiment, in the process of extracting the ciphertext data according to the data extraction length to obtain the ciphertext sub-data, the following operations are performed:
[0159] Extracting data at a first extraction position of the ciphertext data according to the data extraction length to obtain first ciphertext sub-data; and
[0160] Data extraction is performed at a second extraction position of the ciphertext data according to the data extraction length to obtain second ciphertext sub-data.
[0161] Specifically, in the process of extracting ciphertext data based on the data extraction length to obtain ciphertext sub-data, first ciphertext sub-data and second ciphertext sub-data are extracted from the ciphertext data according to the data extraction length.
[0162] (3) Determine the chain ciphertext data in the encrypted data that matches the ciphertext sub-data.
[0163] After obtaining the ciphertext sub-data of the ciphertext data, chained ciphertext data matching the ciphertext sub-data is determined from the multiple ciphertext data of the encrypted data based on the ciphertext sub-data; specifically, the chained ciphertext data matching the ciphertext sub-data is determined through a link identifier. In an optional implementation manner provided by this embodiment, in the process of determining the chained ciphertext data matching the ciphertext sub-data in the encrypted data, the following operations are performed:
[0164] Determining adjacent ciphertext data of the ciphertext data in the encrypted data based on the first ciphertext sub-data and the second ciphertext sub-data;
[0165] If the adjacent ciphertext data is not empty, determining the ciphertext data and the adjacent ciphertext data as the chain ciphertext data;
[0166] If the adjacent ciphertext data is empty, no processing is performed.
[0167] Optionally, the process of determining adjacent ciphertext data of the ciphertext data in the encrypted data based on the first ciphertext sub-data and the second ciphertext sub-data is implemented in the following manner:
[0168] reading first ciphertext data including the first ciphertext sub-data in the encrypted data, and determining the first ciphertext data as first adjacent ciphertext data of the ciphertext data; and,
[0169] Second ciphertext data including the second ciphertext sub-data is read from the encrypted data, and the second ciphertext data is determined as second adjacent ciphertext data of the ciphertext data.
[0170] Specifically, the adjacent ciphertext data of the ciphertext data is determined in the following manner:
[0171] If there is first ciphertext data matching the first ciphertext sub-data in the encrypted data, and / or there is second ciphertext data matching the second ciphertext sub-data in the encrypted data, determining the first ciphertext data and / or the second ciphertext data as adjacent ciphertext data of the ciphertext data;
[0172] If there is no first ciphertext data matching the first ciphertext sub-data in the encrypted data, and there is no second ciphertext data matching the second ciphertext sub-data, it is determined that the adjacent ciphertext data of the ciphertext data is empty and the ciphertext data is not chain ciphertext data.
[0173] Among them, taking the ciphertext data as the origin (or base point), the ciphertext data adjacent to the left (or previous node) of the ciphertext data is determined as the first adjacent ciphertext data, and the ciphertext data adjacent to the right (or next node) of the ciphertext data is determined as the second adjacent ciphertext data.
[0174] It should be noted that the above is to determine the chained ciphertext data by taking one ciphertext data in the encrypted data as an example. The encrypted data contains multiple ciphertext data. For any ciphertext data, the above method can be used to determine the chained ciphertext data. For example, the data extraction length of each ciphertext data in the multiple ciphertext data in the encrypted data is calculated, and data is extracted from each ciphertext data based on the data extraction length to obtain the ciphertext sub-data of each ciphertext data. Based on the ciphertext sub-data of each ciphertext data, the chained ciphertext data is screened out from the multiple ciphertext data.
[0175] Specifically, if there is first ciphertext data matching the first ciphertext sub-data of any ciphertext data among the multiple ciphertext data, and / or there is second ciphertext data matching the second ciphertext sub-data of any ciphertext data among the multiple ciphertext data, then the first ciphertext data and / or the second ciphertext data are determined as adjacent ciphertext data of any ciphertext data;
[0176] If there is no first ciphertext data matching the first ciphertext sub-data of any of the ciphertext data among the multiple ciphertext data, and there is no second ciphertext data matching the second ciphertext sub-data of any of the ciphertext data, then it is determined that the adjacent ciphertext data of any of the ciphertext data is empty, and any of the ciphertext data is determined as interference ciphertext data or is not processed.
[0177] In the specific execution process, the process of screening chain ciphertext data is also the process of determining the chain head, chain body and chain tail. First, a ciphertext data is randomly selected from the ciphertext data, and the first ciphertext sub-data is determined according to the data extraction length of the ciphertext data. If there is a first ciphertext data matching the first ciphertext sub-data in other ciphertext data, the first ciphertext data is determined as the first adjacent ciphertext data of the ciphertext data, and / or, the second ciphertext sub-data is determined according to the data extraction length of the ciphertext data. If there is a second ciphertext data matching the second ciphertext sub-data in other ciphertext data, the second ciphertext data is determined as the second adjacent ciphertext data of the ciphertext data. In this way, the chain head, chain body and chain tail are determined to determine all the chain ciphertext data; wherein, if there is no adjacent ciphertext data matching the first ciphertext sub-data and the second ciphertext sub-data of the selected ciphertext data, the selected ciphertext data is determined to be interference ciphertext data.
[0178] (4) Decrypt the chain ciphertext data to obtain a data object.
[0179] On the basis of the chained ciphertext data obtained above, the chained ciphertext data is decrypted to obtain a data object. In an optional implementation provided by this embodiment, in the process of decrypting the chained ciphertext data to obtain a data object, the following operations are performed:
[0180] Reading encryption parameters from the ciphertext name of the chained ciphertext data according to the encryption configuration length and the preset position;
[0181] The ciphertext name and the chain ciphertext data are decrypted based on the encryption parameters to obtain the data object and the object name of the data object.
[0182] Specifically, the encryption parameters are read from the chain ciphertext data, and then the chain ciphertext data is decrypted according to the encryption parameters to obtain the data object and the object name of the data object, thereby completing the decryption process of the encrypted data.
[0183] The following uses an encryption processing method provided in this embodiment in a data object encryption scenario as an example to further illustrate the encryption processing method provided in this embodiment for use in a data object encryption scenario. Figure 6 , an encryption processing method applied to a data object encryption scenario, specifically includes the following steps.
[0184] Step S602: encrypt the data object to be encrypted to obtain a first ciphertext sequence, and encrypt the adjacent data objects of the data object to be encrypted to obtain a second ciphertext sequence.
[0185] Step S604: Calculate the sequence extraction length of the second ciphertext sequence according to the sequence length of the second ciphertext sequence and the sequence extraction parameter of the second ciphertext sequence.
[0186] Step S606: Determine a sequence extraction position of the second ciphertext sequence according to the position relationship between the adjacent data objects and the data object to be encrypted.
[0187] Optionally, if the adjacent data object is a first adjacent data object of the data object to be encrypted, determining the sequence extraction position of the second ciphertext sequence as the second extraction position;
[0188] If the adjacent data object is the second adjacent data object of the data object to be encrypted, the sequence extraction position of the second ciphertext sequence is determined to be the first extraction position.
[0189] Step S608: performing sequence extraction on the second ciphertext sequence according to the sequence extraction length and sequence extraction position of the second ciphertext sequence to obtain a ciphertext subsequence.
[0190] Step S610: Determine the sequence splicing position of the ciphertext subsequence in the first ciphertext sequence according to the position relationship between the adjacent data objects and the data object to be encrypted.
[0191] Optionally, if the adjacent data object is the first adjacent data object of the data object to be encrypted, the sequence splicing position is determined to be the first position;
[0192] If the adjacent data object is the second adjacent data object of the data object to be encrypted, the sequence splicing position is determined to be the second position.
[0193] Step S612: splice the ciphertext subsequence to the first ciphertext sequence according to the sequence splicing position to obtain the chain ciphertext data of the data object to be encrypted.
[0194] The following takes the application of an encryption processing method provided in this embodiment in a file encryption scenario as an example to further illustrate the encryption processing method provided in this embodiment for use in a file encryption scenario. Figure 7 , an encryption processing method applied to a file encryption scenario, specifically includes the following steps.
[0195] Step S702, obtaining the file to be encrypted.
[0196] Step S704: split the file to be encrypted into sub-files to obtain a plurality of sub-files in a sequential relationship.
[0197] Step S706: randomly generate encryption parameters for each sub-file, and encrypt each sub-file based on the encryption parameters of each sub-file to obtain a ciphertext sequence of each sub-file.
[0198] Step S708: Determine the adjacent sub-files of each sub-file according to the sequence relationship of the multiple sub-files.
[0199] Step S710, calculating the sequence extraction length of the ciphertext sequence of the adjacent subfiles of each subfile according to the sequence length of the ciphertext sequence of the adjacent subfiles and the sequence extraction parameter.
[0200] Step S712: extract the ciphertext sequence of the adjacent sub-files of each sub-file according to the sequence extraction length to obtain the ciphertext sub-sequence of the adjacent sub-files of each sub-file.
[0201] Step S714, concatenating the ciphertext subsequences of the adjacent subfiles of each subfile with the ciphertext sequence of each subfile to obtain chained ciphertext data of each subfile.
[0202] The following takes the application of an encryption processing method provided by this embodiment in a video encryption scenario as an example to further illustrate the encryption processing method provided by this embodiment applied to a video encryption scenario. Figure 8 , an encryption processing method applied to video encryption scenarios, specifically includes the following steps.
[0203] Step S802: Acquire multiple videos to be encrypted in a video set.
[0204] Step S804: randomly generate encryption parameters for each video to be encrypted, and encrypt each video to be encrypted based on the encryption parameters of each video to be encrypted to obtain a ciphertext sequence of each video to be encrypted.
[0205] Step S806: Based on the encryption parameters of each video to be encrypted, encrypt the video name of each video to be encrypted to obtain the ciphertext name of each video to be encrypted.
[0206] Step S808: randomly determine the order relationship of the multiple videos to be encrypted, and obtain adjacent videos of each video to be encrypted.
[0207] Step S810, calculating the sequence extraction length of the ciphertext sequence of the adjacent videos according to the sequence length of the ciphertext sequence of each adjacent video to be encrypted and the sequence extraction parameter.
[0208] Step S812: performing sequence extraction on the ciphertext sequences of the adjacent videos according to the sequence extraction length of the ciphertext sequences of the adjacent videos to obtain ciphertext subsequences.
[0209] Optionally, steps S810 to S812 may also be replaced by extracting a ciphertext subsequence from the ciphertext sequence of adjacent videos of each video to be encrypted, and forming a new implementation method together with other processing steps provided in this embodiment.
[0210] Step S814, concatenating the ciphertext subsequences of the adjacent videos of each to-be-encrypted video to the ciphertext sequence of each to-be-encrypted video to obtain the chained ciphertext data of each to-be-encrypted video.
[0211] Step S816: Send the chain ciphertext data and ciphertext name of each video to be encrypted, as well as the interference ciphertext data, as encrypted data to the decryption server.
[0212] An embodiment of a decryption processing method provided in this specification:
[0213] The decryption processing method provided in this embodiment is applied to a decryption server, and is coordinated with the encryption processing method embodiment provided in the above embodiment that can be applied to an encryption server. That is, it is a process of decrypting the encrypted data encrypted by the encryption processing method provided in the above embodiment. Therefore, when reading this embodiment, reference can be made to the relevant contents of the above embodiment.
[0214] Reference Fig. 9 The decryption processing method provided in this embodiment includes steps S902 to S908.
[0215] Step S902: determining the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data.
[0216] After the encryption server generates encrypted data including multiple ciphertext data in the above manner, it sends the encrypted data to the decryption server. The decryption server obtains the encrypted data. Optionally, the encrypted data includes multiple ciphertext data.
[0217] Since the encrypted data includes interference ciphertext data and chain ciphertext data, the interference ciphertext data confuses the chain ciphertext data and has no use meaning. Therefore, in the decryption process, the chain ciphertext data is screened out from the multiple ciphertext data in the encrypted data. Because the chain ciphertext data contains a chain identifier, and the chain identifier is determined based on the sequence extraction length of each data object to be encrypted, therefore, in this embodiment, to screen out the chain ciphertext data in the ciphertext data, first calculate the data extraction length of each ciphertext data.
[0218] Since the formula for calculating the sequence extraction length is sequence extraction length = sequence length × random (5, 20) ÷ 100, in order to ensure that the ciphertext sub-data determined according to the data extraction length is within the link identifier, in an optional implementation provided by this embodiment, the following method is used to implement the process of determining the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data:
[0219] Reading a starting point value of a numerical interval, and taking a ratio of the starting point value to a preset threshold as the data extraction parameter;
[0220] The data extraction length of the ciphertext data is determined according to the data length and the data extraction parameter.
[0221] Specifically, let random(5, 20) = 5, and use the formula:
[0222] Data extraction length = data length of ciphertext data × 5 ÷ 100 Calculate the data extraction length of the ciphertext data.
[0223] Ignoring the above-mentioned data object 1 to be encrypted and data object 2 to be encrypted, taking data object 3 to be encrypted and data object 4 to be encrypted as examples, the reason for calculating the data extraction length using the starting point value of the numerical interval is specifically described. Figure 5As shown, the sequence length of the ciphertext sequence of the data object 3 to be encrypted is 1000, and the sequence length of the ciphertext sequence of the data object 4 to be encrypted is 100. Taking random(5,20)=10 as an example, the sequence extraction length of the data object 3 to be encrypted is calculated to be 100, and the sequence extraction length of the data object 4 to be encrypted is 10. Then the data length of the chained ciphertext data of the data object 3 to be encrypted is 900+100+10; the data length of the chained ciphertext data of the data object 4 to be encrypted is 100+10+90. In the decryption process, if calculated according to random(5,20)=5, the data extraction length of the chained ciphertext data of the data object 3 to be encrypted is less than the array length of the link identifier of the data object 3 to be encrypted and the data object 4 to be encrypted, which is 100+10=110, then the data object 4 to be encrypted must contain the chained ciphertext data of the data object 3 to be encrypted. The ciphertext sub-data determined by the data extraction length of the chain ciphertext data of the data object 3 to be encrypted can be screened out, and the chain ciphertext data of the data object 3 to be encrypted and the data object 4 to be encrypted can be screened out; if calculated according to random(5,20)=20, the data extraction length of the chain ciphertext data of the data object 3 to be encrypted is greater than the array length of the link identifier of the data object 3 to be encrypted and the data object 4 to be encrypted 100+10=110, therefore, the data object 4 to be encrypted does not contain the ciphertext sub-data determined by the data extraction length of the chain ciphertext data of the data object 3 to be encrypted, and it is impossible to determine that the data object 3 to be encrypted and the data object 4 to be encrypted have chain ciphertext data; based on the above reasons, since the random value is taken between 5 and 20 in the process of calculating the sequence extraction length, the data extraction length is calculated with the minimum value to ensure accurate and effective determination of the chain ciphertext data.
[0224] Step S904: extract the ciphertext data according to the data extraction length to obtain ciphertext sub-data.
[0225] In the above process, the data extraction length of the ciphertext data is calculated. In this operation, data extraction is performed on the ciphertext data based on the data extraction length to obtain ciphertext sub-data of the ciphertext data, so as to detect whether there is chain ciphertext data matching the ciphertext data based on the ciphertext sub-data.
[0226] Optionally, the ciphertext sub-data includes first ciphertext sub-data and second ciphertext sub-data. Ciphertext sub-data are extracted with the ciphertext data as the origin (or base point). The ciphertext sub-data extracted from the starting position of the ciphertext data is the first ciphertext sub-data. The ciphertext sub-data extracted from the ending position of the ciphertext data is the second ciphertext sub-data. Optionally, the starting position of the ciphertext data is the first extraction position of the ciphertext data; the ending position of the ciphertext data is the second extraction position of the ciphertext data.
[0227] In an optional implementation manner provided by this embodiment, in the process of extracting the ciphertext data according to the data extraction length to obtain the ciphertext sub-data, the following operations are performed:
[0228] Extracting data at a first extraction position of the ciphertext data according to the data extraction length to obtain first ciphertext sub-data; and
[0229] Data extraction is performed at a second extraction position of the ciphertext data according to the data extraction length to obtain second ciphertext sub-data.
[0230] Specifically, in the process of extracting ciphertext data based on the data extraction length to obtain ciphertext sub-data, first ciphertext sub-data and second ciphertext sub-data are extracted from the ciphertext data according to the data extraction length.
[0231] Step S906, determining the chained ciphertext data in the encrypted data that matches the ciphertext sub-data.
[0232] After obtaining the ciphertext sub-data of the ciphertext data, chained ciphertext data matching the ciphertext sub-data is determined from the multiple ciphertext data of the encrypted data based on the ciphertext sub-data; specifically, the chained ciphertext data matching the ciphertext sub-data is determined through a link identifier. In an optional implementation manner provided by this embodiment, in the process of determining the chained ciphertext data matching the ciphertext sub-data in the encrypted data, the following operations are performed:
[0233] Determining adjacent ciphertext data of the ciphertext data in the encrypted data based on the first ciphertext sub-data and the second ciphertext sub-data;
[0234] If the adjacent ciphertext data is not empty, determining the ciphertext data and the adjacent ciphertext data as the chain ciphertext data;
[0235] If the adjacent ciphertext data is empty, no processing is performed.
[0236] Optionally, the process of determining adjacent ciphertext data of the ciphertext data in the encrypted data based on the first ciphertext sub-data and the second ciphertext sub-data is implemented in the following manner:
[0237] reading first ciphertext data including the first ciphertext sub-data in the encrypted data, and determining the first ciphertext data as first adjacent ciphertext data of the ciphertext data; and,
[0238] Second ciphertext data including the second ciphertext sub-data is read from the encrypted data, and the second ciphertext data is determined as second adjacent ciphertext data of the ciphertext data.
[0239] Specifically, the adjacent ciphertext data of the ciphertext data is determined in the following manner:
[0240] If there is first ciphertext data matching the first ciphertext sub-data in the encrypted data, and / or there is second ciphertext data matching the second ciphertext sub-data in the encrypted data, determining the first ciphertext data and / or the second ciphertext data as adjacent ciphertext data of the ciphertext data;
[0241] If there is no first ciphertext data matching the first ciphertext sub-data in the encrypted data, and there is no second ciphertext data matching the second ciphertext sub-data, it is determined that the adjacent ciphertext data of the ciphertext data is empty and the ciphertext data is not chain ciphertext data.
[0242] Among them, taking the ciphertext data as the origin (or base point), the ciphertext data adjacent to the left (or previous node) of the ciphertext data is determined as the first adjacent ciphertext data, and the ciphertext data adjacent to the right (or next node) of the ciphertext data is determined as the second adjacent ciphertext data.
[0243] It should be noted that the above is to determine the chained ciphertext data by taking one ciphertext data in the encrypted data as an example. The encrypted data contains multiple ciphertext data. For any ciphertext data, the above method can be used to determine the chained ciphertext data. For example, the data extraction length of each ciphertext data in the multiple ciphertext data in the encrypted data is calculated, and data is extracted from each ciphertext data based on the data extraction length to obtain the ciphertext sub-data of each ciphertext data. Based on the ciphertext sub-data of each ciphertext data, the chained ciphertext data is screened out from the multiple ciphertext data.
[0244] Specifically, if there is first ciphertext data matching the first ciphertext sub-data of any ciphertext data among the multiple ciphertext data, and / or there is second ciphertext data matching the second ciphertext sub-data of any ciphertext data among the multiple ciphertext data, then the first ciphertext data and / or the second ciphertext data are determined as adjacent ciphertext data of any ciphertext data;
[0245] If there is no first ciphertext data matching the first ciphertext sub-data of any of the ciphertext data among the multiple ciphertext data, and there is no second ciphertext data matching the second ciphertext sub-data of any of the ciphertext data, then it is determined that the adjacent ciphertext data of any of the ciphertext data is empty, and any of the ciphertext data is determined as interference ciphertext data or is not processed.
[0246] In the specific execution process, the process of screening chain ciphertext data is also the process of determining the chain head, chain body and chain tail. First, a ciphertext data is randomly selected from the ciphertext data, and the first ciphertext sub-data is determined according to the data extraction length of the ciphertext data. If there is a first ciphertext data matching the first ciphertext sub-data in other ciphertext data, the first ciphertext data is determined as the first adjacent ciphertext data of the ciphertext data, and / or, the second ciphertext sub-data is determined according to the data extraction length of the ciphertext data. If there is a second ciphertext data matching the second ciphertext sub-data in other ciphertext data, the second ciphertext data is determined as the second adjacent ciphertext data of the ciphertext data. In this way, the chain head, chain body and chain tail are determined to determine all the chain ciphertext data; wherein, if there is no adjacent ciphertext data matching the first ciphertext sub-data and the second ciphertext sub-data of the selected ciphertext data, the selected ciphertext data is determined to be interference ciphertext data.
[0247] Step S908, decrypt the chain ciphertext data to obtain a data object.
[0248] On the basis of the chained ciphertext data obtained above, the chained ciphertext data is decrypted to obtain a data object. In an optional implementation provided by this embodiment, in the process of decrypting the chained ciphertext data to obtain a data object, the following operations are performed:
[0249] Reading encryption parameters from the ciphertext name of the chained ciphertext data according to the encryption configuration length and the preset position;
[0250] The ciphertext name and the chain ciphertext data are decrypted based on the encryption parameters to obtain the data object and the object name of the data object.
[0251] Specifically, the encryption parameters are read from the chain ciphertext data, and then the chain ciphertext data is decrypted according to the encryption parameters to obtain the data object and the object name of the data object, thereby completing the decryption process of the encrypted data.
[0252] In summary, the decryption processing method provided in the present embodiment, after obtaining the encrypted data, determines the data extraction length for any ciphertext data in the encrypted data according to the data length of the ciphertext data and the data extraction parameters, and extracts the ciphertext data according to the data extraction length to obtain the ciphertext sub-data. If there is target ciphertext data matching the ciphertext sub-data in the encrypted data, both the ciphertext data and the target ciphertext data are determined as chained ciphertext data, and the chained ciphertext data is decrypted to obtain the data object. If there is no target ciphertext data matching the ciphertext sub-data in the encrypted data, no processing is performed. In this way, the chained ciphertext data in the encrypted data containing chained ciphertext data and interference ciphertext data is determined and decrypted in the above manner to obtain an accurate and valid data object.
[0253] Generally speaking, the decryption processing method provided in this embodiment, after obtaining encrypted data containing multiple ciphertext data, calculates the data extraction length of each ciphertext data, extracts data from each ciphertext data based on the data extraction length to obtain the ciphertext sub-data of each ciphertext data, and based on the ciphertext sub-data of each ciphertext data, screens out chained ciphertext data from multiple ciphertext data, decrypts the chained ciphertext data, and obtains a data object.
[0254] The following takes the application of a decryption processing method provided by this embodiment in a data object decryption scenario as an example to further illustrate the decryption processing method provided by this embodiment applied to the data object decryption scenario. Fig.10 , a decryption processing method applied to a data object decryption scenario specifically includes the following steps.
[0255] Step S1002, obtaining encrypted data.
[0256] Step S1004, calculating the data extraction length of the ciphertext data according to the starting point value of the preset value interval and the data length of the ciphertext data in the encrypted data.
[0257] Optionally, the preset numerical interval is a preset numerical interval in a process of calculating the sequence extraction length of the data object.
[0258] Step S1006: extracting the first ciphertext sub-data and the second ciphertext sub-data from the ciphertext data according to the data extraction length of the ciphertext data.
[0259] Step S1008: Match adjacent ciphertext data of the ciphertext data in the encrypted data according to the first ciphertext sub-data and the second ciphertext sub-data of the ciphertext data.
[0260] Step S1010: When the adjacent ciphertext data is not empty, the adjacent ciphertext data and the ciphertext data are determined as chain ciphertext data.
[0261] Step S1012, reading the encryption parameters in the ciphertext name corresponding to the chain ciphertext data, decrypting the chain ciphertext data and the ciphertext name based on the encryption parameters to obtain the data object and the object name.
[0262] An embodiment of an encryption processing device provided in this specification is as follows:
[0263] In the above-mentioned embodiment, an encryption processing method is provided, and correspondingly, an encryption processing device is also provided, which is described below with reference to the accompanying drawings.
[0264] Reference Fig.11 , which shows a schematic diagram of an encryption processing device provided by this embodiment.
[0265] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.
[0266] This embodiment provides an encryption processing device, including:
[0267] An acquisition module 1102 is used to acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted;
[0268] A determination module 1104, configured to determine a sequence extraction length according to a sequence length of the second ciphertext sequence and a sequence extraction parameter corresponding to the second ciphertext sequence;
[0269] An extraction module 1106, configured to perform sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence;
[0270] The concatenation module 1108 is configured to concatenate the ciphertext subsequence with the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted.
[0271] Each module in the above encryption processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0272] An embodiment of a decryption processing device provided in this specification is as follows:
[0273] In the above-mentioned embodiment, a decryption processing method is provided, and correspondingly, a decryption processing device is also provided, which is described below with reference to the accompanying drawings.
[0274] Reference Fig.12 , which shows a schematic diagram of a decryption processing device provided by this embodiment.
[0275] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.
[0276] This embodiment provides a decryption processing device, including:
[0277] A length determination module 1202, configured to determine a data extraction length of the ciphertext data according to a data length of the ciphertext data in the encrypted data and a data extraction parameter of the ciphertext data;
[0278] A data extraction module 1204 is used to extract the ciphertext data according to the data extraction length to obtain ciphertext sub-data;
[0279] A data determination module 1206, configured to determine chained ciphertext data in the encrypted data that matches the ciphertext sub-data;
[0280] The decryption module 1208 is used to decrypt the chained ciphertext data to obtain a data object; the chained ciphertext data is obtained by concatenating the first ciphertext sequence of the data object and the ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to the sequence extraction length of the second ciphertext sequence of the adjacent data object.
[0281] Each module in the above decryption processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0282] An embodiment of an encryption processing device provided in this specification is as follows:
[0283] Corresponding to the encryption processing method described above, based on the same technical concept, an embodiment of the present application also provides an encryption processing device, which is used to execute the encryption processing method provided above. Fig.13 A schematic diagram of the structure of an encryption processing device provided in an embodiment of the present application.
[0284] This embodiment provides an encryption processing device, including:
[0285] like Fig.13As shown, the encryption processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 1301 and memory 1302, and the memory 1302 may store one or more storage applications or data. Among them, the memory 1302 may be a short-term storage or a permanent storage. The application stored in the memory 1302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the encryption processing device. Furthermore, the processor 1301 may be configured to communicate with the memory 1302, and execute a series of computer executable instructions in the memory 1302 on the encryption processing device. The encryption processing device may also include one or more power supplies 1303, one or more wired or wireless network interfaces 1304, one or more input / output interfaces 1305, one or more keyboards 1306, etc.
[0286] In a specific embodiment, the encryption processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the encryption processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0287] Acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted;
[0288] determining a sequence extraction length of the second ciphertext sequence according to a sequence length of the second ciphertext sequence and a sequence extraction parameter of the second ciphertext sequence;
[0289] Performing sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence;
[0290] The ciphertext subsequence is concatenated with the first ciphertext sequence to obtain chained ciphertext data of the data object to be encrypted.
[0291] An embodiment of a decryption processing device provided in this specification is as follows:
[0292] Corresponding to the above-described decryption processing method, based on the same technical concept, the embodiment of the present application also provides a decryption processing device, which is used to execute the above-provided decryption processing method. Fig.14 A schematic diagram of the structure of a decryption processing device provided in an embodiment of the present application.
[0293] This embodiment provides a decryption processing device, including:
[0294] like Fig.14 As shown, the decryption processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 1401 and memory 1402, and the memory 1402 may store one or more storage applications or data. Among them, the memory 1402 may be a short-term storage or a persistent storage. The application stored in the memory 1402 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the decryption processing device. Furthermore, the processor 1401 may be configured to communicate with the memory 1402, and execute a series of computer executable instructions in the memory 1402 on the decryption processing device. The decryption processing device may also include one or more power supplies 1403, one or more wired or wireless network interfaces 1404, one or more input / output interfaces 1405, one or more keyboards 1406, etc.
[0295] In a specific embodiment, the decryption processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the decryption processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0296] Determining a data extraction length of the ciphertext data according to a data length of the ciphertext data in the encrypted data and a data extraction parameter of the ciphertext data;
[0297] Extracting the ciphertext data according to the data extraction length to obtain ciphertext sub-data;
[0298] Determining chained ciphertext data in the encrypted data that matches the ciphertext sub-data;
[0299] The chained ciphertext data is decrypted to obtain a data object; the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of the second ciphertext sequence of the adjacent data object.
[0300] An embodiment of a computer-readable storage medium provided in this specification is as follows:
[0301] Corresponding to the encryption processing method described above, based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium.
[0302] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions, and the computer-executable instructions implement the following process when executed by a processor:
[0303] Acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted;
[0304] determining a sequence extraction length of the second ciphertext sequence according to a sequence length of the second ciphertext sequence and a sequence extraction parameter of the second ciphertext sequence;
[0305] Performing sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence;
[0306] The ciphertext subsequence is concatenated with the first ciphertext sequence to obtain chained ciphertext data of the data object to be encrypted.
[0307] It should be noted that the embodiment of a computer-readable storage medium in this specification and the embodiment of an encryption processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0308] Another computer-readable storage medium embodiment provided in this specification is as follows:
[0309] Corresponding to the decryption processing method described above, based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium.
[0310] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions, and the computer-executable instructions implement the following process when executed by a processor:
[0311] Determining a data extraction length of the ciphertext data according to a data length of the ciphertext data in the encrypted data and a data extraction parameter of the ciphertext data;
[0312] Extracting the ciphertext data according to the data extraction length to obtain ciphertext sub-data;
[0313] Determining chained ciphertext data in the encrypted data that matches the ciphertext sub-data;
[0314] The chained ciphertext data is decrypted to obtain a data object; the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of the second ciphertext sequence of the adjacent data object.
[0315] It should be noted that the embodiment of another computer-readable storage medium in this specification and the embodiment of a decryption processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0316] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0317] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0318] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable test equipment to produce a machine, so that the instructions executed by the processor of the computer or other programmable test equipment generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0319] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable test equipment to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instruction device being implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0320] These computer program instructions may also be loaded onto a computer or other programmable test device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0321] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0322] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0323] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0324] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0325] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0326] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0327] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. An encryption processing method, characterized in that: The method comprises: Acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted; determining a sequence extraction length of the second ciphertext sequence according to a sequence length of the second ciphertext sequence and a sequence extraction parameter of the second ciphertext sequence; Performing sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence; The ciphertext subsequence is concatenated with the first ciphertext sequence to obtain chained ciphertext data of the data object to be encrypted.
2. The method according to claim 1, characterized in that The first ciphertext sequence is determined in the following manner: Generate encryption parameters for the data object to be encrypted according to the encryption configuration length of the data object to be encrypted; Based on the encryption parameters, the data object to be encrypted is encrypted to obtain the first ciphertext sequence.
3. The method according to claim 1, characterized in that The determining, according to the sequence length of the second ciphertext sequence and the sequence extraction parameter of the second ciphertext sequence, the sequence extraction length of the second ciphertext sequence includes: Selecting a random value in a preset value interval by a random algorithm, and taking the ratio of the random value to a preset threshold as the sequence extraction parameter; A sequence extraction length of the second ciphertext sequence is determined according to the sequence length and the sequence extraction parameter.
4. The method according to claim 1, characterized in that: The step of performing sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence includes: Determining a sequence extraction position of the second ciphertext sequence according to a positional relationship between the adjacent data object and the data object to be encrypted; According to the sequence extraction length and the sequence extraction position, sequence extraction is performed on the second ciphertext sequence to obtain a ciphertext subsequence.
5. The method according to claim 4, characterized in that The step of concatenating the ciphertext subsequence with the first ciphertext sequence to obtain the chained ciphertext data of the data object to be encrypted includes: Determining, according to the positional relationship, a sequence splicing position of the ciphertext subsequence in the first ciphertext sequence; Based on the sequence splicing position, the ciphertext subsequence is spliced to the first ciphertext sequence to obtain the chain ciphertext data.
6. The method according to claim 1, characterized in that The method further comprises: Acquire chained ciphertext data of each data object to be encrypted in the data object set including the data object to be encrypted, and combine the chained ciphertext data of each data object to be encrypted to obtain initial encrypted data; The interference ciphertext data is added to the initial encrypted data to obtain encrypted data.
7. A decryption processing method, characterized in that: The method comprises: Determining a data extraction length of the ciphertext data according to a data length of the ciphertext data in the encrypted data and a data extraction parameter of the ciphertext data; Extracting the ciphertext data according to the data extraction length to obtain ciphertext sub-data; Determining chained ciphertext data in the encrypted data that matches the ciphertext sub-data; The chained ciphertext data is decrypted to obtain a data object; the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of the second ciphertext sequence of the adjacent data object.
8. The method according to claim 7, characterized in that The step of determining the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data comprises: Reading a starting point value of a numerical interval, and taking a ratio of the starting point value to a preset threshold as the data extraction parameter; The data extraction length of the ciphertext data is determined according to the data length and the data extraction parameter.
9. The method according to claim 7, characterized in that: The step of extracting data from the ciphertext data according to the data extraction length to obtain ciphertext sub-data includes: Extracting data at a first extraction position of the ciphertext data according to the data extraction length to obtain first ciphertext sub-data; and Data extraction is performed at a second extraction position of the ciphertext data according to the data extraction length to obtain second ciphertext sub-data.
10. The method according to claim 9, characterized in that The determining the chained ciphertext data in the encrypted data that matches the ciphertext sub-data includes: Determining adjacent ciphertext data of the ciphertext data in the encrypted data based on the first ciphertext sub-data and the second ciphertext sub-data; If the adjacent ciphertext data is not empty, the ciphertext data and the adjacent ciphertext data are determined as the chain ciphertext data.
11. The method according to claim 10, characterized in that The determining, in the encrypted data, adjacent ciphertext data of the ciphertext data based on the first ciphertext sub-data and the second ciphertext sub-data comprises: reading first ciphertext data including the first ciphertext sub-data in the encrypted data, and determining the first ciphertext data as first adjacent ciphertext data of the ciphertext data; and, Second ciphertext data including the second ciphertext sub-data is read from the encrypted data, and the second ciphertext data is determined as second adjacent ciphertext data of the ciphertext data.
12. The method according to claim 7, characterized in that The decrypting the chain ciphertext data to obtain a data object includes: Reading encryption parameters from the ciphertext name of the chained ciphertext data according to the encryption configuration length and the preset position; The ciphertext name and the chain ciphertext data are decrypted based on the encryption parameters to obtain the data object and the object name of the data object.
13. An encryption processing device, characterized in that: The device comprises: An acquisition module, used to acquire a first ciphertext sequence of a data object to be encrypted and a second ciphertext sequence of a data object adjacent to the data object to be encrypted; A determination module, configured to determine a sequence extraction length according to a sequence length of the second ciphertext sequence and a sequence extraction parameter corresponding to the second ciphertext sequence; An extraction module, configured to perform sequence extraction on the second ciphertext sequence according to the sequence extraction length to obtain a ciphertext subsequence; The concatenation module is used to concatenate the ciphertext subsequence with the first ciphertext sequence to obtain the chain ciphertext data of the data object to be encrypted.
14. A decryption processing device, characterized in that: The device comprises: A length determination module, used to determine the data extraction length of the ciphertext data according to the data length of the ciphertext data in the encrypted data and the data extraction parameter of the ciphertext data; A data extraction module, used to extract the ciphertext data according to the data extraction length to obtain ciphertext sub-data; A data determination module, used to determine the chained ciphertext data matching the ciphertext sub-data in the encrypted data; A decryption module is used to decrypt the chained ciphertext data to obtain a data object; the chained ciphertext data is obtained by concatenating a first ciphertext sequence of the data object and a ciphertext subsequence of an adjacent data object of the data object; the ciphertext subsequence is obtained by sequence extraction of the second ciphertext sequence of the adjacent data object according to a sequence extraction length of the second ciphertext sequence of the adjacent data object.
15. A computer device, characterized in that: The device comprises: A processor; and a memory configured to store computer executable instructions, which, when executed, cause the processor to perform the encryption processing method as described in any one of claims 1 to 6; or to perform the decryption processing method as described in any one of claims 7 to 12.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the encryption processing method according to any one of claims 1 to 6 is implemented; or the decryption processing method according to any one of claims 7 to 12 is executed.