Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media
By using the combination technology of maximum rank distance code and encryption and decryption private key in data encryption, the vulnerability of traditional encryption methods in quantum computer environment has been improved, achieving higher security and resistance to quantum computing.
Patent Information
- Application Number
- CN202411408903.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-10
AI Technical Summary
Traditional data encryption methods become fragile when facing the Shor algorithm and Grover algorithm of quantum computers, resulting in low security of encrypted storage.
By initializing the generation matrix according to the preset maximum rank distance code, the stored data is packaged and encoded, and primary and secondary encryption is performed using the encryption and decryption private key to form a data encryption method that resists quantum decryption.
It improves the reliability of encryption quality, reduces the probability of being cracked, enhances the security of encryption, and can effectively resist attacks from quantum computers.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data encryption technology, and in particular to a data encryption method and decryption method resistant to quantum decryption, and related devices, electronic equipment, and media. Background Art
[0002] With the development of social informatization, more and more people have begun to pay attention to data security. In order to ensure data security and prevent data leakage, data storage devices such as solid-state drives generally encrypt written data and decrypt it when users read the data.
[0003] Traditional methods of encrypting and decrypting stored data generally encrypt and decrypt stored data based on traditional encryption methods such as AES, national secrets, and military secrets. These encryption methods are mainly based on mathematical problems such as large integer decomposition, discrete logarithms, and one-way functions. Because solving these mathematical problems often exceeds the computing power of current computers, they can achieve better encryption effects. However, with the emergence of quantum computers, traditional encryption methods will become very fragile, especially the Shor algorithm and Grover algorithm of quantum computers will pose a huge threat to current encryption methods, which may lead to low security when encrypting and storing data. Summary of the invention
[0004] The present invention provides a data encryption method, a decryption method and related devices, electronic equipment and media that are resistant to quantum decryption. The main purpose of the present invention is to solve the problem of low security when encrypting and storing data in related technologies.
[0005] To achieve the above-mentioned purpose, the present invention provides a data encryption method resistant to quantum decryption, comprising: initializing a generation matrix according to a preset maximum rank distance code; packaging storage data according to the generation matrix to obtain a storage data packet; splicing the storage data packet using a preset encryption and decryption private key to obtain a standard data packet; encoding the standard data packet according to the generation matrix to obtain encoded data; encrypting the encoded data according to the standard data packet using the encryption and decryption private key to obtain encrypted storage data.
[0006] To achieve the above-mentioned purpose, the present invention provides a data decryption method resistant to quantum decryption, comprising: calculating a check matrix according to a preset generator matrix; reconstructing the encrypted storage data acquired in advance using a preset encryption and decryption private key to obtain reconstructed storage data; decoding the reconstructed storage data according to the generator matrix and the check matrix to obtain a decoded codeword; performing data error correction on the decoded codeword using the generator matrix and the reconstructed storage data to obtain a storage data packet; and unpacking the storage data packet to obtain storage data.
[0007] In order to solve the above problems, the present invention also provides a data encryption device that is resistant to quantum decryption, and the device includes: a matrix creation module, which is used to initialize the generation matrix according to a preset maximum rank distance code; a data packaging module, which is used to package the storage data according to the generation matrix to obtain a storage data packet; a key splicing module, which is used to perform data splicing on the storage data packet using a preset encryption and decryption private key to obtain a standard data packet; a data encoding module, which is used to encode the standard data packet according to the generation matrix to obtain encoded data; a private key encryption module, which is used to encrypt the encoded data according to the standard data packet using the encryption and decryption private key to obtain encrypted storage data.
[0008] In order to solve the above problems, the present invention also provides a data encryption device that is resistant to quantum decryption, and the device includes: a matrix creation module, which is used to calculate a check matrix according to a preset generation matrix; a data reconstruction module, which is used to reconstruct the pre-acquired encrypted storage data using a preset encryption and decryption private key to obtain reconstructed storage data; a data decoding module, which is used to decode the reconstructed storage data according to the generation matrix and the check matrix to obtain a decoding codeword; a data error correction module, which is used to perform data error correction on the decoding codeword using the generation matrix and the reconstructed storage data to obtain a storage data packet; a data unpacking module, which is used to unpack the storage data packet to obtain the storage data.
[0009] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0010] at least one processor; and,
[0011] a memory communicatively connected to at least one processor; wherein,
[0012] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can implement the above-mentioned quantum decryption-resistant data encryption method and decryption method.
[0013] In order to solve the above problems, the present invention also provides a computer-readable storage medium storing a computer program, which implements the above-mentioned quantum-resistant data encryption method and decryption method when executed by a processor.
[0014] The embodiment of the present invention can ensure that the generator matrix has the maximum error detection and correction capability by initializing the generator matrix according to the preset maximum rank distance code, thereby improving the reliability of the encryption quality. By packing the storage data according to the generator matrix to obtain the storage data packet, the length of the encoded storage data can be equal to the codeword length, thereby ensuring that the generator matrix has the maximum error detection and correction capability, thereby improving the reliability of the encryption quality. By using the preset encryption and decryption private key to encode the storage data packet according to the generator matrix, the primary encryption of the storage data packet can be realized by the encryption and decryption private key, and the secondary encryption can be realized by using the generator matrix, thereby reducing the probability of being cracked and improving the security of the encryption. By using the encryption and decryption private key to encrypt the encoded data according to the storage data packet, the storage amount of data can be reduced and the security of the encryption can be enhanced. By calculating the check matrix according to the preset generator matrix, it can be ensured that the product of the transposed matrix of the generator matrix and the check matrix is 0, thereby realizing the check during decryption by using the maximum rank distance algorithm. By using the preset encryption and decryption private key to decode the pre-acquired encrypted storage data according to the check matrix, the encryption and decryption private key can be used to complete the encrypted storage data to obtain the reconstructed storage data similar to the check code, thereby realizing decryption and verification. Therefore, the quantum decryption-resistant data encryption method, decryption method and related devices, electronic devices, and media proposed in the present invention can solve the problem of low security when encrypting and storing data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of a flow chart of a data encryption method resistant to quantum decryption provided by an embodiment of the present invention;
[0016] Figure 2 A schematic diagram of a flow chart of a data decryption method resistant to quantum decryption provided by an embodiment of the present invention;
[0017] Figure 3 A functional module diagram of a data encryption device resistant to quantum decryption provided by an embodiment of the present invention;
[0018] Figure 4 A functional module diagram of a data decryption device resistant to quantum decryption provided by an embodiment of the present invention;
[0019] Figure 5 A schematic diagram of the structure of an electronic device for implementing a data encryption method and a decryption method that are resistant to quantum decryption provided in one embodiment of the present invention.
[0020] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0022] The embodiments of the present application provide a data encryption method and a decryption method that are resistant to quantum decryption. The execution subjects of the data encryption method and the decryption method that are resistant to quantum decryption include but are not limited to at least one of the electronic devices such as the server and the terminal that can be configured to execute the method provided in the embodiments of the present application. In other words, the data encryption method and the decryption method that are resistant to quantum decryption can be executed by software or hardware installed on the terminal device or the server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0023] Reference Figure 1 FIG. 1 is a flow chart of a data encryption method resistant to quantum decryption provided by an embodiment of the present invention. In this embodiment, the data encryption method resistant to quantum decryption includes:
[0024] S11. Initialize a generation matrix according to a preset maximum rank distance code.
[0025] Specifically, the generator matrix is a matrix used to encrypt stored data that needs to be encrypted and decrypted, and the generator matrix is constructed based on the maximum rank distance code.
[0026] In detail, Maximum Rank Distance Code (MRD) is a special type of coding used in the communication field to ensure that data can be accurately recovered and decoded even if it is interfered or erroneous during transmission.
[0027] In an embodiment of the present invention, a generator matrix is initialized according to a preset maximum rank distance code, including: extracting a codeword length and an information length from the preset maximum rank distance code; obtaining a finite field of the maximum rank distance code; screening a generator tuple set from the finite field according to the codeword length and the information length; and initializing a generator matrix according to the generator tuple set.
[0028] In detail, the codeword length refers to the total length of the encoded codeword, which is equal to the number of columns of the generator matrix, and the information length refers to the length of the stored data after being packed, which is equal to the number of rows of the generator matrix.
[0029] Specifically, the finite field refers to the number field of the element range of the maximum rank distance code, and the finite field includes a number of generators. The generators are linearly independent elements in the finite field and are used to construct elements of the generator matrix.
[0030] In detail, selecting a generator tuple set from a finite field according to a codeword length and an information length refers to selecting a codeword length generator tuple from a finite field, wherein the generator tuple is a combination of generators of successive powers of the information length.
[0031] Specifically, initially generating a matrix according to a generator set means taking each generator tuple in the generator set as a row vector of the matrix and concatenating them into a matrix, for example:
[0032]
[0033] in, is the generator matrix, is the first row in the generator matrix. Generators, is the codeword length, is the message length, is the first Line Generator.
[0034] In the embodiment of the present invention, by initializing the generator matrix according to the preset maximum rank distance code, it is possible to ensure that the generator matrix has a maximized error detection and correction capability, thereby improving the reliability of encryption quality.
[0035] S12. Packing the storage data according to the generation matrix to obtain a storage data packet.
[0036] Specifically, the stored data refers to data that needs to be encrypted and stored, and the stored data may be multimedia files such as videos, pictures, and codes that a user stores in a solid-state drive.
[0037] In an embodiment of the present invention, storage data is packaged according to a generation matrix to obtain a storage data packet, including: generating a storage information length according to the information length of the generation matrix; determining whether the data length of the storage data is an integer multiple of the storage information length; if not, performing a zero padding operation on the storage data according to the storage information length, and returning to the step of determining whether the data length of the storage data is an integer multiple of the storage information length; if so, splitting the storage data into data blocks of the storage information length, and packaging all the data blocks into a storage data packet.
[0038] Specifically, the storage information length is equal to the information length minus one, and the zero-filling operation refers to filling 0 at the end of the stored data.
[0039] In the embodiment of the present invention, by packing the stored data according to the generator matrix to obtain a stored data packet, the length of the encoded stored data can be made equal to the codeword length, thereby ensuring that the generator matrix has a maximized error detection and correction capability and improving the reliability of encryption quality.
[0040] S13. Use the preset encryption and decryption private key to perform data splicing on the stored data packets to obtain a standard data packet.
[0041] Specifically, the data length of the encryption and decryption private key is equal to the data length of each data block in the storage data packet. Data splicing refers to splicing the encryption and decryption private key after the last data block of the storage data packet, so that the total number of data blocks of the spliced standard data packet is equal to the information length.
[0042] S14. Encode the standard data packet according to the generation matrix to obtain encoded data.
[0043] In an embodiment of the present invention, a standard data packet is encoded according to a generation matrix to obtain encoded data, including: performing a vectorization operation on the standard data packet to obtain a data packet vector; performing a transposition operation on the data packet vector to obtain a transposed data packet vector; performing a matrix multiplication operation on the transposed data packet vector according to the generation matrix to obtain a transposed code; and performing a transposition operation on the transposed code to obtain encoded data.
[0044] Specifically, the data packet vector can be viewed as a row vector consisting of information length vector elements, and the transposed data packet vector is the column vector corresponding to the data packet vector.
[0045] In detail, the generator matrix is The matrix of the transposed packet vector is 1 column vector, the multiplication result encoding data is 1, for example, the data packet vector is:
[0046]
[0047] in, is the packet vector, is the vector element corresponding to the storage data packet, is the first vector elements, that is, the vector elements corresponding to the encryption and decryption private key, is the message length.
[0048] Specifically, the encoding process can be as follows:
[0049]
[0050] in, is the generator matrix, is the first row in the generator matrix. Generators, is the codeword length, is the message length, is the first Line Generators, is the packet vector, is the vector element corresponding to the storage data packet, is the first vector elements, that is, the vector elements corresponding to the encryption and decryption private key, is the message length, is a row vector of encoded data, is the first row vector of the encoded data. elements, is the codeword length, is the matrix multiplication symbol, is the transpose symbol.
[0051] In the embodiment of the present invention, by using a preset encryption and decryption private key to encode the stored data packet according to the generation matrix, the primary encryption of the stored data packet can be achieved through the encryption and decryption private key, and the secondary encryption can be achieved using the generation matrix, thereby reducing the probability of being cracked and improving the security of the encryption.
[0052] S15. Encrypt the coded data according to the standard data packet using the encryption and decryption private key to obtain encrypted storage data.
[0053] In detail, the encrypted storage data refers to the encrypted storage data, and generally, the solid state drive only stores the encrypted storage data.
[0054] In an embodiment of the present invention, the encoded data is encrypted according to the standard data packet using the encryption and decryption private key to obtain encrypted storage data, including: performing vectorization operation on the standard data packet to obtain a data packet vector; filtering out a check code from the encoded data according to the data packet vector; and filtering out the encrypted storage data from the check code according to the encryption and decryption private key.
[0055] In detail, filtering out the check code means using data after the data packet vector in the encoded data as the check code, wherein the encoded data is obtained by concatenating the data packet vector and the check code.
[0056] Specifically, filtering out the encrypted storage data includes extracting the data length of the encryption and decryption private key, deleting the data length of the encryption and decryption private key at the end of the check code, and obtaining the encrypted storage data.
[0057] In detail, for example, the encoded data is A row vector of 1:
[0058]
[0059] in, is a row vector of encoded data, is the first row vector of the encoded data. elements, is the codeword length;
[0060] The packet vector is A row vector of 1:
[0061]
[0062] in, is the packet vector, is the vector element corresponding to the storage data packet, is the first vector elements, that is, the vector elements corresponding to the encryption and decryption private key, is the message length;
[0063] but , ;
[0064] in, is the ordinal index, is the first row vector of the encoded data. elements, is the first elements;
[0065] Verification code:
[0066]
[0067] Then the encoded data is equal to the concatenation of the data packet vector and the check code:
[0068]
[0069] in, is a row vector of encoded data, is the packet vector, is the row vector of the check code; It is a character splicing symbol;
[0070] Encrypted storage data:
[0071]
[0072] in, is a row vector of encrypted storage data, is the first row vector in the encrypted storage data elements, is the first row vector in the encrypted storage data elements, is the row vector of the check code, is the first row vector of the check code elements, is the first row vector of the encoded data. elements, is the codeword length, is the message length, is the first row vector of the encoded data. elements, is the first row vector of the encoded data. elements.
[0073] In the embodiment of the present invention, by using the encryption and decryption private key to encrypt the encoded data according to the storage data packet, the storage amount of data can be reduced and the security of encryption can be enhanced.
[0074] Reference Figure 2 FIG. 1 is a flow chart of a method for decrypting data that resists quantum decryption provided by an embodiment of the present invention. In this embodiment, the method for decrypting data that resists quantum decryption includes:
[0075] S21. Calculate a check matrix according to a preset generator matrix.
[0076] Specifically, the check matrix is a matrix used to perform error correction on decrypted data during the decryption process, and the construction of the generator matrix and the check matrix is based on the maximum rank distance code.
[0077] In an embodiment of the present invention, a check matrix is calculated based on a preset generator matrix, including: solving a homogeneous linear equation system for the generator matrix to obtain a null space; simplifying the generator matrix using row operations to obtain a step-type generator matrix; screening out free variables from the step-type generator matrix; calculating a basis vector matrix of the null space based on the free variables, and using the transposed matrix of the basis vector matrix as a check matrix.
[0078] Specifically, solving a homogeneous linear equation system means calculating the vector space of all unknown vectors so that the product of each unknown vector and the generator matrix is 0. The generator matrix can be simplified by row operations (or row transformations) based on Gaussian elimination to convert the generator matrix into a simple form.
[0079] Specifically, a free variable refers to a column vector without a principal element in the echelon type generator matrix, a basis vector matrix is a matrix composed of solution vectors of the free variables, and the product of the transposed matrix of the check matrix and the generator matrix is 0.
[0080] In the embodiment of the present invention, by calculating the check matrix according to the preset generator matrix, it can be ensured that the product of the generator matrix and the transposed matrix of the check matrix is 0, so that the check during decryption is implemented using the maximum rank distance algorithm.
[0081] S22. Reconstruct the encrypted storage data acquired in advance using a preset encryption and decryption private key to obtain reconstructed storage data.
[0082] In detail, data reconstruction refers to splicing the encryption and decryption private key as a vector element to the end of the encrypted storage data to obtain the reconstructed storage data.
[0083] S23, decoding the reconstructed stored data according to the generator matrix and the check matrix to obtain a decoding codeword.
[0084] In an embodiment of the present invention, data decoding is performed on the reconstructed storage data according to the generator matrix and the check matrix to obtain a decoding codeword, including: multiplying the generator matrix by the check matrix to obtain a decoding matrix; determining whether the decoding matrix is reversible; if so, decoding the reconstructed storage data using the inverse matrix of the decoding matrix to obtain a decoding codeword; if not, decoding the reconstructed storage data using the pseudo-inverse matrix of the decoding matrix to obtain a decoding codeword. Specifically, decoding the reconstructed storage matrix using the inverse matrix of the decoding matrix to obtain a decoding codeword means multiplying the reconstructed storage data by the inverse matrix to obtain a decoding vector, and using the transposed matrix of the decoding vector as the decoding codeword.
[0085] In detail, using the pseudo-inverse matrix of the decoding matrix to decode the reconstructed stored data to obtain a decoding codeword means multiplying the reconstructed stored data by the pseudo-inverse matrix to obtain a decoding vector, and using the transposed matrix of the decoding vector as the decoding codeword, wherein the pseudo-inverse matrix can be calculated using the least squares method.
[0086] Specifically, since the check code is equal to the product of the check matrix and the transpose of the data packet vector, that is:
[0087]
[0088] in, is the check matrix, is the packet vector, is the row vector of the check code, is the transpose symbol, It is a matrix multiplication symbol, so the inverse matrix or pseudo-inverse matrix of the decoding matrix can be used for decoding, that is:
[0089]
[0090] or:
[0091]
[0092] in, is the check matrix, is the generator matrix, is the decoding matrix, is the inverse matrix of the decoding matrix, is the pseudo-inverse matrix of the decoding matrix, is the decoded codeword, is to rebuild the stored data, is the matrix multiplication symbol.
[0093] In an embodiment of the present invention, by using a preset encryption and decryption private key to decode the pre-acquired encrypted storage data according to a check matrix, the encryption and decryption private key can be used to complete the encrypted storage data to obtain reconstructed storage data close to the check code, thereby achieving decryption.
[0094] S24, performing data error correction on the decoded codeword by using the generation matrix and reconstructing the stored data to obtain a stored data packet.
[0095] In an embodiment of the present invention, a decoded codeword is corrected for data errors using a generator matrix and reconstructed stored data to obtain a stored data packet, including: filtering out a decoded data packet from a decoded codeword using the reconstructed stored data; calculating an error correction matrix based on the generator matrix; multiplying the error correction matrix by a transposed matrix of the decoded codeword to obtain an error correction codeword; and correcting the decoded data packet using the error correction codeword to obtain a stored data packet.
[0096] In detail, filtering out the decoded data packets means taking the data in the decoded codeword except the reconstructed stored data as the decoded data packets. The error correction matrix is the inverse matrix or pseudo-inverse matrix of the generator matrix, and can be calculated as the inverse matrix using the least squares method.
[0097] Specifically, because , from this we can know ;
[0098] in, is the generator matrix, is the inverse or pseudo-inverse of the generator matrix, is the packet vector, is a row vector of encoded data, is the matrix multiplication symbol, is the transpose symbol, is the error correction codeword, is the decoding codeword.
[0099] Specifically, using the error correction codeword to correct the decoded data packet refers to updating the part of the decoded data packet that is different from the error correction codeword to the same part.
[0100] In the embodiment of the present invention, by using a generator matrix to perform data error correction on a decoded codeword, the error correction capability of the maximum rank distance code can be used to improve the accuracy of decryption and the security of data encryption and decryption.
[0101] S25, unpacking the stored data packet to obtain stored data.
[0102] In detail, unpacking the storage data refers to splicing the storage data packets into primary storage data, deleting the zero padding at the end of the primary storage data, and obtaining the storage data.
[0103] like Figure 3 , which is a functional module diagram of a data encryption device resistant to quantum decryption provided by one embodiment of the present invention.
[0104] The data encryption device 300 of the present invention that resists quantum decryption can be installed in an electronic device. According to the functions to be implemented, the data encryption device 300 of the present invention that resists quantum decryption can include a matrix creation module 301, a data packaging module 302, a key splicing module 303, a data encoding module 304 and a private key encryption module 305. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0105] In this embodiment, the functions of each module / unit are as follows:
[0106] A matrix creation module 301 is used to initialize a generation matrix according to a preset maximum rank distance code;
[0107] The data packaging module 302 is used to package the storage data according to the generation matrix to obtain a storage data packet;
[0108] The key splicing module 303 is used to splice the stored data packets using the preset encryption and decryption private key to obtain a standard data packet;
[0109] The data encoding module 304 is used to encode the standard data packet according to the generation matrix to obtain encoded data;
[0110] The private key encryption module 305 is used to encrypt the coded data according to the standard data packet using the encryption and decryption private key to obtain encrypted storage data.
[0111] In detail, each module in the quantum-resistant data encryption device 300 in the embodiment of the present invention adopts the same method as above when in use. Figure 1 The technical means are the same as the anti-quantum decryption data encryption method in, and can produce the same technical effects, so I will not go into details here.
[0112] like Figure 4, which is a functional module diagram of a data decryption device resistant to quantum decryption provided by one embodiment of the present invention.
[0113] The data decryption device 400 of the present invention can be installed in an electronic device. According to the functions to be implemented, the data decryption device 400 of the present invention can include a matrix creation module 401, a data reconstruction module 402, a data decoding module 403, a data error correction module 404 and a data unpacking module 405. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, which are stored in the memory of the electronic device.
[0114] In this embodiment, the functions of each module / unit are as follows:
[0115] The matrix creation module 401 is used to calculate the check matrix according to the preset generation matrix;
[0116] The data reconstruction module 402 is used to reconstruct the encrypted storage data acquired in advance by using the preset encryption and decryption private key to obtain the reconstructed storage data;
[0117] The data decoding module 403 is used to decode the reconstructed stored data according to the generator matrix and the check matrix to obtain a decoding codeword;
[0118] A data error correction module 404 is used to perform data error correction on the decoded codeword by using the generation matrix and the reconstructed storage data to obtain a storage data packet;
[0119] The data unpacking module 405 is used to unpack the stored data packet to obtain the stored data.
[0120] In detail, each module in the quantum-resistant data decryption device 400 in the embodiment of the present invention is used in the same manner as described above. Figure 2 The technical means are the same as the anti-quantum decryption data decryption method in, and can produce the same technical effects, so I will not go into details here.
[0121] like Figure 5 , which is a schematic diagram of the structure of an electronic device for implementing a data encryption method and a decryption method resistant to quantum decryption provided by an embodiment of the present invention.
[0122] The electronic device 501 may include a processor 510, a memory 511, a communication bus 512, and a communication interface 513, and may also include a computer program stored in the memory 511 and executable on the processor 510, such as a data encryption and decryption program that is resistant to quantum decryption.
[0123] In some embodiments, the processor 510 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 510 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing programs or modules stored in the memory 511 (for example, executing data encryption and decryption programs that resist quantum decryption, etc.), and calling data stored in the memory 511.
[0124] The memory 511 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 511 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 511 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 511 may also include both an internal storage unit of the electronic device and an external storage device. The memory 511 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the data encryption and decryption program for anti-quantum decryption, but also can be used to temporarily store data that has been output or is to be output.
[0125] The communication bus 512 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 511 and at least one processor 510, etc.
[0126] The communication interface 513 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0127] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0128] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to at least one processor 510 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0129] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited by this structure.
[0130] Specifically, the specific implementation method of the processor 510 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0131] Furthermore, if the module / unit integrated in the electronic device 501 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0132] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0133] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A data encryption method resistant to quantum decryption, characterized in that: The method comprises: Initialize the generator matrix according to the preset maximum rank distance code; Packing the storage data according to the generation matrix to obtain a storage data packet; Using a preset encryption and decryption private key to perform data splicing on the stored data packets to obtain a standard data packet; Encoding the standard data packet according to the generation matrix to obtain encoded data; Encrypting the encoded data according to the standard data packet using the encryption and decryption private key to obtain encrypted storage data; The encoding of the standard data packet according to the generator matrix to obtain the encoded data includes: performing a vectorization operation on the standard data packet to obtain a data packet vector; performing a transposition operation on the data packet vector to obtain a transposed data packet vector; performing a matrix multiplication operation on the transposed data packet vector according to the generator matrix to obtain a transposed code; performing a transposition operation on the transposed code to obtain the encoded data; The method of using the encryption and decryption private key to encrypt the encoded data according to the standard data packet to obtain encrypted storage data includes: performing a vectorization operation on the standard data packet to obtain a data packet vector; filtering out a check code from the encoded data according to the data packet vector; and filtering out the encrypted storage data from the check code according to the encryption and decryption private key.
2. The data encryption method against quantum decryption as claimed in claim 1, characterized in that: The step of packing the stored data according to the generation matrix to obtain a stored data packet includes: Generate storage information length according to the information length of the generator matrix; Determining whether the data length of the stored data is an integer multiple of the length of the stored information; If not, performing a zero padding operation on the stored data according to the length of the stored information, and returning to the step of determining whether the data length of the stored data is an integer multiple of the length of the stored information; If so, the stored data is split into data blocks of the storage information length, and all the data blocks are packaged into a storage data packet.
3. A data decryption method resistant to quantum decryption, characterized in that: The method comprises: Calculate the check matrix according to the preset generator matrix; Reconstruct the encrypted storage data acquired in advance using the preset encryption and decryption private key to obtain the reconstructed storage data; wherein data reconstruction refers to splicing the encryption and decryption private key as a vector element to the end of the encrypted storage data; Decoding the reconstructed stored data according to the generator matrix and the check matrix to obtain a decoding codeword; Performing data error correction on the decoded codeword using the generator matrix and the reconstructed storage data to obtain a storage data packet; Unpacking the stored data packet to obtain stored data; The method of decoding the reconstructed stored data according to the generator matrix and the check matrix to obtain a decoded codeword includes: multiplying the generator matrix by the check matrix to obtain a decoding matrix; judging whether the decoding matrix is reversible; if so, decoding the reconstructed stored data using the inverse matrix of the decoding matrix to obtain a decoded codeword; if not, decoding the reconstructed stored data using the pseudo-inverse matrix of the decoding matrix to obtain a decoded codeword.
4. The data decryption method against quantum decryption as claimed in claim 3, characterized in that: The step of calculating a check matrix according to a preset generator matrix includes: Solving a homogeneous linear equation system for the generator matrix to obtain a null space; Simplifying the generator matrix by row operation to obtain a ladder-type generator matrix; Screening out free variables from the step-type generation matrix; A basis vector matrix of the null space is calculated according to the free variables, and a transposed matrix of the basis vector matrix is used as a check matrix.
5. The data decryption method against quantum decryption as claimed in claim 3, characterized in that: The step of performing data error correction on the decoded codeword by using the generator matrix and the reconstructed stored data to obtain a stored data packet includes: Filtering out decoded data packets from the decoded codewords using the reconstructed stored data; Calculate an error correction matrix according to the generator matrix; Multiplying the error correction matrix by the transposed matrix of the decoding codeword to obtain an error correction codeword; The decoded data packet is corrected by using the error correction codeword to obtain a storage data packet.
6. A data encryption device resistant to quantum decryption, characterized in that: The device comprises: A matrix creation module, used for initializing a generation matrix according to a preset maximum rank distance code; A data packaging module, used for packaging the stored data according to the generation matrix to obtain a storage data packet; A key splicing module, used to perform data splicing on the stored data packets using a preset encryption and decryption private key to obtain a standard data packet; A data encoding module, configured to perform a vectorization operation on the standard data packet to obtain a data packet vector; perform a transposition operation on the data packet vector to obtain a transposed data packet vector; perform a matrix multiplication operation on the transposed data packet vector according to the generation matrix to obtain a transposed code; and perform a transposition operation on the transposed code to obtain encoded data; The private key encryption module is used to perform vectorization operation on the standard data packet to obtain a data packet vector; filter out a check code from the encoded data according to the data packet vector; and filter out encrypted storage data from the check code according to the encryption and decryption private key.
7. A data decryption device resistant to quantum decryption, characterized in that: The device comprises: A matrix creation module is used to calculate a check matrix based on a preset generation matrix; A data reconstruction module is used to reconstruct the encrypted storage data acquired in advance using a preset encryption and decryption private key to obtain reconstructed storage data; wherein data reconstruction refers to splicing the encryption and decryption private key as a vector element to the end of the encrypted storage data; A data decoding module, configured to multiply the check matrix by the generator matrix to obtain a decoding matrix; determine whether the decoding matrix is reversible; if so, decode the reconstructed stored data using the inverse matrix of the decoding matrix to obtain a decoding codeword; if not, decode the reconstructed stored data using the pseudo-inverse matrix of the decoding matrix to obtain a decoding codeword; A data error correction module, used to perform data error correction on the decoded codeword using the generator matrix and the reconstructed storage data to obtain a storage data packet; The data unpacking module is used to unpack the stored data packet to obtain stored data.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can implement the quantum-resistant data encryption method as described in claim 1 or 2 and the quantum-resistant data decryption method as described in any one of claims 3 to 5.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data encryption method resistant to quantum decryption as described in claim 1 or 2 and the data decryption method resistant to quantum decryption as described in any one of claims 3 to 5 are implemented.