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

By using the Van der Mont's fusion matrix in the SP network structure to construct the P box and perform inverse operations, the problem of low decryption calculation efficiency in the prior art is solved, and a more efficient decryption process is achieved.

CN119561675AActive Publication Date: 2025-03-04SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art has low inversion efficiency of the diffusion layer matrix during decryption calculations, high computational complexity, resulting in low computational efficiency.

Method used

The data decryption method based on the SP network structure is adopted to obtain the ciphertext data sent by the user and build the P box based on the preset Van der Montreal fusion matrix, obtain the encryption parameters corresponding to the S box and the P box, perform inverse calculation to determine the decryption parameters and decrypt the ciphertext data.

Benefits of technology

The inversion efficiency of the diffusion layer matrix is ​​improved, the calculation complexity is reduced, and the calculation efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561675A_ABST
    Figure CN119561675A_ABST
Patent Text Reader

Abstract

The invention discloses a data decryption method and device based on an SP network structure, equipment and a medium, and relates to the technical field of information security, and the method comprises the steps: obtaining ciphertext data sent by a user side; the ciphertext data is data obtained after the user side encrypts plaintext data based on an SP network structure, a P box in the SP network structure is constructed based on a preset Vandermonde-like fusion matrix, and the Vandermonde-like fusion matrix is constructed based on an original Vandermonde matrix and a Vandermonde-like matrix obtained after the original Vandermonde matrix is transformed; acquiring encryption parameters respectively corresponding to an S box and a P box in the SP network structure; the encryption parameter comprises a Vandermonde-like fusion matrix; and performing inverse operation on the Vandermonde-like 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 decrypting the ciphertext data by using the first decryption parameter and a second decryption parameter corresponding to the S box to obtain plaintext data. According to the method, the inversion efficiency can be improved during decryption calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a data decryption method, device, equipment and medium based on an SP network structure. Background Art

[0002] As the core and key technology of information security, modern cryptography plays a huge role in protecting data security and user privacy. Block ciphers have attracted widespread attention and become a hot topic in cryptography research due to their fast encryption and decryption speed, easy software and hardware implementation, and easy standardization.

[0003] The SP (S stands for Substitution; P stands for Permutation) network structure is a widely used overall structure of a block cipher. In each round of this cipher, the round input is first subjected to a reversible function S controlled by a subkey, and then subjected to a permutation P. The SP network structure is very clear. S is generally called the confusion layer, which mainly plays a role in confusion, and P is generally called the diffusion layer, which mainly plays a role in diffusion. Intuitively, passing through the confusion layer first and then the diffusion layer is very close to the confusion principle and diffusion principle proposed by Shannon. In addition, modern block ciphers iterate the confusion layer and diffusion layer through the overall structure many times, which will enhance the obfuscation and diffusion of the cipher, making the dependency between the output and input of the cipher more complex. The S box is a nonlinear transformation. The P box is a linear transformation, and each linear transformation corresponds to a matrix one by one.

[0004] MDS (Maximum Distance Separable) is widely used in the diffusion layer of block ciphers. Therefore, how to construct an MDS matrix with good properties has become a research goal. The Vandermonde matrix method is currently a commonly used method for constructing an MDS matrix. However, as the matrix order increases, the element values ​​in the matrix increase exponentially, resulting in extremely high costs for constructing and storing the MDS matrix. In addition, the existing Vandermonde matrix inversion requires large amounts of computation and complex logic, resulting in very high time costs for diffusion matrix decryption.

[0005] In summary, how to improve the inversion efficiency of the diffusion layer matrix during decryption calculations, reduce computational complexity, and improve computational efficiency is a problem that needs to be solved. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a data decryption method, device, equipment and medium based on the SP network structure, which can improve the inversion efficiency of the diffusion layer matrix during decryption calculation, reduce the calculation complexity and improve the operation efficiency. The specific scheme is as follows:

[0007] In a first aspect, the present application discloses a data decryption method based on an SP network structure, comprising:

[0008] Acquire ciphertext data sent by the user end; wherein the ciphertext data is data obtained by the user end 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-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix;

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

[0010] An inversion operation is performed on the Vandermonde-like fusion matrix to obtain a target inverse matrix, and a first decryption parameter corresponding to the P-box is determined 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.

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

[0012] Transposing the original Vandermonde matrix to obtain a corresponding transposed matrix;

[0013] The transposed matrix is ​​subjected to elementary row transformation 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] A product operation is performed on the original Vandermonde matrix and the quasi-Vandermonde matrix to obtain a quasi-Vandermonde fusion matrix; wherein the quasi-Vandermonde fusion matrix is ​​a matrix with symmetry and positive definiteness.

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

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

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

[0019] Optionally, performing an inverse operation on the Vandermonde-like fusion matrix to obtain a target inverse matrix includes:

[0020] Performing an inverse operation on the Vandermonde-like fusion matrix based on a square root algorithm to obtain a target inverse matrix;

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

[0022] 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 transposed matrices of each other;

[0023] Determine an inversion expression for performing an inversion operation on a 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 the any 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 a target relationship; 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 is ​​zero;

[0024] Performing an inverse operation on the upper triangular matrix based on the inverse expression to obtain a first inverse matrix, and determining a second inverse matrix corresponding to the lower triangular matrix based on the first inverse matrix;

[0025] A target inverse matrix is ​​determined based on the first inverse matrix and the second inverse matrix, and the target inverse matrix is ​​used as an inversion result obtained by performing an inversion operation on the Vandermonde-like fusion matrix.

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

[0027] The user end divides the plaintext data into plaintext groups of corresponding lengths based on a preset group length, and uses an S-box in the SP network structure to perform a replacement operation on the plaintext group to obtain a first replacement group, and then uses a P-box constructed based on a preset Vandermonde fusion matrix to perform a permutation operation on the first replacement group to obtain a first permutation group, and then 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 parameter also includes the preset packet length;

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

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

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

[0032] In a second aspect, the present application discloses a data decryption device based on an SP network structure, comprising:

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

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

[0035] A decryption module is used to perform an inverse 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] In a third aspect, the present application discloses an electronic device, including:

[0037] Memory, used to store computer programs;

[0038] The processor is used to execute the computer program to implement the steps of the aforementioned SP network structure-based data decryption method disclosed above.

[0039] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned data decryption method based on the SP network structure disclosed above are implemented.

[0040] It can be seen that the present application obtains ciphertext data sent by the user terminal; wherein the ciphertext data is data obtained after the user terminal encrypts the plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix; obtains encryption parameters corresponding to the S box and the P box in the SP network structure respectively; the encryption parameters include the Vandermonde-like fusion matrix; performs an inverse operation on the Vandermonde-like 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 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.

[0041] Beneficial effect: The ciphertext data obtained in the present application is the data obtained after the user end encrypts the plaintext data using the SP network structure, and the present application improves the P box in the SP network structure. The P box is no longer constructed using the original Vandermonde matrix, but is constructed based on a preset Vandermonde-like fusion matrix. Among them, the matrix-like Vandermonde fusion matrix is ​​constructed by the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix. When decrypting, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S box and the P box in the SP network structure, respectively. The encryption parameters include the Vandermonde-like fusion matrix. Finally, the present 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, 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. That is, this scheme uses a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix to construct a P-box and complete the function of the diffusion layer in the SP network, thereby improving the inversion efficiency of the diffusion layer matrix during decryption calculations, reducing computational complexity, and improving computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A flow chart of a data decryption method based on SP network structure disclosed in this application;

[0044] Figure 2A flowchart of a specific data decryption method based on SP network structure disclosed in this application;

[0045] Figure 3 A schematic diagram of encrypting a plaintext group to obtain a ciphertext group disclosed in the present application;

[0046] Figure 4 A flowchart of decrypting and inverting an MDS matrix constructed by using a Vandermonde-like fusion matrix disclosed in the present application;

[0047] Figure 5 This is a schematic diagram of the structure 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 DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0050] MDS is widely used in the diffusion layer of block ciphers. Therefore, how to construct an MDS matrix with good properties has become a research goal. The Vandermonde matrix method is a commonly used method for constructing an MDS matrix. Its application in the diffusion layer is as follows:

[0051] Vandermonde Matrix for:

[0052] ;

[0053] Then the determinant The values ​​are:

[0054] ;

[0055] because are not equal and non-zero, so It is known that the necessary and sufficient condition for an n-order matrix to be an MDS matrix is ​​that all order sub-formulas of the matrix are non-zero, that is, it is a non-singular matrix. Therefore, the Vandermonde matrix satisfies the MDS matrix condition.

[0056] Information matrix D, coding matrix Y:

[0057] ;

[0058] In matrix form:

[0059] ;

[0060] decoding:

[0061] ;

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

[0063] ;

[0064] in for The adjoint matrix of . For simplicity, the following notation is used: k does not appear, for example It can be expressed as , and arrive The product of .

[0065] make , but:

[0066] ;

[0067] make ,but:

[0068] ;

[0069] So we can get:

[0070] ;

[0071] Available The first row and first column element of :

[0072] ;

[0073] By extension, we can finally get the inverse matrix of the Vandermonde matrix :

[0074] ;

[0075] In summary, it can be observed that the idea of ​​using the Vandermonde matrix MDS matrix is ​​very simple, but as the matrix order increases, the element values ​​in the matrix increase exponentially, resulting in extremely high costs for constructing and storing the MDS matrix, and the existing Vandermonde matrix inversion calculation is large and the logic is complex, resulting in very high time costs for diffusion matrix decryption. To this end, the embodiment of the present application discloses a data decryption method, device, equipment and medium based on an SP network structure, which can improve the inversion efficiency of the diffusion layer matrix during decryption calculations, reduce calculation complexity, and improve operation efficiency.

[0076] See also Figure 1 As shown, the embodiment of the present application discloses a data decryption method based on an SP network structure, the method comprising:

[0077] Step S11: Acquire ciphertext data sent by the user end; wherein the ciphertext data is data obtained by the user end 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-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and a Vandermonde-like matrix obtained by transforming the original Vandermonde matrix.

[0078] In this embodiment, the ciphertext data obtained by the server is the data obtained after the user end encrypts the plaintext data using the SP network structure, and the present application improves the P box in the SP network structure, and the P box is no longer constructed using the original Vandermonde matrix, but is constructed based on a preset quasi-Vandermonde fusion matrix. The quasi-Vandermonde fusion matrix is ​​constructed by the original Vandermonde matrix and the quasi-Vandermonde 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 a corresponding transposed matrix; and performing elementary row transformation on the transposed matrix using a preset parameter matrix to obtain a Vandermonde-like matrix. That is, in this embodiment, the Vandermonde matrix is ​​first transformed into First transpose, then use the preset parameter matrix Performing elementary row transformations, 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 a Vandermonde-like fusion matrix; wherein the Vandermonde-like fusion matrix is ​​a matrix with symmetry and positive definiteness. That is, this embodiment converts the Vandermonde matrix and Vandermonde-like matrices Multiply to get the Vandermonde-like fusion matrix :

[0083] ;

[0084] ;

[0085] For the matrix , which satisfies the following conditions:

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

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

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

[0089] In this embodiment, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S box and the P box in the SP network structure, so as to determine the corresponding decryption parameters according to the encryption parameters to complete the decryption of the ciphertext data. The encryption parameters include the Vandermonde fusion matrix .

[0090] In a specific implementation, the obtaining of encryption parameters corresponding to the S-box and the P-box in the SP network structure respectively includes: obtaining a first encryption parameter corresponding to the S-box in the SP network structure and a second encryption parameter corresponding to the P-box sent by a user terminal; the second encryption parameter includes the Vandermonde-like fusion matrix; or obtaining 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 includes the Vandermonde-like fusion matrix.

[0091] That is, in a specific embodiment, it can be sent by the user end, and the user end can send the ciphertext data and the encryption parameter to the server together, or send the two data to the server separately, and this application does not limit this. The encryption parameter specifically includes a first encryption parameter corresponding to the S box in the SP network structure and a second encryption parameter corresponding to the P box, and the second encryption parameter specifically includes a Vandermonde fusion matrix.

[0092] In another specific embodiment, the encryption parameters may be shared, and the server may 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, wherein the second encryption parameter specifically includes a Vandermonde fusion matrix. For example, the user end and the server end pre-share a key in a secure manner before encryption, and when the server end needs to decrypt, it directly uses the pre-shared key for decryption. 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 the key from being leaked. In addition, the key can also be obtained with the help of a key distribution center. Both the user end and the server end trust a central key distribution center. When encrypting data, the user end requests the key from the key distribution center, and the key distribution center generates the key and sends it to the user end and the server end.

[0093] Step S13: performing an inverse operation on the Vandermonde-like fusion matrix to obtain a target inverse matrix, and determining 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.

[0094] In this embodiment, the target inverse matrix is ​​obtained by inverting the Vandermonde fusion matrix, and the first decryption parameter corresponding to the P box is determined based on the target inverse matrix, so that the ciphertext data is decrypted using the first decryption parameter and the second decryption parameter corresponding to the S box to obtain the plaintext data. That is, this solution uses the Vandermonde fusion matrix to replace the traditional Vandermonde matrix to construct the P box, complete the function of the diffusion layer in the SP network, thereby improving the inversion efficiency of the diffusion layer matrix during decryption calculation, reducing the calculation complexity, and improving the calculation efficiency.

[0095] It can be seen that the present application obtains ciphertext data sent by the user terminal; wherein the ciphertext data is data obtained after the user terminal encrypts the plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix; obtains encryption parameters corresponding to the S box and the P box in the SP network structure respectively; the encryption parameters include the Vandermonde-like fusion matrix; performs an inverse operation on the Vandermonde-like 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 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.

[0096] Beneficial effect: The ciphertext data obtained in the present application is the data obtained after the user end encrypts the plaintext data using the SP network structure, and the present application improves the P box in the SP network structure. The P box is no longer constructed using the original Vandermonde matrix, but is constructed based on a preset Vandermonde-like fusion matrix. Among them, the matrix-like Vandermonde fusion matrix is ​​constructed by the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix. When decrypting, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S box and the P box in the SP network structure, respectively. The encryption parameters include the Vandermonde-like fusion matrix. Finally, the present 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, 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. That is, this scheme uses a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix to construct a P-box and complete the function of the diffusion layer in the SP network, thereby improving the inversion efficiency of the diffusion layer matrix during decryption calculations, reducing computational complexity, and improving computational efficiency.

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

[0098] Step S21: Acquire ciphertext data sent by the user end; wherein the ciphertext data is data obtained by the user end 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-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix.

[0099] In this embodiment, the process of the user terminal sending ciphertext data may specifically include: the user terminal divides the plaintext data into plaintext groups of corresponding lengths based on a preset group length, and uses an S box in the SP network structure to perform a replacement operation on the plaintext group to obtain a first replacement group, and then uses a P box constructed based on a preset Vandermonde fusion matrix to perform a permutation operation on the first replacement group to obtain a first permutation group, and then 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.

[0100] That is, the user end first divides the plaintext data into plaintext groups of corresponding lengths based on the preset group length, and then performs an S-box replacement operation on the plaintext group to obtain a first replacement group, so as to increase the complexity of the password through nonlinear transformation; further, the first replacement group is permuted using a P-box constructed based on a preset Vandermonde fusion matrix to obtain a first permuted group, that is, the group after S-box replacement is multiplied with the Vandermonde fusion matrix to achieve bit rearrangement and further enhance the degree of data diffusion. Repeat the above S-box replacement and P-box replacement operations for multiple rounds of iterations, and each round may use different parameters or perform some additional processing on the data, such as XOR with the subkey, to obtain the encrypted ciphertext group.

[0101] That is, in this application, a plaintext block is encrypted as a whole to obtain a ciphertext block of the same length as the plaintext, and the typical block size is 64 bits or 128 bits, such as Figure 3 shown.

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

[0103] Step S23: performing an inverse operation on the Vandermonde-like fusion matrix based on a square root algorithm to obtain a target inverse matrix.

[0104] In this embodiment, it can be known from the above content that the Vandermonde-like fusion matrix has symmetry and positive definiteness, so the square root algorithm can be used to perform an inverse operation on 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 transposed matrices of each other; determining an 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 any matrix element; if the column number of any matrix element at the target position is greater than row number, then the value of the matrix element at the target position in the corresponding inverse matrix is ​​calculated based on the target relationship; 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; based on the inversion expression, the upper triangular matrix is ​​inverted to obtain a first inverse matrix, and the second inverse matrix corresponding to the lower triangular matrix is ​​determined based on the first inverse matrix; based on the first inverse matrix and the second inverse matrix, a target inverse matrix is ​​determined, and the target inverse matrix is ​​used as the inversion result obtained after the inversion operation is performed on the Vandermonde-like fusion matrix.

[0106] That is, this embodiment first uses the square root algorithm 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 transposed matrices of each other, and then the inverse matrix of the Vandermonde-like fusion matrix can be obtained by inverting the upper triangular matrix.

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

[0108] ;

[0109] in is an upper triangular matrix:

[0110] ;

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

[0112] The corresponding inverse matrix :

[0113] ;

[0114] The inversion of a triangular matrix can be done using the following inversion expression:

[0115] ;

[0116] in for The inverse matrix The element at row i and column j.

[0117] After the upper triangular matrix is ​​inverted 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, that is, the present application converts the process of inverting the Vandermonde-like fusion matrix into the process of inverting the upper triangular matrix and the lower triangular matrix. Thus, the target inverse matrix determined based on the first inverse matrix and the second inverse matrix is ​​used as the inversion result obtained after the Vandermonde-like fusion matrix is ​​inverted.

[0118] Step S24: determining a 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 by the above solution is the first decryption parameter corresponding to the P box. When decrypting, the ciphertext data needs to be first divided into ciphertext groups of corresponding lengths based on the preset group length. That is, the server first needs to divide the ciphertext data into groups of the same length as when encrypting.

[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, then use the second decryption parameter corresponding to the S box to perform a permutation operation on the second permutation group to obtain a second permutation group, and then repeat the permutation 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 a P-box in the encryption process, the inverse matrix of the Vandermonde-like fusion matrix needs to be used to perform an inverse P-box permutation operation to obtain a second permutation group during decryption. Specifically, the ciphertext group is multiplied by the inverse matrix of the Vandermonde-like fusion matrix to restore the bit order of the data. This step utilizes the reversibility of the Vandermonde-like fusion matrix, and the bits permuted by the P-box in the encryption process are rearranged to their original positions through the inverse matrix. Further, the second permutation group is permuted using a second decryption parameter corresponding to the S-box to obtain a second replacement group, that is, the group permuted by the inverse P-box is permuted by an inverse S-box, and the data is restored to the state before the P-box permutation. The inverse S-box replacement is the inverse operation of the S-box replacement in the encryption process. By finding the mapping relationship of the inverse S-box, the bits in the ciphertext are converted back to the bits corresponding to the plaintext. Finally, repeat the above inverse P-box permutation and inverse S-box replacement operations for multiple rounds of iterations. The operation order of each round is opposite to the encryption process, and may be adjusted accordingly 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 grouping is obtained to complete the decryption process.

[0122] For a more specific processing procedure of the above step S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0123] In this way, when the diffusion matrix is ​​decrypted and the inverse is obtained, the Vandermonde-like fusion matrix is ​​used to replace the traditional Vandermonde matrix. It is only necessary to use the square root method to convert the Vandermonde-like fusion matrix to The inversion is much easier than using the traditional Vandermonde matrix to construct the MDS matrix for inversion. The specific solution for decrypting and inverting the MDS matrix constructed using the Vandermonde-like fusion matrix is ​​as follows: Figure 4 shown.

[0124] The following takes the third-order matrix as an example, using the Vandermonde matrix and the Vandermonde-like fusion matrix To compare the implementation process of the constructed MDS matrix decryption and inversion scheme.

[0125] The first is the inversion process of the third-order Vandermonde matrix:

[0126] Matrix definition:

[0127] ;

[0128] The corresponding determinant is:

[0129] ;

[0130] Algebraic cofactor:

[0131]

[0132] Adjoint matrix:

[0133] ;

[0134] Inverse Matrix:

[0135]

[0136] We also know that on the Galois Field, addition and subtraction are both XOR values ​​of two input values, and multiplication and division are obtained by looking up the table. The number of XOR and table lookup times is collectively referred to as the computational cost, and the computational cost of the inversion process of the 3rd-order Vandermonde matrix is ​​shown in Table 1:

[0137] Table 1 Computational cost in the process of inverting the third-order Vandermonde matrix

[0138]

[0139] It can be seen from Table 1 that a complete inversion process, that is, the entire process from determinant calculation to inverse matrix calculation, has a total cost of 102.

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

[0141] Vandermonde-like matrix:

[0142] ;

[0143] Vandermonde-like fusion matrix:

[0144] ;

[0145] Inverse Matrix:

[0146] ;

[0147] in for The inverse matrix The element at row i and column j.

[0148] Similarly, the number of XOR and table lookup is collectively referred to as the computational cost. Since the inversion formula already exists, the computational cost of the inversion process of the Vandermonde-like fusion matrix only comes from the application of the solution formula. The computational cost of the inversion process of the third-order Vandermonde-like fusion matrix is ​​shown in Table 2:

[0149] Table 2 Computational cost of inverting the third-order Vandermonde-like fusion matrix

[0150]

[0151] It can be seen from Table 2 that the total cost of a complete Vandermonde-like fusion matrix inversion process, that is, the process of solving each element of the solution formula, is 11.

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

[0153] See also Figure 5 As shown, the embodiment of the present 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 end; wherein the ciphertext data is data obtained by the user end 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, 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] A parameter acquisition module 12 is used to acquire encryption parameters corresponding to the S-box and the P-box in the SP network structure; the encryption parameters include the Vandermonde-like fusion matrix;

[0156] The decryption module 13 is used to perform an inverse 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] It can be seen that the present application obtains ciphertext data sent by the user terminal; wherein the ciphertext data is data obtained after the user terminal encrypts the plaintext data based on the SP network structure, and the P box in the SP network structure is constructed based on a preset Vandermonde-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix; obtains encryption parameters corresponding to the S box and the P box in the SP network structure respectively; the encryption parameters include the Vandermonde-like fusion matrix; performs an inverse operation on the Vandermonde-like 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 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.

[0158] Beneficial effect: The ciphertext data obtained in the present application is the data obtained after the user end encrypts the plaintext data using the SP network structure, and the present application improves the P box in the SP network structure. The P box is no longer constructed using the original Vandermonde matrix, but is constructed based on a preset Vandermonde-like fusion matrix. Among them, the matrix-like Vandermonde fusion matrix is ​​constructed by the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix. When decrypting, in addition to obtaining the ciphertext data, it is also necessary to obtain the encryption parameters corresponding to the S box and the P box in the SP network structure, respectively. The encryption parameters include the Vandermonde-like fusion matrix. Finally, the present 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, 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. That is, this scheme uses a Vandermonde-like fusion matrix to replace the traditional Vandermonde matrix to construct a P-box and complete the function of the diffusion layer in the SP network, thereby improving the inversion efficiency of the diffusion layer matrix during decryption calculations, reducing computational complexity, and improving computational efficiency.

[0159] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present 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 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps of the data decryption method based on the SP network structure performed by the electronic device disclosed in any of the aforementioned embodiments.

[0160] In this embodiment, the power supply 23 is used to provide working 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 the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain 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] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of 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 is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

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

[0163] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data decryption method based on the SP network structure executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can also further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25.

[0164] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the data decryption method based on the SP network structure disclosed in any of the aforementioned embodiments are implemented.

[0165] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the data decryption method based on the SP network structure disclosed in any of the aforementioned embodiments.

[0166] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

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

[0168] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a 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 article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0170] The above is a detailed introduction to a data decryption method, device, equipment and storage medium based on an SP network structure provided by the present invention. Specific examples are used herein to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A data decryption method based on SP network structure, characterized in that: include: Acquire ciphertext data sent by the user end; wherein the ciphertext data is data obtained by the user end 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-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on the original Vandermonde matrix and the Vandermonde-like matrix obtained by transforming the original Vandermonde matrix; Acquire encryption parameters corresponding to the S-box and the P-box in the SP network structure respectively; the encryption parameters include the Vandermonde-like fusion matrix; An inversion operation is performed on the Vandermonde-like fusion matrix to obtain a target inverse matrix, and a first decryption parameter corresponding to the P-box is determined 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.

2. The data decryption method based on SP network structure according to claim 1 is characterized in that: The process of transforming the original Vandermonde matrix to obtain a quasi-Vandermonde matrix includes: Transposing the original Vandermonde matrix to obtain a corresponding transposed matrix; The transposed matrix is ​​subjected to elementary row transformation using a preset parameter matrix to obtain a Vandermonde-like matrix.

3. The data decryption method based on SP network structure according to claim 2 is characterized in that: The process of constructing a Vandermonde-like fusion matrix based on the original Vandermonde matrix and the Vandermonde-like matrix includes: A product operation is performed on the original Vandermonde matrix and the quasi-Vandermonde matrix to obtain a quasi-Vandermonde fusion matrix; wherein the quasi-Vandermonde fusion matrix is ​​a matrix with symmetry and positive definiteness.

4. The data decryption method based on SP network structure according to claim 1, characterized in that: The obtaining of encryption parameters respectively corresponding to the S box and the P box in the SP network structure includes: Acquire a first encryption parameter corresponding to the S box in the SP network structure and a second encryption parameter corresponding to the P box sent by the user end; the second encryption parameter includes the Vandermonde-like fusion matrix; Or, a first encryption parameter corresponding to the S box in the SP network structure and a second encryption parameter corresponding to the P box are obtained from a preset shared storage location; the second encryption parameter includes the Vandermonde-like fusion matrix.

5. The data decryption method based on SP network structure according to claim 1, characterized in that: The step of performing an inverse operation on the Vandermonde-like fusion matrix to obtain a target inverse matrix includes: Performing an inverse operation on the Vandermonde-like fusion matrix based on a square root algorithm to obtain a target inverse matrix; 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 transposed matrices of each other; Determine an inversion expression for performing an inversion operation on a 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 the any 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 a target relationship; 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 is ​​zero; Performing an inverse operation on the upper triangular matrix based on the inverse expression to obtain a first inverse matrix, and determining a second inverse matrix corresponding to the lower triangular matrix based on the first inverse matrix; A target inverse matrix is ​​determined based on the first inverse matrix and the second inverse matrix, and the target inverse matrix is ​​used as an inversion result obtained by performing an inversion operation on the Vandermonde-like fusion matrix.

6. The data decryption method based on the SP network structure according to any one of claims 1 to 5, characterized in that: The process of the user end sending ciphertext data includes: The user end divides the plaintext data into plaintext groups of corresponding lengths based on a preset group length, and uses an S-box in the SP network structure to perform a replacement operation on the plaintext group to obtain a first replacement group, and then uses a P-box constructed based on a preset Vandermonde fusion matrix to perform a permutation operation on the first replacement group to obtain a first permutation group, and then 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.

7. The data decryption method based on SP network structure according to claim 6, characterized in that: The encryption parameters also include the preset packet length; Correspondingly, decrypting the ciphertext data using the first decryption parameter and a second decryption parameter corresponding to the S-box to obtain the plaintext data includes: Dividing the ciphertext data into ciphertext groups of corresponding lengths based on the preset group length; A first decryption parameter corresponding to the P box is used to perform a permutation operation on the ciphertext group to obtain a second permutation group, and then a second decryption parameter corresponding to the S box is used to perform a replacement operation on the second permutation group to obtain a second replacement group. Then, based on the preset number of iterations, the replacement operation performed by the P box based on the first decryption parameter and the replacement operation performed by the S box based on the second decryption parameter are repeated to obtain the plaintext data.

8. A data decryption device based on SP network structure, characterized in that: include: A ciphertext acquisition module, used to acquire ciphertext data sent by a user terminal; wherein the ciphertext data is data obtained by the user terminal after encrypting plaintext data based on an SP network structure, the P box in the SP network structure is constructed based on a preset Vandermonde-like fusion matrix, and the Vandermonde-like fusion matrix is ​​a matrix constructed based on an original Vandermonde matrix and a Vandermonde-like matrix obtained by transforming the original Vandermonde matrix; A parameter acquisition module, used to acquire encryption parameters corresponding to the S-box and the P-box in the SP network structure; the encryption parameters include the Vandermonde-like fusion matrix; A decryption module is used to perform an inverse 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.

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

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

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

  • Key use method and device, equipment and storage medium

    CN116743345A

  • Decoding method, decoding program, decoding device and secret key generation method

    JP2014102398A

  • Cryptographic Computer Machines with Novel Switching Devices

    US20230125560A1