CN113328849B - Key obtaining method and device - Google Patents

Key obtaining method and device Download PDF

Info

Publication number
CN113328849B
CN113328849B CN202110581988.5A CN202110581988A CN113328849B CN 113328849 B CN113328849 B CN 113328849B CN 202110581988 A CN202110581988 A CN 202110581988A CN 113328849 B CN113328849 B CN 113328849B
Authority
CN
China
Prior art keywords
key
bits
current round
sub
generation process
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
CN202110581988.5A
Other languages
Chinese (zh)
Other versions
CN113328849A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN202110581988.5A priority Critical patent/CN113328849B/en
Publication of CN113328849A publication Critical patent/CN113328849A/en
Application granted granted Critical
Publication of CN113328849B publication Critical patent/CN113328849B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • 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)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The embodiment of the application discloses a method and a device for acquiring a secret key, wherein the method comprises the following steps: realizing AES algorithm quantization; the AES algorithm quantization comprises: encoding the sub-key generated in the current round to the qubits of the sub-key generated in the previous round; taking the quantized AES algorithm as an Oracle of a Grover algorithm, and transferring the quantum state of the key space to the required key state through multiple iterations; and measuring the key space to obtain the required key. By the scheme of the embodiment, the number of bit numbers adopted in the quantization process of the AES algorithm can be reduced, and the complexity of quantum attack based on the Grover algorithm is effectively reduced.

Description

Key obtaining method and device
Technical Field
The present disclosure relates to encryption technologies, and more particularly, to a method and apparatus for key acquisition.
Background
Quantum computing has been widely studied and focused since its introduction in the eighties of the 20 th century. Due to the existence of quantum superposition and quantum entanglement, quantum computation has the advantage of parallelism, the solution of some classical problems can be accelerated by utilizing the quantum advantages to carry out quantum algorithm design, for example, the Shor algorithm proposed in the middle and later stages of the nineties in the twentieth century can exponentially accelerate the problem of large-prime-factor decomposition, and the Grover algorithm can accelerate polynomial in data space search relative to the traditional algorithm.
The classical encryption algorithm mainly comprises symmetric encryption and asymmetric encryption, and nowadays, symmetric encryption algorithms such as AES are widely applied in life. Today, the quantum computing technology is developed vigorously, and the determination of the attack capability of the quantum algorithm on the classical symmetric encryption algorithm is of great significance. However, the attack scheme of the current quantum algorithm on the classical symmetric encryption algorithm is complex and needs to be solved.
Disclosure of Invention
The embodiment of the application provides a secret key obtaining method and a secret key obtaining device, and the complexity of quantum attack based on a Grover algorithm can be effectively reduced.
The embodiment of the application provides a key obtaining method, which can comprise the following steps:
realizing the quantization of an advanced encryption standard AES algorithm; the quantization of the AES algorithm comprises the following steps: encoding the sub-keys obtained in the current round of key generation process to the qubits of the sub-keys generated in the previous round;
taking an AES algorithm for realizing quantization as an Oracle of a Grover algorithm, and transferring the quantum state of a key space to a required key state through multiple iterations;
and measuring the key space to obtain the required key.
In an exemplary embodiment of the present application, the encoding the sub-key generated in the current round to the qubits of the sub-key generated in the previous round may include:
coding the first m bits of the sub-keys obtained in the current round key generation process on the first m bits of the key space; the initial state of the first m bits of the key space is not 0;
wherein the key space refers to the qubits of the AES algorithm coding key;
for AES-128, AES-196 and AES-256, the m values are 32, 48 and 64, respectively.
In an exemplary embodiment of the present application, the encoding the first m bits of the sub-keys obtained by the current round key generation process on the first m bits of the key space may include:
performing preset modified bit replacement operation (SB) on the key of the last m-bit qubits of the subkeys obtained by the current round key generation process;
and performing exclusive OR operation on a replacement result obtained after the replacement operation of the preset decoration bit and a preset character string with the length of m bits to generate the front m bits of qubits in the current wheel key generation process.
In an exemplary embodiment of the present application, the character string may be a binary string.
In an exemplary embodiment of the present application, the performing a preset modified bit replacement operation on the key of the last m bits of qubits of the sub-key obtained by the current round key generation process may include:
and finally, carrying out exclusive OR operation on the affine transformation result and the key of the first m bits of the key space.
In an exemplary embodiment of the present application, the method may further include: the process of inverting each byte over a finite field is represented in the form of a boolean function.
In an exemplary embodiment of the present application, the encoding the first m bits of the sub-keys obtained by the current round key generation process on the first m bits of the key space includes:
taking the first m bits of qubits obtained latest in the current round key generation process as control bits, carrying out exclusive OR operation on the m-th to 2m bits of qubits of the sub-keys obtained in the current round key generation process, and taking the exclusive OR operation result as the m-th to 2m bits of final keys in the current round key generation process;
taking the qubits corresponding to the m-th to 2 m-th final keys obtained in the current round key generation process as control bits, carrying out exclusive OR operation on the 2 m-3 m-th bits of the sub keys obtained in the current round key generation process, and taking the exclusive OR operation result as the 2 m-3 m-th final keys in the current round key generation process;
and taking the qubits corresponding to the final keys of the 2m to 3m bits obtained in the current round key generation process as control bits, carrying out XOR operation on the 3m to 4m bits of the sub keys obtained in the current round key generation process, and taking the XOR operation result as the final keys of the 3m to 4m bits in the current round key generation process.
In exemplary embodiments of the present application, the AES algorithm may include any one or more of: AES-128, AES-196, AES-256, and the simplified advanced encryption Standard S-AES algorithms.
In an exemplary embodiment of the present application, the transforming the quantum state of the key space to the required key state through multiple iterations may include:
by passing
Figure BDA0003081371250000031
The secondary Grover iteration transfers the quantum state of the key space to the required key state, where nK represents a constant coefficient and O () represents the order of K, which is the number of bits of the key.
The embodiment of the present application further provides a key obtaining apparatus, which may include a processor and a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed by the processor, the key obtaining method is implemented.
Compared with the related art, the embodiment of the application can comprise the following steps: realizing the quantization of an advanced encryption standard AES algorithm; the quantization of the AES algorithm comprises the following steps: encoding the sub-key generated in the current round to the qubits of the sub-key generated in the previous round; taking the AES algorithm for realizing quantization as Oracle of the Grover algorithm, and transferring the quantum state of the key space to the required key state through multiple iterations; and measuring the key space to obtain the required key. According to the scheme of the embodiment, the previous m-bit sub-key of the sub-key obtained in the current round key generation process is generated according to the last m-bit sub-key of the sub-key obtained in the previous round key generation process, so that the number of bit numbers adopted in the encryption quantization process of the AES algorithm can be reduced, and the complexity of quantum attack based on the Grover algorithm is effectively reduced.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. Other advantages of the present application may be realized and attained by the instrumentalities and combinations particularly pointed out in the specification and the drawings.
Drawings
The accompanying drawings are included to provide an understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the examples serve to explain the principles of the disclosure and not to limit the disclosure.
Fig. 1 is a flowchart of a key obtaining method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an AES algorithm for quantum Grover attack according to an embodiment of the application;
FIG. 3 is a schematic diagram of a quantum circuit of the quantum Grover attack AES-128 algorithm according to the embodiment of the application;
FIG. 4 is a schematic diagram of an encryption process of a conventional AES-128;
FIG. 5 is a diagram illustrating a sub-key generation quantum circuit of the AES-128 algorithm according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating transformation of output bits in SB operation according to an embodiment of the present application;
FIG. 7 is a diagram of a quantum circuit of the S-AES algorithm according to an embodiment of the present application;
FIG. 8 is a schematic diagram of transformation circuits of a standard basis and a polynomial basis according to an embodiment of the present application;
FIG. 9 is a diagram illustrating an inversion quantum circuit on the S-AES finite field according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a fusion circuit of affine transformation and standard base to polynomial base mapping transformation in bit replacement according to an embodiment of the present application;
fig. 11 is a block diagram of a key obtaining apparatus according to an embodiment of the present application.
Detailed Description
The present application describes embodiments, but the description is illustrative rather than limiting and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Any feature or element of any embodiment may be used in combination with or instead of any other feature or element in any other embodiment, unless expressly limited otherwise.
The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed herein may also be combined with any conventional features or elements to form unique inventive aspects as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive aspects to form yet another unique inventive aspect, as defined by the claims. Thus, it should be understood that any of the features shown and/or discussed in this application may be implemented alone or in any suitable combination. Accordingly, the embodiments are not limited except as by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
Further, in describing representative embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other orders of steps are possible as will be understood by those of ordinary skill in the art. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Furthermore, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the embodiments of the present application.
An embodiment of the present application provides a key obtaining method, as shown in fig. 1, which may include steps S101 to S103:
s101, realizing AES (advanced encryption standard) algorithm quantization; the quantization of the AES algorithm may include: encoding the sub-key generated in the current round to the qubits of the sub-key generated in the previous round;
s102, taking the AES algorithm for realizing quantization as Oracle of the Grover algorithm, and transferring the quantum state of the key space to the required key state through multiple iterations;
s103, measuring the key space to obtain the required key.
In an exemplary embodiment of the present application, a method for quantum attack against Advanced Encryption Standard (AES) is presented, which may include: the AES algorithm quantization (which may include initialization of keys, generation of subkeys, encryption of known plaintext), Grover iterative attack, and key space measurement to obtain the desired key.
In an exemplary embodiment of the present application, a flow diagram of an AES algorithm of quantum Grover attack may be as shown in fig. 2.
In exemplary embodiments of the present application, the AES algorithm may include, but is not limited to: AES-128, AES-196, AES-256, and S-AES (simplified advanced encryption Standard) algorithms. The scheme of the embodiment of the application is illustrated by taking AES-128 as an example.
In an exemplary embodiment of the present application, a quantum circuit diagram (one Grover iteration) of the AES-128 algorithm of quantum Grover attack may be as shown in fig. 3, and this circuit diagram is a quantum circuit diagram corresponding to the Grover iteration block in fig. 2. Wherein H is a Hadamard gate, X is a Paulix gate, P*AES corresponds to AES quantization circuit diagram of FIG. 2 (which is the scheme proposed in the embodiments of the present application), C*Indicating that the known cipher text is used as the control bit, p*AES-1Is P*The inverse of AES, CPF, represents conditional phase inversion.
In an exemplary embodiment of the present application, the encryption process of a conventional AES-128 is as shown in fig. 4, where the Initial key represents the Initial key; the field-text and Cipher represent known plain-ciphertext respectively; ARK represents an exclusive or operation (AddRoundKey) between ciphertext and plaintext; SB denotes a bit replacement operation; SR denotes a row shift operation; MC denotes a column obfuscation operation.
In the exemplary embodiment of the present application, quantization of the encryption process of AES-128 is the focus of the embodiment of the present application, where Initial key is the same as that in FIG. 3
Figure BDA0003081371250000061
Correspondingly, i.e. Hadamard operations are done for each bit of the key space (ciphertext matrix).
In the exemplary embodiment of the present application, the plaintext and the key each have 16 bytes, and may be written as a 4 × 4 matrix, with each element being a byte. The ciphertext thus encrypted is also a 4 × 4 matrix. ARK denotes performing an XOR operation on plaintext with the key as a control bit. The process is simple and will not be described in detail. Since the SR is a variation of bit position onlyTherefore, no additional operation is required, and thus SR can be completed by encoding the result of SB (bit replacement) at a position corresponding to SR without additional steps. SB is the most complex part, requiring each byte (8 bits) to be in the finite field GF (2)8) And (4) performing inversion, and performing corresponding affine transformation on the inversion to obtain the result of the SB. MC is an affine operation performed on a column of the ciphertext matrix in the encryption process.
In an exemplary embodiment of the present application, the process of subkey generation may mainly include SB (SB denotes modified SB) and RC (RC refers to exclusive or operation with a known 32-bit string).
In the exemplary embodiment of the present application, as shown in fig. 5, it is a sub-key generation circuit diagram newly designed in the embodiment of the present application, and it is possible to save the use of 320 qubits compared to the previous design scheme. SB denotes modified SB, i.e. the improved bit substitution operation, which is equivalent to adding an affine transformation in the previous bit Substitution (SB): assuming that the input is X and the initial state of the output bit is Y, the effect of SB can be expressed by the following equation: SB (X) ═ Y + SB (X).
In the exemplary embodiments of the present application, the embodiments of the present application are described in detail below.
In an exemplary embodiment of the present application, the encoding the sub-key generated in the current round onto the qubits (qubits) of the sub-key generated in the previous round may include:
coding the first m bits of the sub-keys obtained in the current round key generation process on the first m bits of the key space; the initial state of the first m bits of the key space is not 0;
wherein the key space refers to the qubits of the AES algorithm encoding key, e.g., for AES-128, the key space is the 128-bit qubits of the encoding key.
In exemplary embodiments of the present application, m may be adjusted accordingly according to different AES algorithms. For example, for AES-128, AES-196, AES-256, the m values are 32, 48, 64, respectively.
In an exemplary embodiment of the present application, previously for the quantization implementation of AES-128, each round of sub-key generation required 32qubits to store the sub-key of the new round, so the ten round of keys required 320 qubits to store the sub-keys. In the embodiment of the present application, the previous bit replacement circuit diagram is improved, so that the first 32-bit qubits of the sub-key of a new round can be encoded on the first 32-bit qubits of the previous round key whose initial state is not |0 >, and thus 320 qubits required for sub-key generation can be saved, which is equivalent to saving 1/3 qubits. Moreover, the new bit replacement coding mode can save a large number of quantum gates.
In the exemplary embodiment of the present application, the same idea can be applied to the quantization scheme of S-AES, and the use of 1/3qubits can also be reduced.
In an exemplary embodiment of the present application, the encoding the first m bits of the sub-keys obtained by the current round key generation process on the first m bits of the key space includes:
performing preset modified bit replacement operation on the key of the last m-bit qubits of the sub-keys obtained in the current round key generation process;
and executing exclusive or operation on a replacement result obtained after the replacement operation of the preset modified bit and a preset character string with the length of m bits of qubits to generate the previous m bits of qubits in the current round key generation process.
In an exemplary embodiment of the present application, the character string may be a binary string.
In an exemplary embodiment of the present application, a modified bit replacement operation (SB |) may be performed on a key of the last 32-bit quantum bit qubits of the current round key, and an exclusive or operation may be performed on the obtained replacement result (SB |) and a preset string of 32-bit qubits length, to generate a new first 32-bit qubits of the current round key. That is, the bit replacement operation result is stored on the first 32-bit qubits of the sub-key of the current round (or new round), and exclusive-or operation is performed with a known binary string of length 32qubits, so as to generate a new first 32-bit qubits key of the new sub-key of the current round.
In an exemplary embodiment of the present application, the performing of the preset modified bit replacement operation on the key of the last m bits of the sub-keys obtained by the current round of key generation process may include:
and finally, carrying out exclusive OR operation on the affine transformation result and the key of the first m bits of the key space.
In an exemplary embodiment of the present application, each byte (8 bits) is in the finite field GF (2)8) And performing the inversion, performing exclusive or operation on the key and the key of the first m bits of qubits of the key space, and performing corresponding affine change on the inversion to obtain a result SB.
In an exemplary embodiment of the present application, as shown in fig. 5, the result of SB is encoded on the bits of the previous encoding key, and the initial value of the bits of the previous encoding key is not |0 >.
In an exemplary embodiment of the present application, if an optimal SB quantum wire diagram needs to be output onto a bit with an initial state |0 >, i.e., the initial value of the bit of the encoding key is |0 >. In order to be able to use the optimal SB quantum wire diagram, the scheme shown in fig. 6 (schematic diagram of the transformation of the output bits in the SB × operation), i.e., the transformation of the output bits, is proposed. The final result is equivalent to the exclusive or operation between the bit replacement result and the initial code of the output space, which completes both the bit replacement and the corresponding exclusive or operation at the same time, and the specific scheme is as follows.
In an exemplary embodiment of the present application, the encoding the first m bits of the sub-keys obtained by the current round key generation process on the first m bits of the key space includes:
taking the latest m-th bits of qubits obtained in the current round key generation process as control bits, carrying out exclusive OR operation on the m-th to 2 m-th bits of qubits of the sub-keys obtained in the current round key generation process, and taking the exclusive OR operation result as the m-th to 2 m-th final keys in the current round key generation process;
taking the qubits corresponding to the m-th to 2 m-th final keys obtained in the current round key generation process as control bits, carrying out exclusive OR operation on the 2 m-3 m-th bits of the sub keys obtained in the current round key generation process, and taking the exclusive OR operation result as the 2 m-3 m-th final keys in the current round key generation process;
and taking the qubits corresponding to the final keys of the 2m to 3m bits obtained in the current round key generation process as control bits, carrying out XOR operation on the 3m to 4m bits of the sub keys obtained in the current round key generation process, and taking the XOR operation result as the final keys of the 3m to 4m bits in the current round key generation process.
In the exemplary embodiment of the present application, the above-mentioned solution can be analogized in turn until all the qubits are completed or operated in the current round key generation process.
In the exemplary embodiment of the present application, the above scheme can be applied to S-AES, and also can obtain better results, as shown in FIG. 7, which is a corresponding S-AES quantum wire diagram.
In an exemplary embodiment of the present application, in the quantized line diagram of S-AES in fig. 7, P denotes an exclusive or operation between a key and plaintext; SB denotes bit replacement; MC represents column obfuscation; RC represents an XOR operation with the known 8-bit qubits.
In an exemplary embodiment of the present application, the method may further include: the process of inverting each byte over a finite field is represented in the form of a boolean function.
In the exemplary embodiment of the present application, the number of bits of S-AES is small, and a more detailed quantized line diagram can be given, while GF (2) is over the finite field in SB operation4) The inversion can be expressed in the form of a Boolean function, under the expression of a standard basis, in the field GF (2)4) The boolean function of the inverse of the upper element may be expressed as follows:
y1=x2x3x4+x1x3+x2x3+x3+x4
y2=x1x3x4+x1x3+x2x3+x2x4+x4
y3=x1x2x4+x1x3+x1x4+x1+x2
y4=x1x2x3+x1x3+x1x4+x2x4+x2
in an exemplary embodiment of the present application, the transformed layout of the standard basis and the polynomial basis may be as shown in fig. 8.
In an exemplary embodiment of the present application, fig. 9 is a diagram of a quantized code of the boolean function described above, as an inversion quantum circuit over the S-AES finite field. The layout encodes the boolean function corresponding to the inversion process, using as few qubits as possible.
In an exemplary embodiment of the present application, fig. 10 is a fused line diagram of affine transformation and standard base to polynomial base mapping transformation in bit substitution.
In an exemplary embodiment of the present application, the improved advantages of the embodiment of the present application compared to previous work may be as shown in tables 1 and 2 below.
TABLE 1
Figure BDA0003081371250000101
TABLE 2
Figure BDA0003081371250000102
In an exemplary embodiment of the present application, Table 1 is a comparison of the quantum resources consumed by AES-128 against existing schemes. Table 2 compares the quantum resources consumed by S-AES with existing schemes.
In an exemplary embodiment of the present application, the transforming the quantum state of the key space to the required key state through multiple iterations may include:
by passing
Figure BDA0003081371250000103
And the secondary Grover iteration transfers the quantum state of the key space to the required key state, wherein n is the bit number of the key.
In an exemplary embodiment of the present application, a detailed embodiment of the encryption process quantization of the AES-128 and the quantum Grover attack AES algorithm is given below, which may include steps 1-20:
1. encoding the initial key into a 128-bit key space;
2. performing an exclusive-or operation on bits in a key space encoded with the initial key and a known plaintext;
3. bit replacement operation SB is carried out on the ciphertext subjected to the exclusive OR operation, and the bit replacement operation result is stored on the new 128-bit qubits according to the displacement rule of the row displacement RS;
4. repeatedly executing the step 2 to restore the initial key;
5. performing a column obfuscation operation MC on the restored initial key;
6. performing the operation of generating subkeys on the key space: performing modified bit replacement operation on the key of the last 32-bit qubs of the obtained sub-keys in the previous round, storing the modified bit replacement operation result on the previous 32 qubs and performing exclusive-or operation on the modified bit replacement operation result and a known binary string with the length of one 32 qubs to generate a new 32-bit qubs key, then taking the previous 32-bit qubs (namely, the new 32-bit qubs key) as a control bit, and performing exclusive-or operation on the subsequent 32-bit qubs of the 128-bit sub-keys in the current round to obtain a new 33-bit to 64-bit new key; and so on, generating the current round key;
7. taking the newly generated sub-key as a control bit, and performing exclusive or operation (AddRoundKey, abbreviated as ARK) on the ciphertext of the current state;
8. and repeating the steps 3, 5, 6 and 7 8 times.
9. Performing bit replacement operation (SB) on the ciphertext subjected to the XOR operation, and storing the result on the new 128-bit qubits according to the rule of row displacement (ShiftRow RS);
10. performing the operation of generating subkeys on the key space: performing modified bit replacement operation on the key of the last 32-bit qubs of the obtained sub-keys in the previous round, storing the modified bit replacement operation result on the key of the previous 32 qubs and performing exclusive-or operation on the modified bit replacement operation result and a known binary string with the length of one segment of 32 qubs to generate a new 32-bit qubs key, taking the previous 32-bit qubs (namely, the new 32-bit qubs key) as a control bit, and performing exclusive-or operation on the subsequent 32-bit qubs of the sub-keys in the current round 128 to obtain a new 33-bit to 64-bit new key; and so on, generating the current round key;
11. taking the newly generated key as a control bit, and carrying out exclusive OR operation (AddRoundKey) on the ciphertext of the current state; the final ciphertext is stored at the last 128-bit qubits;
12. the quantized line is used as an Oracle of a Grover algorithm, and the method comprises the following steps
Figure BDA0003081371250000111
(n is the bit number of the key) Grover iteration times to transfer the quantum state of the key space to the required key state;
13. the key space is measured to obtain the required key (the key space can be measured by any feasible method existing at present, and the specific method is not limited).
In the exemplary embodiment of the present application, the quantum circuit diagram of AES related to the embodiment of the present application is a basis of a quantum algorithm for a symmetric cryptographic attack, and the complexity of a quantum attack based on a Grover algorithm can be effectively reduced.
An embodiment of the present application further provides a key obtaining apparatus 1, as shown in fig. 11, which may include a processor 11 and a computer-readable storage medium 12, where the computer-readable storage medium 12 stores instructions, and when the instructions are executed by the processor, the key obtaining method described in any one of the above is implemented.
In the exemplary embodiments of the present application, any of the foregoing method embodiments may be applied to the apparatus embodiment, and are not described in detail herein.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, or suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as is well known to those skilled in the art.

Claims (9)

1. A key acquisition method, comprising:
realizing the quantization of an advanced encryption standard AES algorithm; the quantization of the AES algorithm comprises the following steps: encoding the sub-key generated in the current round to the qubits of the sub-key generated in the previous round;
taking an AES algorithm for realizing quantization as an Oracle of a Grover algorithm, and transferring the quantum state of a key space to a required key state through multiple iterations;
measuring the key space to obtain a required key;
wherein the encoding the sub-key generated in the current round to the qubits of the sub-key generated in the previous round comprises:
encoding the first m bits of sub keys obtained in the current round key generation process on the first m bits of the key space; the initial state of the first m bits of the key space is not 0;
wherein the key space refers to the qubits of the AES algorithm encoding key.
2. The method of claim 1, wherein encoding the first m bits of the sub-keys generated in the current round on the first m bits of the key space comprises:
performing preset modified bit replacement operation on the key of the last m-bit qubits of the sub-keys obtained in the current round key generation process;
and executing exclusive or operation on a replacement result obtained after the replacement operation of the preset modification bit and a preset character string with the length of m bits to generate the front m bits of qubits in the current round key generation process.
3. The key acquisition method according to claim 2, wherein the character string is a binary string.
4. The key obtaining method according to claim 2, wherein the performing of the preset modified bit replacement operation on the key of the last m bits of qubits of the sub-key obtained by the current round key generation process includes:
and finally, carrying out XOR operation on the affine transformation result and the key of the first m bits of the key space.
5. The key acquisition method according to claim 4, wherein the method further comprises: the process of inverting each byte over a finite field is represented in the form of a boolean function.
6. The key obtaining method of claim 1, wherein the encoding of the first m bits of the subkeys generated in the current round on the first m bits of the key space comprises:
taking the first m bits of qubits obtained latest in the current round key generation process as control bits, carrying out exclusive OR operation on the m-th to 2m bits of qubits of the sub-keys obtained in the current round key generation process, and taking the exclusive OR operation result as the m-th to 2m bits of final keys in the current round key generation process;
taking the qubits corresponding to the m-th to 2 m-th final keys obtained in the current round key generation process as control bits, carrying out exclusive OR operation on the 2 m-3 m-th bits of the sub keys obtained in the current round key generation process, and taking the exclusive OR operation result as the 2 m-3 m-th final keys in the current round key generation process;
and taking the qubits corresponding to the final keys of the 2m to 3m bits obtained in the current round key generation process as control bits, carrying out XOR operation on the 3m to 4m bits of the sub keys obtained in the current round key generation process, and taking the XOR operation result as the final keys of the 3m to 4m bits in the current round key generation process.
7. The key acquisition method according to any one of claims 1 to 5, wherein the AES algorithm comprises any one or more of: AES-128, AES-196, AES-256, and the simplified advanced encryption Standard S-AES algorithms.
8. The method of claim 6, wherein the transforming the quantum state of the key space to the desired key state through a plurality of iterations comprises:
by passing
Figure FDA0003696436040000021
And the sub Grover iteration transfers the quantum state of the key space to the required key state, wherein n is the bit number of the key, K represents a constant coefficient, and O () represents the order of magnitude of K.
9. A key acquisition apparatus comprising a processor and a computer-readable storage medium having stored therein instructions that, when executed by the processor, implement the key acquisition method of any one of claims 1-8.
CN202110581988.5A 2021-05-24 2021-05-24 Key obtaining method and device Active CN113328849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110581988.5A CN113328849B (en) 2021-05-24 2021-05-24 Key obtaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110581988.5A CN113328849B (en) 2021-05-24 2021-05-24 Key obtaining method and device

Publications (2)

Publication Number Publication Date
CN113328849A CN113328849A (en) 2021-08-31
CN113328849B true CN113328849B (en) 2022-07-22

Family

ID=77421565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110581988.5A Active CN113328849B (en) 2021-05-24 2021-05-24 Key obtaining method and device

Country Status (1)

Country Link
CN (1) CN113328849B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213050A (en) * 2019-06-04 2019-09-06 苏州科达科技股份有限公司 Key generation method, device and storage medium
WO2021000329A1 (en) * 2019-07-04 2021-01-07 深圳职业技术学院 Multi-party quantum key agreement method, computer terminal and storage device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PL424146A1 (en) * 2017-12-30 2019-07-01 Compsecur Spółka Z Ograniczoną Odpowiedzialnością Cryptosystem, a code with one-qubit key, intended for the entanglementencoding of quantum information
CN109889340A (en) * 2019-03-19 2019-06-14 北京信息科技大学 A kind of adaptive cipher key distribution mechanisms based on QKD network
CN110113149B (en) * 2019-04-29 2022-02-22 南通大学 Implementation method of quantum key expansion module for AES hardware encryption system
KR102482583B1 (en) * 2019-11-30 2022-12-28 채령 The multi-function matrix hash function block chain with video-audio broadcasting its system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213050A (en) * 2019-06-04 2019-09-06 苏州科达科技股份有限公司 Key generation method, device and storage medium
WO2021000329A1 (en) * 2019-07-04 2021-01-07 深圳职业技术学院 Multi-party quantum key agreement method, computer terminal and storage device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
相关密钥Square攻击AES-192;陈杰等;《电子科技大学学报》;20130330(第02期);全文 *

Also Published As

Publication number Publication date
CN113328849A (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CA2723319C (en) A closed galois field cryptographic system
JP4866389B2 (en) Closed Galois field combination
US10009170B2 (en) Apparatus and method for providing Feistel-based variable length block cipher
TWI571091B (en) Technologies for modifying a first cryptographic cipher with operations of a second cryptographic cipher
JP2009503580A (en) Symmetric key data encryption method
JP5539331B2 (en) Cryptosystem
CN111866018B (en) Data information encryption transmission method and device, computer equipment and storage medium
JP2008513811A (en) Calculation conversion method and system
JP5852518B2 (en) Authentication encryption device, authentication decryption device, and program
JP5273141B2 (en) Block cipher with adjustment value, cipher generation method and recording medium
JP3701969B2 (en) Nonlinear dynamic substitution device
JP2010524014A (en) A low complexity encryption method for content encoded by rateless codes
Donnet et al. Security of Y-00 under heterodyne measurement and fast correlation attack
Forgáč et al. Contribution to symmetric cryptography by convolutional neural networks
CN113328849B (en) Key obtaining method and device
CN107493164B (en) DES encryption method and system based on chaotic system
CN107835070B (en) Simple embedded encryption method
US10917232B1 (en) Data enciphering or deciphering using a hierarchical assignment system
Khairallah et al. Romulus: Lighweight aead from tweakable block ciphers
CN110071927B (en) Information encryption method, system and related components
CN110086619B (en) Key stream generation method and device
JP5578422B2 (en) ENCRYPTED COMMUNICATION SYSTEM, TRANSMISSION DEVICE, RECEPTION DEVICE, ENCRYPTION / DECRYPTION METHOD, AND PROGRAM THEREOF
KR101076747B1 (en) Method and apparatus for random accessible encryption and decryption by using a hierarchical tree structure of stream cipher module
CN117896064B (en) Superlattice twin PUF key synchronization method and system with low calculation overhead
KR101077973B1 (en) Method of encryption for binary data and System thereof

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