[go: up one dir, main page]

CN118940300B - Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media - Google Patents

Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media Download PDF

Info

Publication number
CN118940300B
CN118940300B CN202411408903.3A CN202411408903A CN118940300B CN 118940300 B CN118940300 B CN 118940300B CN 202411408903 A CN202411408903 A CN 202411408903A CN 118940300 B CN118940300 B CN 118940300B
Authority
CN
China
Prior art keywords
data
matrix
decryption
data packet
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411408903.3A
Other languages
Chinese (zh)
Other versions
CN118940300A (en
Inventor
楚一兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Storlead Technology Co ltd
Original Assignee
Shenzhen Storlead Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Storlead Technology Co ltd filed Critical Shenzhen Storlead Technology Co ltd
Priority to CN202411408903.3A priority Critical patent/CN118940300B/en
Publication of CN118940300A publication Critical patent/CN118940300A/en
Application granted granted Critical
Publication of CN118940300B publication Critical patent/CN118940300B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Mathematical Physics (AREA)
  • Electromagnetism (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Storage Device Security (AREA)

Abstract

本发明涉及数据加密技术领域,揭露了一种抗量子解密的数据加密方法、解密方法及相关装置、电子设备、介质,该方法包括:预设的最大秩距离码初始化生成矩阵以及校验矩阵;利用所述生成矩阵、所述校验矩阵以及预设的加解密私钥对存储数据进行加密存储,得到加密存储数据;根据所述加解密私钥以及所述加密存储数据生成存储校验码,利用所述校验矩阵对所述存储校验码进行解码,得到解码码字;利用所述生成矩阵对所述解码码字进行数据纠错,得到解密存储数据。通过本发明实施中校验矩阵的加密,可以有效实现原始数据集的隐私保护,并可以通过生成矩阵实现对解密数据的校正,提高数据加密存储的安全性。

The present invention relates to the field of data encryption technology, and discloses a data encryption method, decryption method and related devices, electronic equipment and media that are resistant to quantum decryption. The method includes: initializing a generator matrix and a check matrix using a preset maximum rank distance code; encrypting and storing stored data using the generator matrix, the check matrix and a preset encryption and decryption private key to obtain encrypted stored data; generating a storage check code according to the encryption and decryption private key and the encrypted stored data, decoding the storage check code using the check matrix to obtain a decoded codeword; performing data error correction on the decoded codeword using the generator matrix to obtain decrypted stored data. Through the encryption of the check matrix in the implementation of the present invention, the privacy protection of the original data set can be effectively realized, and the correction of the decrypted data can be realized through the generator matrix, thereby improving the security of data encryption storage.

Description

Quantum decryption resistant data encryption method, decryption method, related device, electronic equipment and medium
Technical Field
The present invention relates to the field of data encryption technologies, and in particular, to a data encryption method and a data decryption method for quantum decryption, and related devices, electronic apparatuses, and media.
Background
With the development of social informatization, more and more people begin to pay attention to data security, in order to ensure data security and prevent data from being leaked, data storage devices such as solid state disks generally encrypt written data, and decrypt the data when users read the data.
The traditional encryption and decryption methods for stored data are generally based on traditional encryption means such as AES, guojin, jungmi and the like to encrypt and decrypt the stored data, and the encryption means are mainly based on mathematical problems such as large integer decomposition, discrete logarithm, one-way function and the like, and because the mathematical problems are solved and often exceed the calculation capacity of the existing computer, a better encryption effect can be achieved, but the traditional encryption means become very fragile along with the appearance of a quantum computer, and particularly the Shor algorithm and Grove algorithm of the quantum computer can cause great threat to the existing encryption means, so that the problem of lower security in the process of encrypting and storing the data can be caused.
Disclosure of Invention
The invention provides a data encryption method and a data decryption method for quantum decryption, a related device, electronic equipment and a medium, and mainly aims to solve the problem of low security when data are encrypted and stored in the related technology.
The data encryption method capable of resisting quantum decryption comprises the steps of initializing a generating matrix according to a preset maximum rank distance code, packaging storage data according to the generating matrix to obtain a storage data packet, performing data splicing on the storage data packet by using a preset encryption and decryption private key to obtain a standard data packet, encoding the standard data packet according to the generating matrix to obtain encoded data, and encrypting the encoded data according to the standard data packet by using an encryption and decryption private key to obtain encrypted storage data.
The data decryption method for resisting quantum decryption comprises the steps of calculating a check matrix according to a preset generation matrix, carrying out data reconstruction on encrypted storage data obtained in advance by using a preset encryption and decryption private key to obtain reconstructed storage data, carrying out data decoding on the reconstructed storage data according to the generation matrix and the check matrix to obtain decoding code words, carrying out data error correction on the decoding code words by using the generation matrix and the reconstructed storage data to obtain a storage data packet, and carrying out unpacking on the storage data packet to obtain the storage data.
In order to solve the problems, the invention further provides a data encryption device for quantum decryption resistance, which comprises a matrix creation module, a data packing module, a key splicing module, a data encoding module and a private key encryption module, wherein the matrix creation module is used for initializing a generating matrix according to a preset maximum rank distance code, the data packing module is used for packing storage data according to the generating matrix to obtain a storage data packet, the key splicing module is used for carrying out data splicing on the storage data packet by using a preset encryption and decryption private key to obtain a standard data packet, the data encoding module is used for encoding the standard data packet according to the generating matrix to obtain encoded data, and the private key encryption module is used for encrypting the encoded data according to the standard data packet by using the encryption and decryption private key to obtain encrypted storage data.
In order to solve the problems, the invention further provides a data encryption device for quantum decryption resistance, which comprises a matrix creation module, a data reconstruction module, a data decoding module, a data error correction module and a data unpacking module, wherein the matrix creation module is used for calculating a check matrix according to a preset generation matrix, the data reconstruction module is used for carrying out data reconstruction on encrypted storage data acquired in advance by utilizing a preset encryption and decryption private key to obtain reconstructed storage data, the data decoding module is used for carrying out data decoding on the reconstructed storage data according to the generation matrix and the check matrix to obtain decoding code words, the data error correction module is used for carrying out data error correction on the decoding code words by utilizing the generation matrix and the reconstructed storage data to obtain a storage data packet, and the data unpacking module is used for unpacking the storage data packet to obtain the storage data.
In order to solve the above problems, the present invention also provides an electronic device including:
At least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to implement the quantum decryption resistant data encryption method and decryption method described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-mentioned data encryption method and decryption method against quantum decryption.
According to the embodiment of the invention, the generating matrix is initialized according to the preset maximum rank distance code, the generating matrix can be ensured to have maximized error detection and correction capability, so that the reliability of encryption quality is improved, the stored data is packed according to the generating matrix to obtain the stored data packet, the length of the coded stored data is enabled to be equal to the codeword length, the generating matrix can be ensured to have maximized error detection and correction capability, the reliability of encryption quality is improved, the stored data packet is encoded according to the generating matrix by utilizing the preset encryption and decryption private key, primary encryption of the stored data packet can be realized through the encryption and decryption private key, secondary encryption is realized by utilizing the generating matrix, the probability of being cracked is reduced, the safety of encryption is improved, the coded data is encrypted according to the stored data packet by utilizing the encryption and decryption private key, the safety of encryption is enhanced, the product of the generated and the transposed matrix of the verification matrix can be ensured to be 0 according to the preset generating matrix, the maximum rank is realized by utilizing the verification matrix, the encryption and decryption of the preset encryption and decryption private key is utilized to obtain the verification matrix, the encryption and decryption of the stored data is enabled to be aligned with the verification matrix, and the stored data is encrypted and decrypted, and the storage is encrypted. Therefore, the quantum decryption resistant data encryption method, the quantum decryption resistant data encryption device, the quantum decryption resistant data decryption device, the quantum decryption resistant data encryption device and the quantum decryption resistant data encryption medium can solve the problem that the security is low when data are encrypted and stored.
Drawings
Fig. 1 is a flow chart of a data encryption method for quantum decryption according to an embodiment of the invention;
fig. 2 is a flow chart of a data decryption method for quantum decryption according to an embodiment of the invention;
FIG. 3 is a functional block diagram of a data encryption device with quantum decryption resistance according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a data decryption device with quantum decryption resistance according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an electronic device for implementing a data encryption method and a decryption method for quantum decryption according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a data encryption method and a data decryption method for quantum decryption resistance. The execution subject of the quantum decryption resistant data encryption method and decryption method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the data encryption method and the decryption method against quantum decryption may be performed by software or hardware installed in the terminal device or the server device. The server side comprises, but is not limited to, a single server, a server cluster, a cloud server or a cloud server cluster and the like. The server may be an independent server, or may be a cloud server that provides 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 basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a data encryption method for quantum decryption according to an embodiment of the invention is shown. In this embodiment, the data encryption method for quantum decryption includes:
S11, initializing a generating matrix according to a preset maximum rank distance code.
Specifically, the generator matrix is a matrix for encrypting the stored data that needs to be encrypted and decrypted, and the generator matrix is configured based on the maximum rank distance code.
In detail, a Maximum rank 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 being interfered or in error during transmission.
The method comprises the steps of extracting a code word length and an information length from a preset maximum rank distance code, obtaining a finite field of the maximum rank distance code, screening a generating element set from the finite field according to the code word length and the information length, and initializing the generating matrix according to the generating element set.
In detail, the codeword length refers to the total length of the encoded codeword, the codeword length is equal to the number of columns of the generator matrix, the information length refers to the length of the packed storage data, and the information length is equal to the number of rows of the generator matrix.
Specifically, the finite field refers to a number field of an element range of the maximum rank distance code, the finite field includes a plurality of generating elements, and the generating elements are linear independent elements in the finite field and are used for constructing elements of a generating matrix.
In detail, the filtering the generating tuple set from the finite field according to the codeword length and the information length refers to filtering generating tuples with codeword lengths from the finite field, wherein the generating tuples are combinations of generating tuples with information lengths which are successive powers.
Specifically, the initial generation of the matrix according to the generated tuple set refers to that each generated tuple in the generated tuple set is taken as a row vector of the matrix, and is spliced into the matrix, for example:
Wherein, It is meant that a matrix is generated and,Is the first row in the generator matrixThe number of the generation elements is set,Is the length of the code word,Is the length of the information which is to be transmitted,Is the first in the generator matrixLine 1And generating the elements.
In the embodiment of the invention, the generating matrix is initialized according to the preset maximum rank distance code, so that the generating matrix can be ensured to have maximized error detection and correction capability, and the reliability of encryption quality is improved.
And S12, packaging the stored data according to the generation matrix to obtain a stored data packet.
In detail, the storage data refers to data to be stored in an encrypted manner, and the storage data can be multimedia files such as videos, pictures and codes stored in the solid state disk by a user.
The embodiment of the invention packages the storage data according to the generation matrix to obtain a storage data packet, and comprises the steps of generating the storage information length according to the information length of the generation matrix, judging whether the data length of the storage data is integral multiple of the storage information length, if not, carrying out zero padding operation on the storage data according to the storage information length, returning to the step of judging whether the data length of the storage data is integral multiple of the storage information length, if so, splitting the storage data into a plurality of data blocks with the storage information length, and packaging all the data blocks into the storage data packet.
Specifically, the stored information length is equal to the information length minus one, and the zero padding operation refers to padding 0 at the end of the stored data.
In the embodiment of the invention, the storage data is packed according to the generation matrix to obtain the storage data packet, so that the length of the encoded storage data is equal to the length of the code word, thereby ensuring that the generation matrix has maximized error detection and correction capability and improving the reliability of encryption quality.
And S13, performing data splicing on the stored data packet by using a preset encryption and decryption private key to obtain a standard data packet.
In detail, 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. The 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 the data blocks of the standard data packet after splicing is equal to the information length.
S14, encoding the standard data packet according to the generation matrix to obtain encoded data.
The embodiment of the invention encodes a standard data packet according to a generating matrix to obtain encoded data, and comprises the steps of vectorizing the standard data packet to obtain a data packet vector, transposing the data packet vector to obtain a transposed data packet vector, carrying out matrix multiplication operation on the transposed data packet vector according to the generating matrix to obtain transposed encoding, and carrying out transposition operation on the transposed encoding to obtain encoded data.
Specifically, the packet vector may be regarded as a row vector composed of information length vector elements, and the transposed packet vector is a column vector corresponding to the packet vector.
In detail, the generator matrix isTranspose the packet vector to be1, The resulting multiplication result encoded data isThe row vector of 1, e.g., packet vector, is:
Wherein, Is a vector of the data packets and,Is the vector element corresponding to the corresponding stored data packet,Is the first in the packet vectorThe vector elements corresponding to the encryption and decryption private key,Is the information length.
Specifically, the encoding process may be the following formula:
Wherein, It is meant that a matrix is generated and,Is the first row in the generator matrixThe number of the generation elements is set,Is the length of the code word,Is the length of the information which is to be transmitted,Is the first in the generator matrixLine 1The number of the generation elements is set,Is a vector of the data packets and,Is the vector element corresponding to the corresponding stored data packet,Is the first in the packet vectorThe vector elements corresponding to the encryption and decryption private key,Is the length of the information which is to be transmitted,Is a row vector of the encoded data,Is the first in the row vector of the encoded dataThe number of elements to be added to the composition,Is the length of the code word,Is a matrix multiplication symbol which,Is the transposed symbol.
In the embodiment of the invention, the stored data packet is encoded according to the generation matrix by utilizing the preset encryption and decryption private key, the primary encryption of the stored data packet can be realized by utilizing the encryption and decryption private key, the secondary encryption is realized by utilizing the generation matrix, the probability of being cracked is reduced, and the encryption security is improved.
S15, encrypting the coded data according to the standard data packet by using the encryption and decryption private key to obtain encrypted storage data.
In detail, the encrypted storage data refers to the encrypted storage data, and in general, the solid state disk only stores the encrypted storage data.
The embodiment of the invention encrypts the coded data according to the standard data packet by using the encryption and decryption private key to obtain the encrypted storage data, and comprises the steps of vectorizing the standard data packet to obtain a data packet vector, screening the check code from the coded data according to the data packet vector, and screening the encrypted storage data from the check code according to the encryption and decryption private key.
In detail, screening the check code refers to taking the data after the data packet vector in the encoded data as the check code, wherein the encoded data is obtained by splicing the data packet vector and the check code.
Specifically, screening the encrypted storage data includes extracting the data length of the encryption and decryption private key, and deleting the data length data of the encryption and decryption private key at the tail part of the check code to obtain the encrypted storage data.
In detail, for example, the encoded data isRow vector of 1:
Wherein, Is a row vector of the encoded data,Is the first in the row vector of the encoded dataThe number of elements to be added to the composition,Is the codeword length;
the packet vector is Row vector of 1:
Wherein, Is a vector of the data packets and,Is the vector element corresponding to the corresponding stored data packet,Is the first in the packet vectorThe vector elements corresponding to the encryption and decryption private key,Is the information length;
Then ,;
Wherein, Is the index of the sequence number,Is the first in the row vector of the encoded dataThe number of elements to be added to the composition,Is the first in the packet vectorAn element;
Check code:
the encoded data is equal to the concatenation of the packet vector and the check code:
Wherein, Is a row vector of the encoded data,Is a vector of the data packets and,Is a row vector of the check code; Is a character splice symbol;
Encrypting the stored data:
Wherein, Is a row vector that encrypts the stored data,Is the first in the row vector to encrypt the stored dataThe number of elements to be added to the composition,Is the first in the row vector to encrypt the stored dataThe number of elements to be added to the composition,Is the row vector of the check code,Is the first in the row vector of the check codeThe number of elements to be added to the composition,Is the first in the row vector of the encoded dataThe number of elements to be added to the composition,Is the length of the code word,Is the length of the information which is to be transmitted,Is the first in the row vector of the encoded dataThe number of elements to be added to the composition,Is the first in the row vector of the encoded dataThe elements.
In the embodiment of the invention, the encryption and decryption private key is utilized to encrypt the coded data according to the stored data packet, so that the storage amount of the data can be reduced, and the encryption security is enhanced.
Fig. 2 is a schematic flow chart of a data decryption method for quantum decryption according to an embodiment of the invention. In this embodiment, the data decryption method for quantum decryption includes:
s21, calculating a check matrix according to a preset generation matrix.
Specifically, the check matrix is a matrix for performing error correction on decrypted data in the decryption process, and the formation of the generation matrix and the check matrix is based on a maximum rank distance code.
The embodiment of the invention calculates a check matrix according to a preset generation matrix, and comprises the steps of solving a homogeneous linear equation set of the generation matrix to obtain a zero space, simplifying the generation matrix by utilizing line operation to obtain a ladder type generation matrix, screening free variables from the ladder type generation matrix, calculating a base vector matrix of the zero space according to the free variables, and taking a transposed matrix of the base vector matrix as the check matrix.
Specifically, the homogeneous linear equation system solution refers to calculating a vector space of all unknown vectors so that the product of each unknown vector and the generator matrix is 0, and the generator matrix can be simplified by using a line operation (or line transformation) based on a gaussian elimination method, so that the generator matrix is converted into a simple form.
In detail, the free variable is a column vector without principal element in the ladder generator matrix, the base vector matrix is a matrix composed of solution vectors of the free variable, and the product of the check matrix and the transpose matrix of the generator matrix is 0.
In the embodiment of the invention, the check matrix is calculated according to the preset generation matrix, so that the product of the generation matrix and the transposed matrix of the check matrix is ensured to be 0, and the check during decryption is realized by using the algorithm of the maximum rank distance.
S22, carrying out data reconstruction on the pre-acquired encrypted storage data by using a preset encryption and decryption private key to obtain reconstructed storage data.
In detail, the 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.
S23, performing data decoding on the reconstructed storage data according to the generation matrix and the check matrix to obtain a decoded codeword.
The embodiment of the invention performs data decoding on the reconstructed storage data according to the generating matrix and the check matrix to obtain a decoded codeword, and comprises the steps of multiplying the generating matrix by the check matrix to obtain a decoded matrix, judging whether the decoded matrix is reversible, decoding the reconstructed storage data by using an inverse matrix of the decoded matrix to obtain the decoded codeword if the decoded matrix is reversible, and decoding the reconstructed storage data by using a pseudo-inverse matrix of the decoded matrix if the decoded matrix is not reversible to obtain the decoded codeword. Specifically, decoding the reconstructed storage matrix by using the inverse matrix of the decoding matrix to obtain a decoding codeword, that is, 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.
In detail, decoding the reconstructed storage data using the pseudo-inverse of the decoding matrix to obtain a decoded codeword, that is, multiplying the reconstructed storage data by the pseudo-inverse to obtain a decoded vector, and using the transposed matrix of the decoded vector as the decoded codeword, wherein the pseudo-inverse can be calculated using the least square method.
Specifically, because the check code is equal to the product of the check matrix and the transpose of the packet vector, namely:
Wherein, Is a check matrix of the type that,Is a vector of the data packets and,Is the row vector of the check code,Is the transposed symbol of the symbol,Is a matrix multiplication symbol, so the decoding can be performed using the inverse or pseudo-inverse of the decoding matrix, i.e.:
Or:
Wherein, Is a check matrix of the type that,Is a generation matrix of the matrix,Is a decoding matrix that is used to decode the data,Is the inverse of the decoding matrix,Is the pseudo-inverse of the decoding matrix,It is the decoding of the codeword,It is the reconstruction of the stored data that,Is a matrix multiplication symbol.
In the embodiment of the invention, the pre-acquired encrypted storage data is subjected to data decoding according to the check matrix by utilizing the preset encryption and decryption private key, so that the encrypted storage data can be supplemented by utilizing the encryption and decryption private key to obtain the reconstructed storage data similar to the check code, and decryption is realized.
S24, performing data error correction on the decoded code word by using the generation matrix and the reconstructed storage data to obtain a storage data packet.
The embodiment of the invention uses the generation matrix and the reconstructed storage data to carry out data error correction on the decoding code word to obtain a storage data packet, and comprises the steps of screening the decoding data packet from the decoding code word by using the reconstructed storage data, calculating an error correction matrix according to the generation matrix, multiplying the error correction matrix by a transpose matrix of the decoding code word to obtain an error correction code word, and carrying out error correction on the decoding data packet by using the error correction code word to obtain the storage data packet.
In detail, the filtering out the decoded data packet refers to using data other than the reconstructed stored data in the decoded codeword as the decoded data packet, and the error correction matrix is an inverse matrix or pseudo-inverse matrix of the generator matrix, which can be calculated as an inverse matrix by the least square method.
In particular, becauseFrom this, it can be seen that;
Wherein, It is meant that a matrix is generated and,Is the inverse or pseudo-inverse of the generator matrix,Is a vector of the data packets and,Is a row vector of the encoded data,Is a matrix multiplication symbol which,Is the transposed symbol of the symbol,Is an error correction codeword and,Is the decoded codeword.
Specifically, error correction of a decoded data packet using an error correction codeword means that a portion of the decoded data packet that is not identical to the error correction codeword is updated to the same portion.
In the embodiment of the invention, the error correction capability of the maximum rank distance code can be utilized to improve the accuracy of decryption and the safety of data encryption and decryption by utilizing the generation matrix to carry out data error correction on the decoded code word.
S25, unpacking the storage data packet to obtain storage data.
In detail, unpacking the storage data refers to splicing the storage data packets into primary storage data, and deleting zero padding bits at the tail of the primary storage data to obtain the storage data.
Fig. 3 is a functional block diagram of a data encryption device with quantum decryption resistance according to an embodiment of the present invention.
The quantum decryption resistant data encryption device 300 of the present invention may be installed in an electronic apparatus. Depending on the functions implemented, the quantum decryption resistant data encryption device 300 may include a matrix creation module 301, a data packaging module 302, a key concatenation module 303, a data encoding module 304, and a private key encryption module 305. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the matrix creation module 301 is configured to initialize a generated matrix according to a preset maximum rank distance code;
the data packaging module 302 is configured to package the storage data according to the generation matrix to obtain a storage data packet;
the key splicing module 303 is configured to perform data splicing on the stored data packet by using a preset encryption and decryption private key to obtain a standard data packet;
the data encoding module 304 is configured to encode the standard data packet according to the generation matrix to obtain encoded data;
The private key encryption module 305 is configured to encrypt the encoded data according to the standard data packet by using the encryption and decryption private key, so as to obtain encrypted storage data.
In detail, each module in the quantum decryption resistant data encryption device 300 in the embodiment of the present invention adopts the same technical means as the quantum decryption resistant data encryption method in fig. 1, and can produce the same technical effects, which are not described herein.
Fig. 4 is a functional block diagram of a quantum decryption resistant data decryption device according to an embodiment of the present invention.
The quantum decryption resistant data decryption device 400 of the present invention may be installed in an electronic apparatus. Depending on the functions implemented, the quantum decryption resistant data decryption device 400 may 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 invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
A matrix creation module 401, configured to calculate a check matrix according to a preset generation matrix;
The data reconstruction module 402 is configured to perform data reconstruction on the encrypted storage data acquired in advance by using a preset encryption and decryption private key, so as to obtain reconstructed storage data;
a data decoding module 403, configured to perform data decoding on the reconstructed storage data according to the generating matrix and the check matrix to obtain a decoded codeword;
A data error correction module 404, configured to perform data error correction on the decoded codeword by using the generator matrix and the reconstructed stored data, to obtain a stored data packet;
The data unpacking module 405 is configured to unpack the storage data packet to obtain storage data.
In detail, each module in the anti-quantum decryption device 400 in the embodiment of the present invention adopts the same technical means as the anti-quantum decryption data decryption method in fig. 2, and can produce the same technical effects, which are not described herein.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a data encryption method and a decryption method for quantum decryption according to an embodiment of the present invention.
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 computer programs stored in the memory 511 and executable on the processor 510, such as data encryption and decryption programs that resist quantum decryption.
The processor 510 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), a microprocessor, a digital processing chip, a combination of a graphics processor and various control chips, etc. The processor 510 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules stored in the memory 511 (e.g., performing data encryption and decryption programs against quantum decryption, etc.), and calling data stored in the memory 511.
The memory 511 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 511 may be an internal storage element of the electronic device in some embodiments, such as a removable hard disk of the electronic device. The memory 511 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), etc. that are provided on the electronic device. Further, the memory 511 may also include both internal storage elements of the electronic device and external storage devices. The memory 511 can be used not only for storing application software installed in an electronic device and various types of data, such as codes of data encryption and decryption programs against quantum decryption, but also for temporarily storing data that has been output or is to be output.
The communication bus 512 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable connected communication between the memory 511 and the at least one processor 510 or the like.
The communication interface 513 is used for communication between the 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 (e.g., WI-FI interface, bluetooth interface, etc.), typically 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), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Only an electronic device having components is shown, and it will be understood by those skilled in the art that the structures shown in the figures do not constitute limitations on the electronic device, and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for powering the respective components, and the power source may be logically connected to the at least one processor 510 through a power management device, so as to perform functions of charge management, discharge management, and power consumption management through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may also include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described in detail herein.
It should be understood that the examples are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
In particular, the specific implementation method of the above instruction by the processor 510 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated by the electronic device 501 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. The computer readable storage medium may be volatile or nonvolatile. For example, a computer readable medium may include any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. A method of data encryption against quantum decryption, the method comprising:
initializing a generating matrix according to a preset maximum rank distance code;
packaging the stored data according to the generation matrix to obtain a stored data packet;
performing data splicing on the stored data packet by using a preset encryption and decryption private key to obtain a standard data packet;
coding the standard data packet according to the generating matrix to obtain coded data;
encrypting the coded data according to the standard data packet by using the encryption and decryption private key to obtain encrypted storage data;
The method comprises the steps of carrying out vectorization operation on a standard data packet to obtain a data packet vector, carrying out transposition operation on the data packet vector to obtain a transposed data packet vector, carrying out matrix multiplication operation on the transposed data packet vector according to the generating matrix to obtain transposed code, and carrying out transposition operation on the transposed code to obtain coded data;
The encryption and decryption private key is used for encrypting the coded data according to the standard data packet to obtain encrypted storage data, and the encryption and decryption private key comprises the steps of vectorizing the standard data packet to obtain a data packet vector, screening check codes from the coded data according to the data packet vector, and screening the encrypted storage data from the check codes according to the encryption and decryption private key.
2. The method for encrypting data against quantum decryption according to claim 1, wherein said packing the stored data according to the generator matrix to obtain the stored data packet comprises:
generating a stored information length according to the information length of the generation matrix;
judging whether the data length of the stored data is an integer multiple of the length of the stored information;
if not, carrying out zero padding operation on the stored data according to the length of the stored information, and returning to the step of judging whether the data length of the stored data is an integer multiple of the length of the stored information;
If yes, splitting the storage data into a plurality of data blocks with the storage information length, and packaging all the data blocks into a storage data packet.
3. A method of decrypting data against quantum decryption, the method comprising:
calculating a check matrix according to a preset generation matrix;
performing data reconstruction on the pre-acquired encrypted storage data by using a preset encryption and decryption private key to obtain reconstructed storage data, wherein the data reconstruction refers to splicing the encryption and decryption private key as a vector element to the tail of the encrypted storage data;
performing data decoding on the reconstructed storage data according to the generation matrix and the check matrix to obtain a decoding codeword;
Performing data error correction on the decoded codeword by using the generating matrix and the reconstructed storage data to obtain a storage data packet;
unpacking the storage data packet to obtain storage data;
The method comprises the steps of multiplying the generation matrix by the check matrix to obtain a decoding matrix, judging whether the decoding matrix is reversible, decoding the reconstructed storage data by using an inverse matrix of the decoding matrix to obtain a decoding codeword if yes, and decoding the reconstructed storage data by using a pseudo-inverse matrix of the decoding matrix to obtain a decoding codeword if no.
4. The method for decrypting data with quantum decryption resistance as claimed in claim 3, wherein the calculating the check matrix according to the preset generation matrix comprises:
solving a homogeneous linear equation set of the generating matrix to obtain a zero space;
simplifying the generation matrix by utilizing row operation to obtain a stepped generation matrix;
screening free variables from the ladder type generation matrix;
And calculating a base vector matrix of the null space according to the free variable, and taking a transposed matrix of the base vector matrix as a check matrix.
5. A method of decrypting data as claimed in claim 3, wherein said performing data error correction on said decoded codeword using said generator matrix and said reconstructed stored data to obtain a stored data packet comprises:
Screening out a decoded data packet from the decoded codeword by using the reconstructed stored data;
calculating an error correction matrix according to the generation matrix;
Multiplying the error correction matrix by a transpose matrix of the decoded codeword to obtain an error correction codeword;
and correcting the error of the decoded data packet by using the error correction code word to obtain a stored data packet.
6. A data encryption device resistant to quantum decryption, the device comprising:
The matrix creation module is used for initializing a generated matrix according to a preset maximum rank distance code;
the data packaging module is used for packaging the stored data according to the generation matrix to obtain a stored data packet;
the key splicing module is used for carrying out data splicing on the stored data packet by utilizing a preset encryption and decryption private key to obtain a standard data packet;
The data coding module is used for carrying out vectorization operation on the standard data packet to obtain a data packet vector, carrying out transposition operation on the data packet vector to obtain a transposed data packet vector, carrying out matrix multiplication operation on the transposed data packet vector according to the generating matrix to obtain transposed codes, and carrying out transposition operation on the transposed codes to obtain coded data;
the private key encryption module is used for carrying out vectorization operation on the standard data packet to obtain a data packet vector, screening a check code from the coded data according to the data packet vector, and screening encrypted storage data from the check code according to the encryption and decryption private key.
7. A data decryption device resistant to quantum decryption, the device comprising:
the matrix creation module is used for calculating a check matrix according to a preset generation matrix;
The data reconstruction module is used for carrying out data reconstruction on the encrypted storage data acquired in advance by using a preset encryption and decryption private key to obtain reconstructed storage data, wherein the data reconstruction refers to splicing the encryption and decryption private key as a vector element to the tail of the encrypted storage data;
The data decoding module is used for multiplying the generating matrix by the check matrix to obtain a decoding matrix, judging whether the decoding matrix is reversible, if so, decoding the reconstructed storage data by using the inverse matrix of the decoding matrix to obtain a decoding codeword, and if not, decoding the reconstructed storage data by using the pseudo-inverse matrix of the decoding matrix to obtain a decoding codeword;
The data error correction module is used for carrying out data error correction on the decoding codeword by utilizing the generating matrix and the reconstructed storage data to obtain a storage data packet;
And the data unpacking module is used for unpacking the storage data packet to obtain storage data.
8. An electronic device, the electronic device comprising:
At least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to implement the quantum decryption resistant data encryption method of claim 1 or 2 and the quantum decryption resistant data decryption method of any one of claims 3 to 5.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the quantum decryption resistant data encryption method of claim 1 or 2 and the quantum decryption resistant data decryption method of any one of claims 3 to 5.
CN202411408903.3A 2024-10-10 2024-10-10 Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media Active CN118940300B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411408903.3A CN118940300B (en) 2024-10-10 2024-10-10 Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411408903.3A CN118940300B (en) 2024-10-10 2024-10-10 Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media

Publications (2)

Publication Number Publication Date
CN118940300A CN118940300A (en) 2024-11-12
CN118940300B true CN118940300B (en) 2025-02-28

Family

ID=93346638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411408903.3A Active CN118940300B (en) 2024-10-10 2024-10-10 Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media

Country Status (1)

Country Link
CN (1) CN118940300B (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2023109443A (en) * 2022-01-27 2023-08-08 国立研究開発法人情報通信研究機構 Secure communication system and method based on network coding
CN118300892B (en) * 2024-06-03 2024-10-22 深圳市领存技术有限公司 Security network programming method based on rank metric error correction code and related products

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
秩最大秩距离码的构造与应用;高哲;《中国优秀硕士学位论文全文数据库基础科学辑》;20210115;第9-11、23-29页 *

Also Published As

Publication number Publication date
CN118940300A (en) 2024-11-12

Similar Documents

Publication Publication Date Title
US11263416B2 (en) Two-dimensional code generation and identification
WO2017079237A1 (en) Homomorphic encryption with optimized parameter selection
WO2017079226A1 (en) Homomorphic encryption with optimized encoding
US10372886B2 (en) Protecting the input/output of modular encoded white-box RSA/ECC
CN103795525A (en) Data encryption method
US10140437B2 (en) Array indexing with modular encoded values
CN117708847B (en) 3C product leasing platform data processing method based on data compression and encryption
CN110543778A (en) linear random encryption and decryption algorithm for character data
US10235506B2 (en) White-box modular exponentiation
CN111931205A (en) Method and device for encrypting shader file
CN111582496A (en) A safe and efficient deep learning model prediction system and method based on SGX
CN112613054A (en) Electronic archive verification method and device based on GRS code and electronic equipment
CN1863042B (en) Method for information encryption and decryption
CN118300892B (en) Security network programming method based on rank metric error correction code and related products
CN111931204A (en) Encryption and de-duplication storage method and terminal equipment for distributed system
CN116664123A (en) Digital wallet design method based on blockchain technology
CN113642020B (en) Dynamic encryption method and device for configuration file, electronic equipment and storage medium
US10068070B2 (en) White-box elliptic curve point multiplication
CN118940300B (en) Data encryption method and decryption method resistant to quantum decryption and related devices, electronic equipment, and media
CN112614557A (en) Electronic medical record encryption archiving method
US8832450B2 (en) Methods and apparatus for data hashing based on non-linear operations
BRPI1002551B1 (en) CRYPTOGRAPHY METHOD IN CHAOTIC OPERATION MODE
US20180270054A1 (en) Methods and Apparatus for Encrypting Multimedia Information
CN117459221A (en) Data encryption method and device, data decryption method and device and electronic equipment
CN116846557A (en) Data encryption method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant