Data decryption method and device based on sp network structure, equipment and medium

By using a Vandermonde-like fusion matrix instead of the traditional Vandermonde matrix in the SP network structure, the problem of high complexity in inverting the diffusion layer matrix in block ciphers is solved, achieving more efficient decryption calculation.

CN119561675BActive Publication Date: 2025-11-11SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411345326.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-11-11
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

In existing technologies, the computational complexity of inverting the diffusion layer matrix in block ciphers is high, resulting in high decryption time costs and making it difficult to improve computational efficiency.

Method used

A data decryption method based on SP network structure is adopted. By constructing a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix, the Vandermonde-like matrix is ​​used to perform inversion operation to obtain the target inverse matrix to decrypt plaintext data.

Benefits of technology

It reduces the computational complexity of the diffusion layer matrix, improves the efficiency of decryption calculation, simplifies the matrix inversion process, and enhances computational performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561675B_ABST
    Figure CN119561675B_ABST
Patent Text Reader

Abstract

This application discloses a data decryption method, apparatus, device, and medium based on an SP network structure, relating to the field of information security technology. The method includes: acquiring ciphertext data sent by a user terminal; the ciphertext data is data obtained by encrypting plaintext data by the user terminal based on the SP network structure, wherein the P-box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, and the Vandermonde fusion matrix is ​​constructed based on the original Vandermonde matrix and a Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix; acquiring encryption parameters corresponding to the S-box and P-box in the SP network structure; the encryption parameters include the Vandermonde fusion matrix; performing an inversion operation on the Vandermonde fusion matrix to obtain a target inverse matrix; determining a first decryption parameter corresponding to the P-box based on the target inverse matrix; and using the first decryption parameter and a second decryption parameter corresponding to the S-box to decrypt the ciphertext data to obtain the plaintext data. This application can improve the inversion efficiency during decryption calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and in particular to a data decryption method, apparatus, device, and medium based on SP network structure. Background Technology

[0002] Modern cryptography, as a core and key technology of information security, plays a vital role in protecting data security and user privacy. Block ciphers, due to their fast encryption and decryption speeds, ease of implementation in software and hardware, and ease of standardization, have attracted widespread attention and become a hot topic in cryptographic research.

[0003] The SP (S for Substitution; P for Permutation) network structure is a widely used overall structure in block ciphers. In each round of this cipher, the input is first subjected to an invertible function S controlled by a subkey, and then to a permutation P. The SP network structure is very clear: S is generally called the confusion layer, which mainly serves to confuse the input, and P is generally called the diffusion layer, which mainly serves to diffuse the input. Intuitively, passing through the confusion layer first and then the diffusion layer closely approximates the confusion and diffusion principles proposed by Shannon. Moreover, modern block ciphers iterate the confusion and diffusion layers multiple times through the overall structure, which enhances the confusion and diffusion properties of the cipher, making the dependency between the input and output more complex. The S-box represents nonlinear transformations. The P-box represents linear transformations, and each linear transformation corresponds to a matrix.

[0004] MDS (Maximum Distance Separable) matrices are widely used in the diffusion layers of block ciphers. Therefore, constructing MDS matrices with good properties has become a research goal. The Vandermonde matrix method is a commonly used method for constructing MDS matrices. However, as the matrix order increases, the element values ​​in the matrix increase exponentially, resulting in extremely high costs for constructing and storing MDS matrices. Furthermore, the computational complexity and logical complexity of inverting existing Vandermonde matrices lead to very high time costs for decrypting diffusion matrices.

[0005] In summary, improving the efficiency of inverting the diffusion layer matrix, reducing computational complexity, and increasing operational efficiency during decryption calculations are problems that need to be solved. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide a data decryption method, apparatus, device, and medium based on an SP network structure, which can improve the efficiency of inverting the diffusion layer matrix, reduce computational complexity, and improve operational efficiency during decryption calculations. The specific solution is as follows:

[0007] Firstly, this application discloses a data decryption method based on an SP network structure, including:

[0008] Acquire encrypted data sent by the user terminal; wherein, the encrypted data is the data obtained by the user terminal after encrypting plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, and the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde fusion matrix obtained after transforming the original Vandermonde matrix.

[0009] Obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure; the encryption parameters include the Vandermonde-like fusion matrix.

[0010] The target inverse matrix is ​​obtained by inverting the Vandermonde-like fusion matrix, and a first decryption parameter corresponding to the P box is determined based on the target inverse matrix. The ciphertext data is then decrypted using the first decryption parameter and a second decryption parameter corresponding to the S box to obtain the plaintext data.

[0011] Optionally, the process of transforming the original Vandermonde matrix to obtain a Vandermonde-like matrix includes:

[0012] The original Vandermonde matrix is ​​transposed to obtain the corresponding transpose matrix;

[0013] The transpose matrix is ​​subjected to elementary row operations using a preset parameter matrix to obtain a Vandermonde-like matrix.

[0014] Optionally, the process of constructing a Vandermonde-like fusion matrix based on the original Vandermonde matrix and the Vandermonde-like matrix includes:

[0015] The original Vandermonde matrix and the Vandermonde-like matrix are multiplied to obtain the Vandermonde-like fusion matrix; wherein the Vandermonde-like fusion matrix is ​​a matrix with symmetry and positive definiteness.

[0016] Optionally, obtaining the encryption parameters corresponding to the S-box and P-box in the SP network structure includes:

[0017] Obtain the first encryption parameter corresponding to the S box in the SP network structure and the second encryption parameter corresponding to the P box sent by the user terminal; the second encryption parameter includes the Vandermonde-like fusion matrix.

[0018] Alternatively, obtain from a preset shared storage location the first encryption parameter corresponding to the S box in the SP network structure and the second encryption parameter corresponding to the P box; the second encryption parameter includes the Vandermonde-like fusion matrix.

[0019] Optionally, the step of inverting the Vandermonde-like fusion matrix to obtain the target inverse matrix includes:

[0020] The target inverse matrix is ​​obtained by inverting the Vandermonde-like fusion matrix based on the square root algorithm.

[0021] The process of inverting the Vandermonde-like fusion matrix based on the square root algorithm includes:

[0022] The Vandermonde-like fusion matrix is ​​decomposed into the product of an upper triangular matrix and a lower triangular matrix; wherein the upper triangular matrix and the lower triangular matrix are transposes of each other.

[0023] A method for determining the inversion expression for inverting a triangular matrix is ​​defined. In this expression, if the row and column numbers of any matrix element at the target position are the same, then the matrix element at the target position in the corresponding inverse matrix is ​​the reciprocal of that matrix element. If the column number of any matrix element at the target position is greater than the row number, then the value of the matrix element at the target position in the corresponding inverse matrix is ​​calculated based on the target relation. If the column number of any matrix element at the target position is less than the row number, then the matrix element at the target position in the corresponding inverse matrix has a zero value.

[0024] The upper triangular matrix is ​​inverted based on the inverse expression to obtain the first inverse matrix, and the second inverse matrix corresponding to the lower triangular matrix is ​​determined based on the first inverse matrix.

[0025] The target inverse matrix is ​​determined based on the first inverse matrix and the second inverse matrix, and the target inverse matrix is ​​used as the inverse result obtained after performing an inverse operation on the Vandermonde fusion matrix.

[0026] Optionally, the process of the user terminal sending encrypted data includes:

[0027] The user terminal divides the plaintext data into plaintext packets of corresponding lengths based on a preset packet length, and uses the S-box in the SP network structure to perform a replacement operation on the plaintext packets to obtain a first replacement packet. Then, it uses the P-box constructed based on a preset Vandermonde fusion matrix to perform a permutation operation on the first replacement packet to obtain a first permutation packet. Then, it repeats the replacement operation of the S-box and the permutation operation of the P-box based on a preset number of iterations to obtain the ciphertext data.

[0028] Optionally, the encryption parameters may also include the preset block length;

[0029] Accordingly, the step of decrypting the ciphertext data using the first decryption parameter and the second decryption parameter corresponding to the S-box to obtain the plaintext data includes:

[0030] The ciphertext data is divided into ciphertext groups of corresponding lengths based on the preset group length;

[0031] The ciphertext group is permuted using the first decryption parameter corresponding to the P box to obtain a second permuted group. Then, the second permuted group is replaced using the second decryption parameter corresponding to the S box to obtain a second replaced group. Then, the replacement operation performed by the P box based on the first decryption parameter and the permutation operation performed by the S box based on the second decryption parameter are repeated based on the preset number of iterations to obtain the plaintext data.

[0032] Secondly, this application discloses a data decryption device based on an SP network structure, comprising:

[0033] The ciphertext acquisition module is used to acquire ciphertext data sent by the user terminal; wherein, the ciphertext data is the data obtained by the user terminal after encrypting plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, which is a matrix constructed based on the original Vandermonde matrix and a Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix.

[0034] The parameter acquisition module is used to acquire the encryption parameters corresponding to the S-box and P-box in the SP network structure, respectively; the encryption parameters include the Vandermonde-like fusion matrix.

[0035] The decryption module is used to perform an inversion operation on the Vandermonde-like fusion matrix to obtain a target inverse matrix, and determine a first decryption parameter corresponding to the P box based on the target inverse matrix, so as to use the first decryption parameter and a second decryption parameter corresponding to the S box to decrypt the ciphertext data to obtain the plaintext data.

[0036] Thirdly, this application discloses an electronic device, including:

[0037] Memory, used to store computer programs;

[0038] A processor is configured to execute the computer program to implement the steps of the aforementioned disclosed data decryption method based on the SP network structure.

[0039] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed data decryption method based on the SP network structure.

[0040] As can be seen, this application obtains ciphertext data sent by a user terminal; wherein the ciphertext data is data obtained by the user terminal encrypting plaintext data based on an SP network structure, the P-box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and a Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix; it obtains encryption parameters corresponding to the S-box and P-box in the SP network structure respectively; the encryption parameters include the Vandermonde fusion matrix; it performs an inversion operation on the Vandermonde fusion matrix to obtain a target inverse matrix, and determines a first decryption parameter corresponding to the P-box based on the target inverse matrix, so as to decrypt the ciphertext data to obtain the plaintext data using the first decryption parameter and the second decryption parameter corresponding to the S-box.

[0041] Beneficial Effects: The ciphertext data obtained in this application is data obtained by encrypting plaintext data using the SP network structure on the user end. Furthermore, this application improves the P-box in the SP network structure; the P-box is no longer constructed using the original Vandermonde matrix, but rather based on a preset Vandermonde-like fusion matrix. Specifically, the matrix Vandermonde-like fusion matrix is ​​constructed by transforming the original Vandermonde matrix and the resulting Vandermonde-like matrix. During decryption, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure, including the Vandermonde-like fusion matrix. Finally, this application obtains the target inverse matrix by inverting the Vandermonde-like fusion matrix and determines the first decryption parameter corresponding to the P-box based on the target inverse matrix. The first decryption parameter and the second decryption parameter corresponding to the S-box are then used to decrypt the ciphertext data to obtain the plaintext data. In other words, this scheme uses a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix to construct the P-box, which completes the function of the diffusion layer in the SP network. This improves the efficiency of inverting the diffusion layer matrix during decryption calculation, reduces computational complexity, and increases operational efficiency. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0043] Figure 1 This is a flowchart of a data decryption method based on an SP network structure disclosed in this application;

[0044] Figure 2This application discloses a specific data decryption method based on an SP network structure.

[0045] Figure 3 This is a schematic diagram illustrating how plaintext blocks are encrypted to obtain ciphertext blocks, as disclosed in this application.

[0046] Figure 4 This is a flowchart of the decryption and inversion of an MDS matrix constructed using a Vandermonde-like fusion matrix, as disclosed in this application.

[0047] Figure 5 This is a schematic diagram of a data decryption device based on an SP network structure disclosed in this application;

[0048] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0050] MDS (Multi-Diffusion Sequence) is widely used in the diffusion layer of block ciphers. Therefore, constructing a well-structured MDS matrix has become a research goal. The Vandermonde matrix method is a commonly used method for constructing MDS matrices, and its application in the diffusion layer is as follows:

[0051] Vandermonde matrix for:

[0052] ;

[0053] Then the determinant The value is:

[0054] ;

[0055] because They are not equal and are not zero, therefore It is known that an n-order matrix is ​​an MDS matrix if and only if all its order minors are non-zero, i.e., it is a non-singular matrix. Therefore, the Vandermonde matrix satisfies the MDS matrix condition.

[0056] Information matrix D, encoding matrix Y:

[0057] ;

[0058] Matrix form:

[0059] ;

[0060] decoding:

[0061] ;

[0062] The decoding idea is relatively simple; the core is to solve for the inverse of the Vandermonde matrix. :

[0063] ;

[0064] in for The adjoint matrix. For simplicity, the following notation is defined. For example, k does not appear. It can be represented as and will arrive The product is denoted as .

[0065] make , but:

[0066] ;

[0067] make ,but:

[0068] ;

[0069] Therefore, we can conclude that:

[0070] ;

[0071] achievable The first element in the first row and first column:

[0072] ;

[0073] By extension, we can eventually derive the inverse matrix of the Vandermonde matrix. :

[0074] ;

[0075] In summary, it can be observed that while the idea of ​​using the Vandermonde matrix (MDS) is simple, the element values ​​increase exponentially with the matrix order, leading to extremely high costs in constructing and storing the MDS matrix. Furthermore, the existing Vandermonde matrix inversion calculation is computationally intensive and logically complex, resulting in very high decryption time costs. Therefore, this application discloses a data decryption method, apparatus, device, and medium based on an SP network structure, which can improve the inversion efficiency of the diffusion layer matrix, reduce computational complexity, and increase operational efficiency during decryption calculations.

[0076] See Figure 1 As shown in the figure, this application discloses a data decryption method based on an SP network structure, the method comprising:

[0077] Step S11: Obtain the ciphertext data sent by the user terminal; wherein, the ciphertext data is the data obtained by the user terminal after encrypting the plaintext data based on the SP network structure, the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde fusion matrix obtained after transforming the original Vandermonde matrix.

[0078] In this embodiment, the encrypted data obtained by the server is the data obtained by the user end after encrypting the plaintext data using the SP network structure. Furthermore, this application improves the P-box in the SP network structure; the P-box is no longer constructed using the original Vandermonde matrix, but rather based on a preset Vandermonde-like fusion matrix. Specifically, the Vandermonde-like fusion matrix is ​​constructed by using the original Vandermonde matrix and a Vandermonde-like matrix obtained by transforming the original Vandermonde matrix.

[0079] The process of transforming the original Vandermonde matrix to obtain a Vandermonde-like matrix includes: transposing the original Vandermonde matrix to obtain the corresponding transpose matrix; and performing elementary row operations on the transpose matrix using a preset parameter matrix to obtain the Vandermonde-like matrix. That is, in this embodiment, the Vandermonde matrix is ​​first... First, transpose the matrix, then use the preset parameter matrix. By performing elementary row operations, we can obtain a Vandermonde-like matrix. :

[0080] ;

[0081] in, , .

[0082] Furthermore, the process of constructing a Vandermonde-like fusion matrix based on the original Vandermonde matrix and the Vandermonde-like matrix includes: performing a product operation on the original Vandermonde matrix and the Vandermonde-like matrix to obtain the Vandermonde-like fusion matrix; wherein, the Vandermonde-like fusion matrix is ​​a matrix possessing symmetry and positive definiteness. That is, in this embodiment, the Vandermonde matrix... and Vandermonde matrix Multiplication yields a Vandermonde-like fusion matrix. :

[0083] ;

[0084] ;

[0085] For matrix It satisfies the following conditions:

[0086] 1. Symmetry: Matrix It is symmetrical, that is ;

[0087] 2. Positive definiteness: For any non-zero vector x, we have .

[0088] Step S12: Obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure respectively; the encryption parameters include the Vandermonde-like fusion matrix.

[0089] In this embodiment, during decryption, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure, respectively. Based on the encryption parameters, the corresponding decryption parameters are determined to complete the decryption of the ciphertext data. The encryption parameters include a Vandermonde-like fusion matrix. .

[0090] In a specific implementation, obtaining the encryption parameters corresponding to the S-box and P-box in the SP network structure includes: obtaining a first encryption parameter corresponding to the S-box and a second encryption parameter corresponding to the P-box sent by the user terminal; the second encryption parameter includes the Vandermonde-like fusion matrix; or, obtaining the first encryption parameter corresponding to the S-box and the second encryption parameter corresponding to the P-box in the SP network structure from a preset shared storage location; the second encryption parameter includes the Vandermonde-like fusion matrix.

[0091] That is, in one specific embodiment, the data can be sent by the user client. The user client can send the encrypted data and encryption parameters together to the server, or the two types of data can be sent to the server separately. This application does not limit this. The encryption parameters specifically include a first encryption parameter corresponding to the S box in the SP network structure and a second encryption parameter corresponding to the P box. The second encryption parameter specifically includes a Vandermonde-like fusion matrix.

[0092] In another specific embodiment, the encryption parameters can be shared. The server can obtain the first encryption parameter corresponding to the S box in the SP network structure and the second encryption parameter corresponding to the P box from a preset shared storage location. The second encryption parameter specifically includes a Vandermonde-like fusion matrix. For example, the user and server can securely share a key before encryption. When the server needs to decrypt, it directly uses the pre-shared key. This method is suitable for scenarios where both parties have a pre-established trust relationship, but it is necessary to ensure the secure storage and transmission of the key to prevent key leakage. Alternatively, a key distribution center can be used to obtain the key. Both the user and server trust a central key distribution center. When encrypting data, the user requests a key from the key distribution center, which generates the key and sends it to both the user and server.

[0093] Step S13: Perform an inversion operation on the Vandermonde-like fusion matrix to obtain the target inverse matrix, and determine the first decryption parameter corresponding to the P box based on the target inverse matrix, so as to use the first decryption parameter and the second decryption parameter corresponding to the S box to decrypt the ciphertext data to obtain the plaintext data.

[0094] In this embodiment, the target inverse matrix is ​​obtained by inverting the Vandermonde-like fusion matrix. Based on the target inverse matrix, a first decryption parameter corresponding to the P-box is determined. This first decryption parameter, along with a second decryption parameter corresponding to the S-box, is then used to decrypt the ciphertext data to obtain the plaintext data. In other words, this scheme uses a Vandermonde-like fusion matrix instead of the traditional Vandermonde matrix to construct the P-box, fulfilling the function of the diffusion layer in the SP network. This improves the efficiency of inverting the diffusion layer matrix during decryption calculations, reduces computational complexity, and increases operational efficiency.

[0095] As can be seen, this application obtains ciphertext data sent by a user terminal; wherein the ciphertext data is data obtained by the user terminal encrypting plaintext data based on an SP network structure, the P-box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and a Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix; it obtains encryption parameters corresponding to the S-box and P-box in the SP network structure respectively; the encryption parameters include the Vandermonde fusion matrix; it performs an inversion operation on the Vandermonde fusion matrix to obtain a target inverse matrix, and determines a first decryption parameter corresponding to the P-box based on the target inverse matrix, so as to decrypt the ciphertext data to obtain the plaintext data using the first decryption parameter and the second decryption parameter corresponding to the S-box.

[0096] Beneficial Effects: The ciphertext data obtained in this application is data obtained by encrypting plaintext data using the SP network structure on the user end. Furthermore, this application improves the P-box in the SP network structure; the P-box is no longer constructed using the original Vandermonde matrix, but rather based on a preset Vandermonde-like fusion matrix. Specifically, the matrix Vandermonde-like fusion matrix is ​​constructed by transforming the original Vandermonde matrix and the resulting Vandermonde-like matrix. During decryption, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure, including the Vandermonde-like fusion matrix. Finally, this application obtains the target inverse matrix by inverting the Vandermonde-like fusion matrix and determines the first decryption parameter corresponding to the P-box based on the target inverse matrix. The first decryption parameter and the second decryption parameter corresponding to the S-box are then used to decrypt the ciphertext data to obtain the plaintext data. In other words, this scheme uses a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix to construct the P-box, which completes the function of the diffusion layer in the SP network. This improves the efficiency of inverting the diffusion layer matrix during decryption calculation, reduces computational complexity, and increases operational efficiency.

[0097] See Figure 2 As shown, this application discloses a specific data decryption method based on an SP network structure. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0098] Step S21: Obtain the ciphertext data sent by the user terminal; wherein, the ciphertext data is the data obtained by the user terminal after encrypting the plaintext data based on the SP network structure, the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde fusion matrix obtained after transforming the original Vandermonde matrix.

[0099] In this embodiment, the process of the user terminal sending encrypted data may specifically include: the user terminal dividing the plaintext data into plaintext packets of corresponding length based on a preset packet length, and using the S-box in the SP network structure to perform a replacement operation on the plaintext packets to obtain a first replacement packet, and then using the P-box constructed based on a preset Vandermonde fusion matrix to perform a permutation operation on the first replacement packet to obtain a first permutation packet, and then repeating the replacement operation of the S-box and the permutation operation of the P-box based on a preset number of iterations to obtain the encrypted data.

[0100] In other words, the user first divides the plaintext data into plaintext blocks of a preset block length. Then, an S-box substitution operation is performed on the plaintext blocks to obtain the first substituted block, increasing the complexity of the cipher through nonlinear transformation. Further, a P-box constructed based on a preset Vandermonde-like fusion matrix is ​​used to permutate the first substituted block, resulting in the first permuted block. This involves multiplying the S-box substituted block with the Vandermonde-like fusion matrix to rearrange the bits, further enhancing the data diffusion. This S-box substitution and P-box permutation operation is repeated for multiple iterations. Each iteration may use different parameters or perform additional data processing, such as XORing with the subkey, to obtain the encrypted ciphertext blocks.

[0101] In other words, this application encrypts a plaintext block as a whole, resulting in a ciphertext block of the same length as the plaintext, typically 64 bits or 128 bits in size. Figure 3 As shown.

[0102] Step S22: Obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure respectively; the encryption parameters include the Vandermonde-like fusion matrix and the preset packet length.

[0103] Step S23: Invert the Vandermonde-like fusion matrix using the square root algorithm to obtain the target inverse matrix.

[0104] In this embodiment, as can be seen from the foregoing, the Vandermonde-like fusion matrix possesses symmetry and positive definiteness, therefore the square root algorithm can be used to invert the Vandermonde-like fusion matrix.

[0105] In a specific implementation, the process of inverting the Vandermonde-like fusion matrix based on the square root algorithm includes: decomposing the Vandermonde-like fusion matrix into the product of an upper triangular matrix and a lower triangular matrix; wherein the upper triangular matrix and the lower triangular matrix are transposes of each other; determining the inversion expression for inverting the triangular matrix; wherein, in the inversion expression, if the row number and column number of any matrix element at the target position are the same, then the matrix element at the target position in the corresponding inverse matrix is ​​the reciprocal of that matrix element; if the column number of any matrix element at the target position is greater than... If the row number is less than the row number, the value of the matrix element at the target position in the corresponding inverse matrix is ​​calculated based on the target relation. If the column number of any matrix element at the target position is less than the row number, the matrix element at the target position in the corresponding inverse matrix is ​​zero. The upper triangular matrix is ​​inverted based on the inversion expression to obtain the first inverse matrix, and the second inverse matrix corresponding to the lower triangular matrix is ​​determined based on the first inverse matrix. The target inverse matrix is ​​determined based on the first inverse matrix and the second inverse matrix, and the target inverse matrix is ​​used as the inversion result obtained after inverting the Vandermonde fusion matrix.

[0106] That is, in this embodiment, the square root algorithm is first used to decompose the Vandermonde-like fusion matrix into the product of an upper triangular matrix and a lower triangular matrix. The upper triangular matrix and the lower triangular matrix are transposes of each other. Then, by inverting the upper triangular matrix, the inverse matrix of the Vandermonde-like fusion matrix can be obtained.

[0107] First, Decompose into an upper triangular matrix The product of its transpose and its transpose:

[0108] ;

[0109] in It is an upper triangular matrix:

[0110] ;

[0111] in for The element in the i-th row and j-th column.

[0112] The corresponding inverse matrix :

[0113] ;

[0114] The inverse of a triangular matrix can be achieved using the following inverse expression:

[0115] ;

[0116] in for inverse matrix The element in the i-th row and j-th column.

[0117] After inverting the upper triangular matrix based on the inversion expression to obtain the first inverse matrix, the second inverse matrix corresponding to the lower triangular matrix can be quickly obtained. In other words, this application transforms the process of inverting the Vandermonde-like fusion matrix into the process of inverting both the upper and lower triangular matrices. Therefore, the target inverse matrix determined based on the first and second inverse matrices is used as the inversion result obtained after inverting the Vandermonde-like fusion matrix.

[0118] Step S24: Determine the first decryption parameter corresponding to the P box based on the target inverse matrix, so as to divide the ciphertext data into ciphertext groups of corresponding lengths based on the preset group length.

[0119] In this embodiment, the target inverse matrix obtained through the aforementioned solution is the first decryption parameter corresponding to the P-box. During decryption, the ciphertext data first needs to be divided into ciphertext blocks of the corresponding length based on the preset block length. That is, the server first needs to divide the ciphertext data into blocks of the same length as during encryption.

[0120] Step S25: Use the first decryption parameter corresponding to the P box to perform a permutation operation on the ciphertext group to obtain a second permutation group, and then use the second decryption parameter corresponding to the S box to perform a replacement operation on the second permutation group to obtain a second replacement group. Then, repeat the replacement operation performed by the P box based on the first decryption parameter and the permutation operation performed by the S box based on the second decryption parameter based on the preset number of iterations to obtain the plaintext data.

[0121] In this embodiment, since a Vandermonde-like fusion matrix is ​​used as the P-box during encryption, decryption requires performing an inverse P-box permutation operation using the inverse of the Vandermonde-like fusion matrix to obtain the second permutation group. Specifically, the ciphertext group is multiplied by the inverse of the Vandermonde-like fusion matrix to restore the bit order of the data. This step utilizes the invertibility of the Vandermonde-like fusion matrix, rearranging the bits after the P-box permutation during encryption back to their original positions using the inverse matrix. Further, the second permutation group is replaced using the second decryption parameter corresponding to the S-box to obtain the second replacement group. That is, an inverse S-box replacement operation is performed on the group after the inverse P-box permutation to restore the data to its state before the P-box permutation. The inverse S-box replacement is the inverse operation of the S-box replacement during encryption; by looking up the mapping relationship of the inverse S-box, the bits in the ciphertext are converted back to their corresponding bits in the plaintext. Finally, the above inverse P-box permutation and inverse S-box replacement operations are repeated for multiple rounds of iteration. The operation order of each round is the reverse of the encryption process, and may be adjusted according to the parameters during encryption. In each round of iteration, the state of the data is continuously restored, gradually approaching the plaintext, and finally the decrypted plaintext block is obtained, completing the decryption process.

[0122] For a more detailed description of the process of step S22, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0123] In this way, when inverting the diffusion matrix during decryption, this application uses a Vandermonde-like fusion matrix instead of the traditional Vandermonde matrix, requiring only the square root method to obtain the Vandermonde-like fusion matrix. The solution involves inverting the matrix, a computationally much simpler process than inverting an MDS matrix constructed using a traditional Vandermonde matrix. Specifically, the method for decrypting and inverting an MDS matrix constructed using a Vandermonde-like fusion matrix is ​​as follows: Figure 4 As shown.

[0124] The following uses a 3-order matrix as an example, utilizing the Vandermonde matrix... and Vandermonde fusion matrix To compare the implementation process of the constructed MDS matrix decryption and inversion scheme.

[0125] The first step is to find the inverse of the third-order Vandermonde matrix:

[0126] Matrix definition:

[0127] ;

[0128] Corresponding determinant:

[0129] ;

[0130] Algebraic cofactors:

[0131]

[0132] Adjoint matrix:

[0133] ;

[0134] Inverse matrix:

[0135]

[0136] Furthermore, it is known that in the Galois field, addition and subtraction are both XOR operations on two input values, while multiplication and division are performed by looking up a table. The XOR operations and table lookups are collectively referred to as computational costs. The computational costs for inverting a 3rd-order Vandermonde matrix are shown in Table 1:

[0137] Table 1. Computational costs during the inversion of a third-order Vandermonde matrix.

[0138]

[0139] As shown in Table 1, a complete inversion process, which includes the entire process of calculating the determinant to the inverse matrix, has a total cost of 102.

[0140] The inversion process of the third-order Vandermonde fusion matrix is ​​as follows:

[0141] Vandermonde-like matrix:

[0142] ;

[0143] Vandermonde-like fusion matrix:

[0144] ;

[0145] Inverse matrix:

[0146] ;

[0147] in for inverse matrix The element in the i-th row and j-th column.

[0148] Similarly, the XOR operation and table lookup times are collectively referred to as computational cost. Since the inversion formula already exists, the computational cost in the inversion of the Vandermonde-like fusion matrix only arises from the application of the solution formula. Therefore, the computational cost in the inversion of the 3rd-order Vandermonde-like fusion matrix is ​​shown in Table 2:

[0149] Table 2. Computational costs during the inversion of the third-order Vandermonde fusion matrix.

[0150]

[0151] As can be seen from Table 2, the total cost of a complete Vandermonde-like fusion matrix inversion process, which only occurs in the process of solving each element of the formula, is 11.

[0152] By comparison, it can be seen that, for third-order matrices, the cost of inverting the Vandermonde-like fusion matrix is ​​only 11 / 10 = 10.7% of that of the Vandermonde matrix. The newly constructed method for inverting the Vandermonde-like fusion matrix is ​​far superior to the traditional Vandermonde matrix when decrypting the diffusion matrix.

[0153] See Figure 5 As shown in the figure, this application discloses a data decryption device based on an SP network structure, the device comprising:

[0154] The ciphertext acquisition module 11 is used to acquire ciphertext data sent by the user terminal; wherein, the ciphertext data is data obtained by the user terminal after encrypting plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, and the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix.

[0155] Parameter acquisition module 12 is used to acquire encryption parameters corresponding to the S-box and P-box in the SP network structure, respectively; the encryption parameters include the Vandermonde-like fusion matrix;

[0156] The decryption module 13 is used to perform an inversion operation on the Vandermonde-like fusion matrix to obtain a target inverse matrix, and determine a first decryption parameter corresponding to the P box based on the target inverse matrix, so as to use the first decryption parameter and a second decryption parameter corresponding to the S box to decrypt the ciphertext data to obtain the plaintext data.

[0157] As can be seen, this application obtains ciphertext data sent by a user terminal; wherein the ciphertext data is data obtained by the user terminal encrypting plaintext data based on an SP network structure, the P-box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and a Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix; it obtains encryption parameters corresponding to the S-box and P-box in the SP network structure respectively; the encryption parameters include the Vandermonde fusion matrix; it performs an inversion operation on the Vandermonde fusion matrix to obtain a target inverse matrix, and determines a first decryption parameter corresponding to the P-box based on the target inverse matrix, so as to decrypt the ciphertext data to obtain the plaintext data using the first decryption parameter and the second decryption parameter corresponding to the S-box.

[0158] Beneficial Effects: The ciphertext data obtained in this application is data obtained by encrypting plaintext data using the SP network structure on the user end. Furthermore, this application improves the P-box in the SP network structure; the P-box is no longer constructed using the original Vandermonde matrix, but rather based on a preset Vandermonde-like fusion matrix. Specifically, the matrix Vandermonde-like fusion matrix is ​​constructed by transforming the original Vandermonde matrix and the resulting Vandermonde-like matrix. During decryption, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure, including the Vandermonde-like fusion matrix. Finally, this application obtains the target inverse matrix by inverting the Vandermonde-like fusion matrix and determines the first decryption parameter corresponding to the P-box based on the target inverse matrix. The first decryption parameter and the second decryption parameter corresponding to the S-box are then used to decrypt the ciphertext data to obtain the plaintext data. In other words, this scheme uses a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix to construct the P-box, which completes the function of the diffusion layer in the SP network. This improves the efficiency of inverting the diffusion layer matrix during decryption calculation, reduces computational complexity, and increases operational efficiency.

[0159] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data decryption method based on the SP network structure disclosed in any of the foregoing embodiments.

[0160] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0161] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0162] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0163] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the data decryption method based on the SP network structure disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.

[0164] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the data decryption method steps based on the SP network structure disclosed in any of the foregoing embodiments.

[0165] Furthermore, embodiments of this application also disclose a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the data decryption method based on the SP network structure disclosed in any of the foregoing embodiments.

[0166] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0167] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0168] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.

[0169] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0170] The above provides a detailed description of a data decryption method, apparatus, device, and storage medium based on an SP network structure provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A data decryption method based on SP network structure, characterized in that, include: Acquire encrypted data sent by the user terminal; wherein, the encrypted data is the data obtained by the user terminal after encrypting plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, and the Vandermonde fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde fusion matrix obtained after transforming the original Vandermonde matrix. Obtain the encryption parameters corresponding to the S-box and P-box in the SP network structure; the encryption parameters include the Vandermonde-like fusion matrix. The target inverse matrix is ​​obtained by inverting the Vandermonde fusion matrix, and a first decryption parameter corresponding to the P box is determined based on the target inverse matrix, so as to decrypt the ciphertext data to obtain the plaintext data using the first decryption parameter and the second decryption parameter corresponding to the S box; The process of transforming the original Vandermonde matrix to obtain a Vandermonde-like matrix includes: The original Vandermonde matrix is ​​transposed to obtain the corresponding transpose matrix; The transpose matrix is ​​subjected to elementary row operations using a preset parameter matrix to obtain a Vandermonde-like matrix. The process of constructing a Vandermonde-like fusion matrix based on the original Vandermonde matrix and the Vandermonde-like matrix includes: The original Vandermonde matrix and the Vandermonde-like matrix are multiplied to obtain the Vandermonde-like fusion matrix; wherein the Vandermonde-like fusion matrix is ​​a matrix with symmetry and positive definiteness.

2. The data decryption method based on SP network structure according to claim 1, characterized in that, The step of obtaining the encryption parameters corresponding to the S-box and P-box in the SP network structure includes: Obtain the first encryption parameter corresponding to the S box in the SP network structure and the second encryption parameter corresponding to the P box sent by the user terminal; the second encryption parameter includes the Vandermonde-like fusion matrix. Alternatively, obtain from a preset shared storage location the first encryption parameter corresponding to the S box in the SP network structure and the second encryption parameter corresponding to the P box; the second encryption parameter includes the Vandermonde-like fusion matrix.

3. The data decryption method based on SP network structure according to claim 1, characterized in that, The step of inverting the Vandermonde-like fusion matrix to obtain the target inverse matrix includes: The target inverse matrix is ​​obtained by inverting the Vandermonde-like fusion matrix based on the square root algorithm. The process of inverting the Vandermonde-like fusion matrix based on the square root algorithm includes: The Vandermonde-like fusion matrix is ​​decomposed into the product of an upper triangular matrix and a lower triangular matrix; wherein the upper triangular matrix and the lower triangular matrix are transposes of each other; A method for determining the inversion expression for inverting a triangular matrix is ​​defined. In this expression, if the row and column numbers of any matrix element at the target position are the same, then the matrix element at the target position in the corresponding inverse matrix is ​​the reciprocal of that matrix element. If the column number of any matrix element at the target position is greater than the row number, then the value of the matrix element at the target position in the corresponding inverse matrix is ​​calculated based on the target relation. If the column number of any matrix element at the target position is less than the row number, then the matrix element at the target position in the corresponding inverse matrix has a zero value. The upper triangular matrix is ​​inverted based on the inverse expression to obtain the first inverse matrix, and the second inverse matrix corresponding to the lower triangular matrix is ​​determined based on the first inverse matrix. The target inverse matrix is ​​determined based on the first inverse matrix and the second inverse matrix, and the target inverse matrix is ​​used as the inverse result obtained after performing an inverse operation on the Vandermonde fusion matrix.

4. The data decryption method based on SP network structure according to any one of claims 1 to 3, characterized in that, The process of the user terminal sending encrypted data includes: The user terminal divides the plaintext data into plaintext packets of corresponding lengths based on a preset packet length, and uses the S-box in the SP network structure to perform a replacement operation on the plaintext packets to obtain a first replacement packet. Then, it uses the P-box constructed based on a preset Vandermonde fusion matrix to perform a permutation operation on the first replacement packet to obtain a first permutation packet. Then, it repeats the replacement operation of the S-box and the permutation operation of the P-box based on a preset number of iterations to obtain the ciphertext data.

5. The data decryption method based on SP network structure according to claim 4, characterized in that, The encryption parameters also include the preset block length; Accordingly, the step of decrypting the ciphertext data using the first decryption parameter and the second decryption parameter corresponding to the S-box to obtain the plaintext data includes: The ciphertext data is divided into ciphertext groups of corresponding lengths based on the preset group length; The ciphertext group is permuted using the first decryption parameter corresponding to the P box to obtain a second permuted group. Then, the second permuted group is replaced using the second decryption parameter corresponding to the S box to obtain a second replaced group. Then, the replacement operation performed by the P box based on the first decryption parameter and the permutation operation performed by the S box based on the second decryption parameter are repeated based on the preset number of iterations to obtain the plaintext data.

6. A data decryption device based on an SP network structure, characterized in that, include: The ciphertext acquisition module is used to acquire ciphertext data sent by the user terminal; wherein, the ciphertext data is the data obtained by the user terminal after encrypting plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde fusion matrix, which is a matrix constructed based on the original Vandermonde matrix and a Vandermonde fusion matrix obtained by transforming the original Vandermonde matrix. The parameter acquisition module is used to acquire the encryption parameters corresponding to the S-box and P-box in the SP network structure, respectively; the encryption parameters include the Vandermonde-like fusion matrix. The decryption module is used to perform an inversion operation on the Vandermonde-like fusion matrix to obtain a target inverse matrix, and determine a first decryption parameter corresponding to the P box based on the target inverse matrix, so as to use the first decryption parameter and a second decryption parameter corresponding to the S box to decrypt the ciphertext data to obtain the plaintext data; The device is further configured to transform the original Vandermonde matrix to obtain a Vandermonde-like matrix, specifically including: transposing the original Vandermonde matrix to obtain a corresponding transpose matrix; and performing elementary row operations on the transpose matrix using a preset parameter matrix to obtain a Vandermonde-like matrix. The apparatus is further configured to construct a Vandermonde fusion matrix based on the original Vandermonde matrix and the Vandermonde-like matrix, specifically by performing a product operation on the original Vandermonde matrix and the Vandermonde-like matrix to obtain the Vandermonde fusion matrix; wherein the Vandermonde fusion matrix is ​​a matrix with symmetry and positive definiteness.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data decryption method based on the SP network structure as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the steps of the data decryption method based on the SP network structure as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method and device and storage system

    CN116092567A

  • SNARK-based non-interactive public verifiable system and calculation method in block chain scene

    CN116545603A