Post quantum cryptography algorithm migration method, device, equipment and medium

By performing iterative encryption and decryption operations on the pre-quantum symmetric cryptographic algorithm, the key length is expanded to achieve the level of quantum security resistance, the problem of insufficient key length of the existing symmetric cryptographic algorithm is solved, and the migration of the post-quantum cryptographic algorithm is realized, reducing the migration cost and supporting the goal of domestic production.

CN119728108APending Publication Date: 2025-03-28CETC CYBERSPACE SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411926498.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The key length of existing symmetric cryptographic algorithms such as SM4 is not enough to resist attacks from quantum computers, and there are problems such as high migration costs, dependence on foreign algorithms and poor business continuity during the migration process of post-quantum security algorithms.

Method used

By iteratively encrypting and decrypting operations on the key set and encrypting and decrypting operation sequence set of the pre-quantum symmetric cryptography algorithm, the key length is expanded to achieve the level of quantum security resistance, and the migration of the post-quantum cryptography algorithm is realized.

Benefits of technology

It reduces migration costs, supports commercial cryptographic algorithms, complies with the goal of domestic independent control, and improves business continuity and avoids business interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728108A_ABST
    Figure CN119728108A_ABST
Patent Text Reader

Abstract

The invention discloses a post quantum cryptography algorithm migration method and device, equipment and a medium. In the method, firstly, a key set of a front quantum symmetric cryptographic algorithm is defined; defining an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set comprises symbols for indicating encryption and decryption operations; and according to the key set and the encryption and decryption operation sequence set, iteration encryption and decryption operation is carried out on the previous quantum ciphertext in sequence, an anti-quantum security ciphertext and an anti-quantum security key are obtained, and the length of the anti-quantum security key is greater than or equal to that of the anti-quantum security key, so that post-quantum cryptographic algorithm migration is realized. In the process, an anti-quantum security key can be obtained by performing iterative encryption and decryption operation on the pre-quantum ciphertext by using the pre-quantum symmetric cryptographic algorithm, and the key length of the original quantum unsecurity is expanded into the key length of the quantum security, so that the post-quantum cryptographic algorithm migration is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a method, device, equipment and medium for post-quantum cryptographic algorithm migration. Background Art

[0002] Cryptography is the core of information security and the cornerstone of cyberspace security, and the security of cryptography depends on the security of cryptographic algorithms. With the improvement of computer computing performance and the advancement of cryptanalysis technology, especially the rapid development of quantum computers, the security of cryptographic algorithms has been severely challenged. Since quantum computers will halve the key security of symmetric cryptographic algorithms, it is necessary to increase the key length of symmetric cryptographic algorithms to a quantum-resistant security level. However, the key length of the currently commonly used symmetric cryptographic algorithms, such as SM4, is only 128 bits, which does not meet the minimum key length requirement of at least 256 bits. Therefore, it is necessary to migrate the original non-quantum-safe cryptographic algorithms to quantum-resistant cryptographic algorithms.

[0003] However, in the existing migration process, the original algorithm is usually replaced by a post-quantum secure algorithm such as AES256, where the post-quantum secure algorithm is a foreign-set algorithm. During the migration process, there are problems such as high migration cost, strong dependence on foreign algorithms, and poor business continuity. Therefore, this application needs to propose a solution that can solve the above problems. Summary of the invention

[0004] The present application provides a method, apparatus, device and medium for post-quantum cryptographic algorithm migration, which utilizes the originally used symmetric cryptographic algorithm to perform multiple encryption and decryption operations on the same data, expands the original quantum-insecure key length to a quantum-secure key length, and achieves agile migration of the post-quantum cryptographic algorithm.

[0005] In a first aspect, the present application provides a method for post-quantum cryptographic algorithm migration, the method comprising:

[0006] Define a key set for a pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 mutually independent keys of a key length of n bits, wherein n is a positive integer less than a quantum-resistant secure key length, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the quantum-resistant secure key length;

[0007] Defining an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations;

[0008] According to the key set and the encryption and decryption operation sequence set, the pre-quantum ciphertext is iteratively encrypted and decrypted in sequence to obtain the quantum-resistant secure ciphertext and the quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize the migration of the post-quantum cryptographic algorithm.

[0009] Optionally, before defining the key set of the pre-quantum symmetric cryptographic algorithm, it also includes:

[0010] The plaintext is encrypted using the key in the pre-quantum symmetric cryptographic algorithm to obtain the pre-quantum ciphertext.

[0011] Optionally, a key set for a pre-quantum symmetric cryptographic algorithm is defined, including:

[0012] Using the key generation function in the pre-quantum symmetric cryptographic algorithm, t-1 n-bit independent keys are randomly generated;

[0013] A key set is composed of t-1 mutually independent keys of n bits in length.

[0014] Optionally, define a set of encryption and decryption operation sequences, including:

[0015] It is defined that when the symbol indication is 0, the pre-quantum ciphertext is encrypted using the key of the pre-quantum symmetric cryptographic algorithm;

[0016] It is defined that when the symbol indication is 1, the pre-quantum ciphertext is decrypted using the key of the pre-quantum symmetric cryptographic algorithm;

[0017] According to the encryption and decryption operation sequence required for the previous quantum ciphertext, a set of encryption and decryption operation sequences consisting of t-1 symbols is obtained.

[0018] Optionally, performing iterative encryption and decryption operations on the pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set includes:

[0019] The numerical values ​​indicated by the symbols in the encryption and decryption operation sequence set are read in sequence to determine the order of performing encryption and decryption operations on the previous quantum ciphertext;

[0020] The keys in the key set are used in sequence to iteratively encrypt and decrypt the previous quantum ciphertext.

[0021] Optionally, the keys in the key set become quantum-resistant secure keys after iterative encryption and decryption operations.

[0022] In a second aspect, the present application provides a device for post-quantum cryptographic algorithm migration, the device comprising:

[0023] A definition unit, used to define a key set of a pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 mutually independent keys with a key length of n bits, wherein n is a positive integer less than a quantum-resistant secure key length, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the quantum-resistant secure key length;

[0024] A definition unit, used to define an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations;

[0025] A processing unit is used to perform iterative encryption and decryption operations on the pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set to obtain quantum-resistant secure ciphertext and quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize post-quantum cryptographic algorithm migration.

[0026] Optionally, the device further comprises:

[0027] The encryption unit is used to encrypt the plaintext using the key in the pre-quantum symmetric cryptographic algorithm to obtain the pre-quantum ciphertext.

[0028] Optionally, when the definition unit is used to define a key set of a pre-quantum symmetric cryptographic algorithm, it is specifically used to:

[0029] Using the key generation function in the pre-quantum symmetric cryptographic algorithm, t-1 n-bit independent keys are randomly generated;

[0030] A key set is composed of t-1 mutually independent keys of n bits in length.

[0031] Optionally, when the definition unit is used to define a set of encryption and decryption operation sequences, it is specifically used to:

[0032] It is defined that when the symbol indication is 0, the pre-quantum ciphertext is encrypted using the key of the pre-quantum symmetric cryptographic algorithm;

[0033] It is defined that when the symbol indication is 1, the pre-quantum ciphertext is decrypted using the key of the pre-quantum symmetric cryptographic algorithm;

[0034] According to the encryption and decryption operation sequence required for the previous quantum ciphertext, a set of encryption and decryption operation sequences consisting of t-1 symbols is obtained.

[0035] Optionally, the processing unit is specifically configured to:

[0036] The numerical values ​​indicated by the symbols in the encryption and decryption operation sequence set are read in sequence to determine the order of performing encryption and decryption operations on the previous quantum ciphertext;

[0037] The keys in the key set are used in sequence to iteratively encrypt and decrypt the previous quantum ciphertext.

[0038] Optionally, the keys in the key set become quantum-resistant secure keys after iterative encryption and decryption operations.

[0039] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and a processor:

[0040] The memory is used to store computer programs;

[0041] The processor is used to execute the method provided by the first aspect according to the computer program.

[0042] In a fourth aspect, the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the method provided in the first aspect above.

[0043] It can be seen that this application has the following beneficial effects:

[0044] The present application provides a method for post-quantum cryptographic algorithm migration, defining a key set of a pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 keys with a key length of n bits, wherein n is a positive integer less than the length of a quantum-resistant secure key, and t is the minimum positive integer such that n multiplied by t is greater than or equal to the length of a quantum-resistant secure key; defining an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations; performing iterative encryption and decryption operations on pre-quantum ciphertexts in turn according to the key set and the encryption and decryption operation sequence set, obtaining quantum-resistant secure ciphertexts and quantum-resistant secure keys, wherein the length of the quantum-resistant secure keys is greater than or equal to the length of the quantum-resistant secure keys, so as to achieve post-quantum cryptographic algorithm migration. In this process, by performing iterative encryption and decryption operations on pre-quantum ciphertexts using a pre-quantum symmetric cryptographic algorithm, a quantum-resistant secure key can be obtained, and the original quantum-insecure key length can be expanded to a quantum-safe key length, thereby achieving post-quantum cryptographic algorithm migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0046] Figure 1 This is a flow chart of an embodiment of a method for post-quantum cryptographic algorithm migration in an embodiment of the present application;

[0047] Figure 2 A flowchart of another embodiment of a method for post-quantum cryptographic algorithm migration in an embodiment of the present application;

[0048] Figure 3 This is a flow chart of the encryption process of the SM4 algorithm in the embodiment of the present application;

[0049] Figure 4 This is a schematic diagram of the structure of a device for post-quantum cryptographic algorithm migration in an embodiment of the present application;

[0050] Figure 5 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

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

[0052] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0053] The currently commonly used symmetric cryptographic algorithms, such as my country's commercial cryptographic standard SM4, have a key length of only 128 bits, so these algorithms are not quantum-safe (called pre-quantum cryptographic algorithms). In order to cope with the threat of quantum computing, it is necessary to migrate the original non-quantum-safe cryptographic algorithms to quantum-resistant cryptographic algorithms, that is, post-quantum cryptographic algorithm migration.

[0054] At present, the common practice for post-quantum cryptographic migration of symmetric cryptographic algorithms is to replace the original algorithms with post-quantum secure algorithms such as AES256. However, this method has the problems of high migration cost, strong dependence on foreign algorithms and poor business continuity. The above problems are explained in detail below.

[0055] (1) High migration cost: During the migration process, data originally encrypted using the pre-quantum cryptographic algorithm must first be decrypted using the pre-quantum cryptographic algorithm and the corresponding key, and then encrypted using the post-quantum cryptographic algorithm and the corresponding key. For a large amount of data, the cost of this operation is very high.

[0056] (2) Strong dependence on foreign algorithms: In my country's commercial cryptographic algorithm standards, the symmetric encryption algorithm SM4 is a pre-quantum algorithm. my country currently does not have a post-quantum secure symmetric algorithm. If post-quantum algorithm migration is carried out, foreign algorithms must be used to protect sensitive data, which does not meet my country's goal of independent control in the security field.

[0057] (3) Poor business continuity: For two systems that exchange data based on pre-quantum cryptographic algorithms, if only one side completes the migration to the post-quantum cryptographic algorithm and the other side does not due to migration costs and implementation cycles, then the two sides can no longer exchange data or can only use the pre-quantum cryptographic algorithm to exchange data, resulting in business continuity interruption and security issues.

[0058] In an embodiment of the present application, by iteratively encrypting and decrypting pre-quantum ciphertext, quantum-resistant secure ciphertext and quantum-resistant secure key can be obtained, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key (e.g., 256 bits), so as to realize post-quantum cryptographic algorithm migration.

[0059] In specific implementation, the method may include, for example: defining a key set of a pre-quantum symmetric cryptographic algorithm, the key set including t-1 keys with a key length of n bits, wherein n is a positive integer less than the length of a quantum-resistant secure key, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the length of the quantum-resistant secure key; defining an encryption and decryption operation sequence set, the encryption and decryption operation sequence set including t-1 symbols for indicating encryption and decryption operations; performing iterative encryption and decryption operations on a pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set to obtain a quantum-resistant secure ciphertext and a quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to achieve migration to a post-quantum cryptographic algorithm.

[0060] It can be seen that the method provided by the implementation of this application performs iterative encryption and decryption operations on the pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set to obtain quantum-resistant secure ciphertext and quantum-resistant secure key, which can realize the migration of post-quantum cryptographic algorithms, thereby having the following beneficial effects: (1) Reducing the cost of migration. Using the existing symmetric cryptographic algorithm to repeatedly encrypt or decrypt data can expand the key length to the level of quantum-resistant security. Only one symmetric cryptographic algorithm can be used to achieve the migration effect, that is, the cost of migration can be reduced. (2) Supporting commercial cryptographic algorithms, there is no need to specifically introduce post-quantum cryptographic algorithms, which is in line with the goal of localization, independent and controllable. (3) Improving business continuity, that is, the business does not need to undergo large-scale transformation to achieve quantum-resistant security. It only needs to increase key management and data encryption and decryption overhead on the basis of the original cryptographic system. The business does not need to be shut down for upgrades, and there will be no interruptions.

[0061] To facilitate understanding of the specific implementation of the method for post-quantum cryptographic algorithm migration provided in the embodiments of the present application, an explanation will be given below with reference to the accompanying drawings.

[0062] It should be noted that the subject of the method for implementing the post-quantum cryptographic algorithm migration may be a device for post-quantum cryptographic algorithm migration provided in an embodiment of the present application, and the device for post-quantum cryptographic algorithm migration may be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method for post-quantum cryptographic algorithm migration in the embodiment of the present application, for example, an Internet of Things (IoT) device.

[0063] Figure 1 A flow chart of a method for post-quantum cryptographic algorithm migration provided in an embodiment of the present application. The method can be applied to a device for post-quantum cryptographic algorithm migration, and the device for post-quantum cryptographic algorithm migration can be, for example, Figure 4 The post-quantum cryptographic algorithm migration device 400 shown in FIG. 1 may also be integrated in Figure 5 Functional modules in the electronic device 500 are shown.

[0064] like Figure 1 As shown, the method includes the following S101 to S103:

[0065] S101: Define a key set of a pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 mutually independent keys with a key length of n bits, wherein n is a positive integer less than a quantum-resistant secure key length, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the quantum-resistant secure key length.

[0066] In order to realize the migration of post-quantum cryptographic algorithms, it is first necessary to define the key set of the pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 mutually independent keys with a key length of n bits, and then define the encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations; finally, according to the key set and the encryption and decryption operation sequence set, the pre-quantum ciphertext is iteratively encrypted and decrypted in turn to obtain quantum-resistant secure ciphertext and quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize the migration of post-quantum cryptographic algorithms. Therefore, the embodiment of the present application defines the key set of the pre-quantum symmetric cryptographic algorithm through S101, which is pre-positioned for the subsequent iterative encryption and decryption operations on the pre-quantum ciphertext.

[0067] It should be noted that, in the embodiment of the present application, it is also necessary to obtain the pre-quantum ciphertext before executing S101. The specific process may include: encrypting the plaintext plain using the key in the pre-quantum symmetric cryptographic algorithm alg to obtain the pre-quantum ciphertext cipher0. The pre-quantum symmetric cryptographic algorithm may be the SM4 algorithm, wherein the length of the key key in the pre-quantum symmetric cryptographic algorithm is 128 bits, wherein 128 bits is a positive integer less than the length of the quantum security key (e.g., 256 bits).

[0068] As an example, S101 may include: using a key generation function in a pre-quantum symmetric cryptographic algorithm to randomly generate t-1 mutually independent keys of n bits in length; combining the t-1 mutually independent keys of n bits in length into a key set key of the pre-quantum symmetric cryptographic algorithm. j (j=1, ..., t-1). For example, the key generation function in the SM4 algorithm is used to randomly generate t-1 128-bit independent keys, and then the t-1 128-bit keys are combined into a key set of the pre-quantum symmetric cryptographic algorithm.

[0069] In this process, in order to reduce the cost and complexity of migration, it is considered possible to iterate encryption or decryption on the original mechanism. In order to support commercial cryptographic algorithms, there is no need to specifically introduce post-quantum cryptographic algorithms. It is considered possible to use pre-quantum symmetric cryptographic algorithms for iterative encryption or decryption. Therefore, it is necessary to first define a key set for iterative encryption or decryption, and this key set is still a pre-quantum symmetric cryptographic algorithm.

[0070] S102: Define an encryption / decryption operation sequence set, wherein the encryption / decryption operation sequence set includes t-1 symbols for indicating encryption / decryption operations.

[0071] As an example, S102 may include: defining that when the symbol indication is 0, an encryption operation is performed on the pre-quantum ciphertext using the key of the pre-quantum symmetric cryptographic algorithm; defining that when the symbol indication is 1, a decryption operation is performed on the pre-quantum ciphertext using the key of the pre-quantum symmetric cryptographic algorithm; and obtaining an encryption and decryption operation sequence set b1, b2, ..., b2 consisting of t-1 symbols according to the encryption and decryption operation sequence required for the pre-quantum ciphertext. t-1 >,b j =0 or 1, j = 1, 2, ..., t-1. Among them, b j When it is equal to 0, it means that the key of the pre-quantum symmetric cryptographic algorithm needs to be used to encrypt the pre-quantum ciphertext; accordingly, b j When it is equal to 1, it means that the key of the pre-quantum symmetric cryptographic algorithm is needed to decrypt the pre-quantum ciphertext.

[0072] In this process, in order to reduce the migration cost and complexity, it is considered to perform iterative encryption and decryption operations on the pre-quantum ciphertext. Therefore, it is necessary to first define a set of encryption and decryption operation sequences to determine the order of encryption and decryption operations used on the pre-quantum ciphertext.

[0073] S103: performing iterative encryption and decryption operations on the pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set to obtain a quantum-resistant secure ciphertext and a quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize post-quantum cryptographic algorithm migration.

[0074] As an example, S103 may include: sequentially reading the values ​​indicated by the symbols in the encryption and decryption operation sequence set to determine the order of performing encryption and decryption operations on the pre-quantum ciphertext; and sequentially using the keys in the key set to iteratively encrypt and decrypt the pre-quantum ciphertext according to the order.

[0075] Among them, in the above method, a symbol S for encryption and decryption operations can be defined i (data,KEY)(i=0,1) means using key KEY to process data, where For example, cipher0=S0(plain,key) means that the plaintext plain is encrypted with algEnc using key to obtain the ciphertext cipher0; plain=S1(cipher0,key) means that the ciphertext cipher0 is decrypted with algDec using key to obtain the plaintext plain.

[0076] Therefore, the encryption and decryption operation sequence set and the corresponding key set obtained above can be used to encrypt and decrypt cipher0, thereby obtaining the quantum-resistant secure ciphertext cipher t-1 , quantum-secure ciphertext is quantum-secure.

[0077] It should be noted that, during the iterative encryption and decryption process, the original key of length n bits can be expanded to a length greater than or equal to the quantum-resistant secure key length to obtain a quantum-resistant secure key, such as a key length greater than 256 bits. That is, during the data processing process, together with the original key, a total of t mutually independent keys of length n bits are operated on the plaintext data plain, and are obfuscated and diffused, which is equivalent to using a key of length n×t bits to perform cryptographic operations on plain.

[0078] It can be seen that the embodiment of the present application can obtain a quantum-resistant secure key by using a pre-quantum symmetric cryptographic algorithm to iteratively encrypt and decrypt pre-quantum ciphertext, expand the original quantum-insecure key length to a quantum-secure key length, and achieve post-quantum cryptographic algorithm migration.

[0079] In order to make the method provided in the embodiment of the present application clearer and easier to understand, Figure 2 A specific example of this method is described.

[0080] like Figure 2 As shown, the implementation may include:

[0081] S201: Use the key in the SM4 algorithm to encrypt the plaintext to obtain the pre-quantum ciphertext, where the key length in the SM4 algorithm is 128 bits.

[0082] In the embodiment of the present application, the pre-quantum symmetric cryptographic algorithm is set to the SM4 algorithm, and the length n of the key in the SM4 algorithm is 128 bits. Therefore, the key key in the SM4 algorithm is used to encrypt the plaintext plain to obtain the pre-quantum ciphertext cipher0.

[0083] In the embodiment of the present application, the SM4 algorithm is used as an example of a pre-quantum symmetric cryptographic algorithm, that is, the specific encryption process can be performed as follows: Figure 3 As shown, (1) Input plaintext processing: The plaintext is divided into four 32-bit (128-bit) words, represented as (X1, X2, X3, X4). (2) Generate round keys: Use the initial key to generate 32 round keys through the key expansion algorithm, represented as rki, where i = 0, 1, ..., 31. (3) Round function iteration: Perform 32 rounds of iterative processing on each plaintext word. In each round, the current plaintext word and the corresponding round key are used to calculate the round function F to generate a new word. The round function F includes nonlinear transformation (S-box byte nonlinear replacement) and linear transformation (word linear component L transformation). (4) Nonlinear transformation: Byte replacement is performed through the S-box, and the first half byte of the input is used as the row number, the second half byte is used as the column number, and the data at the intersection of the row and column is used as the output. (5) Linear transformation: The result of the nonlinear transformation is cyclically shifted to the left and XORed with the plaintext word of the next round. (6) Output ciphertext: After 32 rounds of iteration, the four words (X 35 ,X 34 ,X 33 ,X 32 ) is transformed in reverse order to obtain the ciphertext (Y0, Y1, Y2, Y3).

[0084] S202: Define a key set of a pre-quantum symmetric cryptographic algorithm, wherein the key set includes one key with a key length of 128 bits.

[0085] In the process of defining the key set of the pre-quantum symmetric cryptographic algorithm, since the length n of the key in the above SM4 algorithm is 128 bits, that is, t is the smallest positive integer such that n multiplied by t is greater than or equal to 256 bits, that is, t is 2, the key set includes t-1=1 key key1 with a key length of 128 bits. The specific method of generating the key is as shown in the above embodiment, which will not be repeated here.

[0086] S203: Define an encryption / decryption operation sequence set, wherein the encryption / decryption operation sequence set includes a symbol for indicating an encryption / decryption operation.

[0087] Since t has been defined as 2 above, the decryption operation sequence set in the embodiment of the present application includes a symbol for indicating encryption and decryption operations. The symbol can be b1=0, indicating an encryption operation, or b1=1, indicating a decryption operation.

[0088] S204: Read the numerical value indicated by the symbol in the encryption and decryption operation sequence set, and perform encryption and decryption operations on the pre-quantum ciphertext using the key in the key set according to the numerical value to obtain the quantum-resistant secure ciphertext.

[0089] For the above encryption and decryption operation sequence set, subsequent operations can be divided into two cases: encryption operation and decryption operation. The following details are described in detail:

[0090] (1) When b1=0 is read, it means that encryption operation is required, so cipher0 needs to be encrypted by SM4 using key key1, that is, calculation Finally, cipher1 is obtained.

[0091] (2) When b1=1 is read, it means that a decryption operation is required, so the key key1 is used to perform SM4 decryption on cipher0, that is, calculate Finally, cipher1 is obtained.

[0092] S205: Use the key in the key set to perform encryption and decryption operations on the quantum secure ciphertext, and then use the key in the SM4 algorithm to decrypt the previous quantum ciphertext to obtain the plaintext.

[0093] Since there are two cases of encryption and decryption above, when obtaining plain text later, it is also necessary to divide it into two cases for explanation:

[0094] (1) When performing an encryption operation to obtain quantum-resistant secure ciphertext, first use key1 to decrypt cipher1, calculate cipher0 = S1(cipher1, key1), and then use key to decrypt cipher0 to calculate the plaintext plain = S1(cipher0, key).

[0095] (2) When performing a decryption operation to obtain quantum-resistant secure ciphertext, first use key1 to encrypt cipher1, calculate cipher0 = S0(cipher1, key1), and then use key to decrypt cipher0 to calculate the plaintext plain = S1(cipher0, key).

[0096] This embodiment provides a method for post-quantum cryptographic algorithm migration, which can turn an originally non-quantum-secure system into a quantum-resistant one. At the same time, only relatively simple operations are required to complete the post-quantum cryptographic algorithm migration of the symmetric cryptographic system. There is no need to decrypt the original data first and then re-encrypt it with a new post-quantum cryptographic algorithm. This can improve the quantum-resistant security of the existing symmetric cryptographic system and reduce the cost and complexity of migration. In addition, only the original pre-quantum cryptographic algorithm (such as commercial cryptographic algorithm SM4, etc.) can be used, and there is no need to introduce a special post-quantum cryptographic algorithm. This can fundamentally get rid of the dependence on foreign cryptographic technology and make it more autonomous and controllable. And because the communicating parties still only use the original pre-quantum cryptographic algorithm, but after processing, the exchanged data is quantum-resistant and secure; at the same time, the existing system does not need to undergo large-scale system transformation, and the business of both parties can maintain continuity.

[0097] See also Figure 4 , the embodiment of the present application provides a device 400 for post-quantum cryptographic algorithm migration, the device comprising:

[0098] A definition unit 401 is used to define a key set of a pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 mutually independent keys with a key length of n bits, wherein n is a positive integer less than a quantum-resistant secure key length, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the quantum-resistant secure key length;

[0099] A definition unit 401, used to define an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations;

[0100] The processing unit 402 is used to perform iterative encryption and decryption operations on the pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set to obtain the quantum-resistant secure ciphertext and the quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize the migration of the post-quantum cryptographic algorithm.

[0101] Optionally, the device 400 further includes:

[0102] The encryption unit is used to encrypt the plaintext using the key in the pre-quantum symmetric cryptographic algorithm to obtain the pre-quantum ciphertext.

[0103] Optionally, when the definition unit 401 is used to define a key set of a pre-quantum symmetric cryptographic algorithm, it is specifically used to:

[0104] Using the key generation function in the pre-quantum symmetric cryptographic algorithm, t-1 keys of n-bit length are randomly generated;

[0105] A key set is composed of t-1 keys of length n bits.

[0106] Optionally, when the definition unit 401 is used to define a set of encryption and decryption operation sequences, it is specifically used to:

[0107] It is defined that when the symbol indication is 0, the pre-quantum ciphertext is encrypted using the key of the pre-quantum symmetric cryptographic algorithm;

[0108] It is defined that when the symbol indication is 1, the pre-quantum ciphertext is decrypted using the key of the pre-quantum symmetric cryptographic algorithm;

[0109] According to the encryption and decryption operation sequence required for the previous quantum ciphertext, a set of encryption and decryption operation sequences consisting of t-1 symbols is obtained.

[0110] Optionally, the processing unit 402 is specifically configured to:

[0111] The numerical values ​​indicated by the symbols in the encryption and decryption operation sequence set are read in sequence to determine the order of performing encryption and decryption operations on the previous quantum ciphertext;

[0112] The keys in the key set are used in sequence to iteratively encrypt and decrypt the previous quantum ciphertext.

[0113] Optionally, the keys in the key set become quantum-resistant secure keys after iterative encryption and decryption operations.

[0114] It should be noted that the specific implementation method and effect of the post-quantum cryptographic algorithm migration device 400 can be found in the above Figure 1 or Figure 2 The relevant descriptions in the provided methods will not be repeated here.

[0115] The present application embodiment also provides an electronic device 500, such as Figure 5 As shown, the device 500 includes a memory 501 and a processor 502:

[0116] The memory 501 is used to store computer programs;

[0117] The processor 502 is used to execute the above Figure 1 or Figure 2 The method provided.

[0118] In addition, the present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and the computer program is used to execute Figure 1 or Figure 2 The method provided.

[0119] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0120] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the goals of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0121] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A method for post-quantum cryptographic algorithm migration, characterized in that: The method comprises: Define a key set of a pre-quantum symmetric cryptographic algorithm, the key set comprising t-1 mutually independent keys of a key length of n bits, wherein n is a positive integer less than a quantum-resistant secure key length, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the quantum-resistant secure key length; Defining an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations; According to the key set and the encryption and decryption operation sequence set, iterative encryption and decryption operations are performed on the pre-quantum ciphertext in sequence to obtain quantum-resistant secure ciphertext and quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize post-quantum cryptographic algorithm migration.

2. The method according to claim 1, characterized in that Before defining the key set of the pre-quantum symmetric cryptographic algorithm, the method further includes: The plaintext is encrypted using the key in the pre-quantum symmetric cryptographic algorithm to obtain the pre-quantum ciphertext.

3. The method according to claim 1, characterized in that The key set defining the pre-quantum symmetric cryptographic algorithm comprises: Using the key generation function in the pre-quantum symmetric cryptographic algorithm, randomly generate t-1 n-bit independent keys; The t-1 mutually independent keys of n bits in length form the key set.

4. The method according to claim 1, characterized in that: The definition of the encryption and decryption operation sequence set includes: It is defined that when the symbol indication is 0, the pre-quantum ciphertext is encrypted using the key of the pre-quantum symmetric cryptographic algorithm; It is defined that when the symbol indication is 1, a decryption operation is performed on the pre-quantum ciphertext using a key of the pre-quantum symmetric cryptographic algorithm; According to the encryption and decryption operation sequence required for the pre-quantum ciphertext, the encryption and decryption operation sequence set consisting of t-1 symbols is obtained.

5. The method according to claim 4, characterized in that The iterative encryption and decryption operations are sequentially performed on the previous quantum ciphertext according to the key set and the encryption and decryption operation sequence set, including: Reading the values ​​indicated by the symbols in the encryption and decryption operation sequence set in sequence, and determining the order of performing encryption and decryption operations on the pre-quantum ciphertext; The pre-quantum ciphertext is iteratively encrypted and decrypted using the keys in the key set in sequence according to the sequence.

6. The method according to claim 1, characterized in that The keys in the key set become the quantum-resistant secure keys after iterative encryption and decryption operations.

7. A device for post-quantum cryptographic algorithm migration, characterized in that: The device comprises: A definition unit, used to define a key set of a pre-quantum symmetric cryptographic algorithm, wherein the key set includes t-1 mutually independent keys with a key length of n bits, wherein n is a positive integer less than a quantum-resistant secure key length, and t is a minimum positive integer such that n multiplied by t is greater than or equal to the quantum-resistant secure key length; The definition unit is further used to define an encryption and decryption operation sequence set, wherein the encryption and decryption operation sequence set includes t-1 symbols for indicating encryption and decryption operations; A processing unit is used to perform iterative encryption and decryption operations on the pre-quantum ciphertext in sequence according to the key set and the encryption and decryption operation sequence set to obtain a quantum-resistant secure ciphertext and a quantum-resistant secure key, wherein the length of the quantum-resistant secure key is greater than or equal to the length of the quantum-resistant secure key, so as to realize post-quantum cryptographic algorithm migration.

8. The device according to claim 7, characterized in that The device also includes: The encryption unit is used to encrypt the plaintext using the key in the pre-quantum symmetric cryptographic algorithm to obtain the pre-quantum ciphertext.

9. An electronic device, characterized in that: The device includes a memory and a processor, and the electronic device is used to execute a program stored in the memory to run the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.