Quantum key expansion method, system, medium and terminal based on SM9 key exchange

By processing the quantum initial key and SM9 exchange key after quantum key negotiation, the extended key is generated, which solves the problem of insufficient quantum key generation speed, improves system security and supports unlimited length extension, overcoming the traditional key The exchange algorithm is not secure enough.

CN114021173BActive Publication Date: 2024-09-20SUNDIAL TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111346292.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2024-09-20
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

The existing quantum key generation speed is insufficient, resulting in insufficient keys, resulting in keys not being updated or recycled, reducing system security and robustness.

Method used

After the communicating parties complete quantum key negotiation, the quantum initial key and SM9 exchange key are obtained, and the extended key is generated using a symmetric encryption algorithm to support key expansion and avoid the problem of insufficient keys.

Benefits of technology

When the key amount is insufficient, the updated quantum level key is obtained through expansion, which improves security, supports unlimited length expansion, avoids the problem of insufficient keys, and is more secure than the traditional DH key exchange algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114021173B
    Figure CN114021173B
Patent Text Reader

Abstract

The invention provides a quantum key expansion method, system, medium and terminal based on SM9 key exchange. The method comprises the following steps: obtaining a quantum initial key after two communicating parties complete quantum key negotiation; obtaining an SM9 exchange key negotiated by the two communicating parties based on transmitted information; processing the quantum initial key and the SM9 exchange key to generate an extended key; when the key quantity is insufficient, the invention enables the two communicating parties to obtain an updated quantum-level key by extension; using the SM9 key exchange algorithm to negotiate extended key parameters, which is more secure than a traditional DH key exchange algorithm; using a safe and reliable key extension algorithm to process extended parameters, supporting key extension, and avoiding the problem of insufficient quantum keys; supporting multiple extension algorithms, supporting optional items for extended parameter transmission, and supporting unlimited key length extension without reducing key security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of physics, and in particular to quantum key technology, in particular to a quantum key expansion method, system, medium and terminal based on SM9 key exchange. Background Art

[0002] In the current quantum environment deployment, each quantum machine may be shared by multiple devices due to cost reasons (millions of RMB); the key generation speed of existing quantum machines is about 64KB per minute, and the quantum keys generated by the quantum machine are often insufficient.

[0003] A common approach to dealing with insufficient quantum keys is that the keys that originally needed to be updated will not be updated or recycled because of insufficient key parameters and renegotiated quantum keys. The keys may also directly return failure, resulting in data transmission interruption, which will reduce the security and robustness of the entire system. Summary of the invention

[0004] In view of the shortcomings of the prior art described above, the object of the present invention is to provide a quantum key expansion method, system, medium and terminal based on SM9 key exchange, which is used to solve the problem in the prior art that when the key parameters are insufficient, the key is not updated or is reused in a cycle, resulting in reduced security.

[0005] To achieve the above-mentioned object and other related objects, the present invention provides a quantum key extension method based on SM9 key exchange, comprising the following steps: obtaining a quantum initial key after the communicating parties complete quantum key negotiation; obtaining an SM9 exchange key negotiated by the communicating parties based on the transmitted information; processing the quantum initial key and the SM9 exchange key to generate an extended key.

[0006] In one embodiment of the present invention, the extended key includes N extended blocks; N is any positive integer.

[0007] In one embodiment of the present invention, the quantum initial key and the SM9 exchange key are processed to generate an extended key, including the following steps: obtaining a first key offset count corresponding to a first extended block; using the SM9 exchange key as a first initial value, performing an XOR operation on the first key offset count corresponding to the first extended block and the current first initial value to obtain an output vector; using the quantum initial key as a second initial value, symmetric encryption is performed on the second initial value and the current output vector using a symmetric encryption algorithm to obtain a first extended block; based on the strategy set by the communicating parties during negotiation, determining the value of N as n, so as to obtain n extended blocks according to the number of extended blocks in the extended key; wherein, the method for obtaining the i-th extended block includes the following steps: obtaining the i-th key offset count corresponding to the i-th extended block; using the i-1-th extended block as a first initial value, performing an XOR operation on the i-th key offset count corresponding to the i-th extended block and the current first initial value to obtain an output vector; using the symmetric encryption algorithm to symmetric encrypt the second initial value and the current output vector to obtain the i-th extended block; 2≤i≤n, i and n are integers.

[0008] In one embodiment of the present invention, the first key offset count is 1; the i-th key offset count is i.

[0009] In one embodiment of the present invention, the mode of the symmetric encryption algorithm is a calculator mode or a cipher block chaining mode.

[0010] In one embodiment of the present invention, the extended key is stored after the quantum initial key; when reading the key, the extended key is read sequentially backward.

[0011] The present invention provides a quantum key expansion system based on SM9 key exchange, comprising: a first acquisition module, a second acquisition module and a generation module; the first acquisition module is used to acquire a quantum initial key after two communicating parties complete quantum key negotiation; the second acquisition module is used to acquire an SM9 exchange key negotiated by the two communicating parties based on transmitted information; the generation module is used to process the quantum initial key and the SM9 exchange key to generate an extended key.

[0012] The present invention provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned quantum key expansion method based on SM9 key exchange is implemented.

[0013] The present invention provides a terminal, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the terminal executes the above-mentioned quantum key expansion method based on SM9 key exchange.

[0014] As described above, the quantum key expansion method, system, medium and terminal based on SM9 key exchange described in the present invention have the following beneficial effects:

[0015] (1) Compared with the prior art, the present invention can enable both communicating parties to obtain updated quantum-level keys by expansion when the key quantity is insufficient.

[0016] (2) The present invention uses the SM9 key exchange algorithm to negotiate extended key parameters, which is more secure than the traditional DH key exchange algorithm.

[0017] (3) The present invention uses a safe and reliable key expansion algorithm to process extension parameters, supports key expansion, and avoids the problem of insufficient quantum keys; supports multiple extension algorithms, and supports optional options for extending parameter transmission, and supports unlimited key length extension without reducing key security. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 Shown is a schematic structural diagram of a terminal in one embodiment of the present invention.

[0019] Figure 2 Shown is a flow chart of a quantum key expansion method based on SM9 key exchange in one embodiment of the present invention.

[0020] Figure 3 Shown is a schematic diagram of signaling interaction for negotiating quantum initial key and SM9 exchange key in one embodiment of the present invention.

[0021] Figure 4 It is a flowchart of an embodiment of the present invention for processing the quantum initial key and the SM9 exchange key using the extended encryption algorithm to generate an extended key.

[0022] Figure 5 FIG. 4 is a flow chart of a method for obtaining an i-th extended block according to an embodiment of the present invention.

[0023] Figure 6 FIG. 1 is a diagram showing the working principle of generating an extended key in one embodiment of the present invention.

[0024] Figure 7 Shown is a schematic diagram of the structure of a quantum key expansion system based on SM9 key exchange in one embodiment of the present invention. DETAILED DESCRIPTION

[0025] The following describes the embodiments of the present invention through specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0027] Compared with the prior art, the quantum key expansion method, system, medium and terminal based on SM9 key exchange of the present invention can enable the communicating parties to obtain updated quantum-level keys by expansion when the key quantity is insufficient; the present invention uses the SM9 key exchange algorithm to negotiate extended key parameters, which is more secure than the traditional DH key exchange algorithm; the present invention uses a safe and reliable key expansion algorithm to process extended parameters, supports key expansion, and avoids the problem of insufficient quantum keys; supports multiple extension algorithms, and supports optional options for extended parameter transmission, and supports unlimited key length extension without reducing key security.

[0028] The storage medium of the present invention stores a computer program, and when the computer program is executed by a processor, the following quantum key expansion method based on SM9 key exchange is implemented. The storage medium includes: a read-only memory (ROM), a random access memory (RAM), a disk, a USB flash drive, a memory card or an optical disk, etc., which can store program codes.

[0029] Any combination of one or more storage media may be used. The storage medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0030] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0031] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0032] Computer program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0033] The present invention will be described below with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, thereby producing a machine so that these computer program instructions, when executed by the processor of the computer or other programmable data processing device, produce a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0034] These computer program instructions may also be stored in a computer-readable medium, which enables a computer, other programmable data processing apparatus, or other device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce an article of manufacture including instructions for implementing the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0035] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0036] The terminal of the present invention includes a processor and a memory.

[0037] The memory is used to store computer programs; preferably, the memory includes: ROM, RAM, disk, USB flash drive, memory card or CD, etc., which can store program codes.

[0038] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the terminal executes the following quantum key expansion method based on SM9 key exchange.

[0039] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0040] Figure 1 A block diagram of an exemplary terminal 1 suitable for implementing embodiments of the present invention is shown.

[0041] Figure 1 The terminal 1 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0042] like Figure 1 As shown, the terminal 1 is in the form of a general-purpose computing device. The components of the terminal 1 may include, but are not limited to: one or more processors or processing units 11, a memory 12, and a bus 13 connecting different system components (including the memory 12 and the processing unit 11).

[0043] The bus 13 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0044] The terminal 1 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the terminal 1, including volatile and non-volatile media, removable and non-removable media.

[0045] The memory 12 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 121 and / or cache memory 122. The terminal 1 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 123 may be used to read and write non-removable, non-volatile magnetic media ( Figure 1 not shown, usually called a "hard drive"). Although Figure 1 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 13 via one or more data medium interfaces. The memory 12 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0046] A program / utility 124 having a set (at least one) of program modules 1241 may be stored, for example, in the memory 12, such program modules 1241 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 1241 generally perform the functions and / or methods of the embodiments described herein.

[0047] The terminal 1 may also communicate with one or more external devices 2 (e.g., keyboard, pointing device, display 3, etc.), one or more devices that enable a user to interact with the terminal 1, and / or any device that enables the terminal 1 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 14. Furthermore, the terminal 1 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 15. Figure 1 As shown, the network adapter 15 communicates with other modules of the terminal 1 via the bus 13. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the terminal 1, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0048] like Figure 2 As shown, in one embodiment, the quantum key expansion method based on SM9 key exchange of the present invention includes the following steps:

[0049] Step S1: After the communicating parties complete the quantum key negotiation, obtain the quantum initial key.

[0050] It should be noted that the principle of traditional quantum key negotiation is as follows:

[0051] Quantum key negotiation requires the transmission of the negotiated session key ID, denoted as SessionID, in the traditional channel. The communicating parties use the same SessionID to apply for the same quantum initial key, denoted as QT_Key.

[0052] SessionID structure:

[0053] 3byte 1byte UTC_time Random

[0054] Key ID structure:

[0055] 4byte 4byte SessionID offset

[0056] The key data negotiated by both parties (i.e., the quantum initial key in step S1) is cached in the memory. When obtaining the key, the key is read from the cache according to the key ID.

[0057] Step S2: Obtain the SM9 exchange key negotiated by the communicating parties based on the transmitted information.

[0058] Step S3: Process the quantum initial key and the SM9 exchange key to generate an extended key.

[0059] Specifically, in the current extended key negotiation scheme, the transmitted information is added, and a new shared key is negotiated based on the transmitted information, that is, the SM9 exchange key in step S2, recorded as S_Key, and then parameters such as QT_Key and S_Key are processed to obtain the final extended key of specified length or unlimited length.

[0060] In one embodiment, the extended key includes N extended blocks.

[0061] It should be noted that N can be any positive integer.

[0062] It should be noted that the basic structure of the negotiated transmission data is as follows:

[0063] 4byte 4byte 1byte 1byte 1byte 1byte R_len byte S_len byte SessionID Extension Cipher_suite Block_num R_len S_len R S

[0064] Among them, the SessionID structure is consistent with the original structure; Extension is the extension field, which is used to store information such as the version number; the Cipher_suite field saves the extended encryption algorithm suite; the Block_num field saves the number of extended key blocks (i.e., extension blocks); the R_len field is the length of the bit string of the key negotiation parameter R; the S_len field is the bit string length of the negotiation parameter S; R and S are both key negotiation parameters.

[0065] It should be noted that the process of SM9 key exchange is as follows:

[0066] Step A is the operation of the key exchange initiator, and step B is the operation of the key exchange responder (the key exchange initiator and the key exchange responder are the above-mentioned two communicating parties).

[0067] A1. Calculate the element QB=[H1(IDB||hid,N)]P1+Ppub in the group G1.

[0068] A2. Generate a random number rA.

[0069] A3. Calculate the element RA=[rA]QB in the group G1.

[0070] A4. Send RA to user B.

[0071] B1. Calculate the element QA=[h1(IDA||hid,N)]P1+Ppub in the group G1.

[0072] B2. Generate a random number rB.

[0073] B3. Calculate the element RB=[rB]QA in the group G1.

[0074] B4. Verify that RA belongs to G1. Compute the elements g1 = e(RA, dB), g2 = e(Ppub, P2)rB, g3 = G1rB in the group GT. Convert g1, g2, g3 into bit strings.

[0075] B5. Convert the data types of RA and RB into bit strings and calculate

[0076] SKB=KDF(IDA||IDB||RA||RB||g1||g2||g3,klen).

[0077] B6. (option) Calculate SB = Hash(0x82||g1||Hash(g2||g3||IDA||IDB||RA||RB)).

[0078] B7. Send RB, (option SB) to user A.

[0079] A5. Verify that RB∈G1 holds. Compute the elements g'1=e(Ppub,P2)rA, g'2=e(RB,dA), g'3=(g'2)rA in the group GT. Convert the data types of g'1, g'2, g'3 into bit strings.

[0080] A6. Convert the data types of RA and RB into bit strings. (optional) Calculate

[0081] S1=Hash(0x82||g'1||Hash(g'2||g'3||IDA||IDB||RA||RB)), and check whether S1=SB holds.

[0082] A7. Calculate SKA=KDF(IDA||IDB||RA||RB||g'1||g'2||g'3,klen).

[0083] A8. (Option) Calculate SA = Hash(0x83||g'1||Hash(g'2||g'3||IDA||IDB||RA||RB), and send SA to user B.

[0084] B8. (optional) Calculate S2=Hash(0x83||g1||Hash(g2||g3||IDA||IDB||RA||RB), and check whether S2=SA holds.

[0085] RA and RB are key negotiation parameters R; SA and SB are key negotiation parameters S; SA and SB are optional and require an additional interaction for transmission. You can choose whether to use them based on actual conditions.

[0086] It should be noted that the system parameters in the above SM9 key exchange process are as follows:

[0087] GT: cyclic multiplicative group of order prime number N;

[0088] G1: cyclic additive group of order prime number N;

[0089] G2: cyclic additive group of order prime number N;

[0090] Hv H1()H2(): cryptographic hash function;

[0091] hid: a byte selected and published by KGC as part of the input of H1;

[0092] dA: user’s private key;

[0093] e: Bilinear and non-degenerate pairs from G1×G2 to GT;

[0094] P1: Generator of G1;

[0095] P2: Generator of G2;

[0096] Ppub: master public key;

[0097] s: master private key;

[0098] IDA: User identification, public information.

[0099] It should be noted that the above steps S1 and S2 are performed interactively.

[0100] The working principles of step S1 and step S2 will be further explained below with reference to the accompanying drawings.

[0101] like Figure 3 As shown, in one embodiment, the two communicating parties are Figure 3 The initiator and responder in the process; specifically, the principles for obtaining the quantum initial key and the SM9 exchange key are as follows:

[0102] First, the initiator generates a SessionID and applies for the quantum initial key from quantum machine A. Quantum machine A returns the quantum initial key to the initiator. The initiator calculates the SM9 parameter - RA and sends information such as RA and SessionID to the responder.

[0103] Then, the responder uses SessionID to obtain the quantum initial key QT_Key. The responder obtains the quantum key from quantum machine B through SessionID. The key is consistent with the quantum initial key returned by quantum machine A in the previous step, both of which are QT_Key. The responder calculates the SM9 parameters - SKB, RB, SB (optional), and sends the RB and SB (optional) to the initiator.

[0104] Finally, the initiator calculates the SM9 parameter SKA, calculates S1, verifies SB (optional), SKA=SKB, and sends SA (optional) to the responder; at the same time, the initiator calculates the extended key based on QT_Key and SKA.

[0105] The responder calculates S2, verifies SA (optional), and calculates the extended key based on QT_Key and SKB.

[0106] like Figure 4 As shown, in one embodiment, the quantum initial key and the SM9 exchange key are processed to generate an extended key, including the following steps:

[0107] Step S31: Obtain a first key offset count corresponding to a first extended block.

[0108] Specifically, according to a preset key offset count rule, a first key offset count corresponding to the first extended block is determined.

[0109] It should be noted that the key offset counting rule is pre-set, and the specific setting is not a condition to limit the present invention.

[0110] Step S32: Use the SM9 exchange key as the first initial value, perform an XOR operation on the first key offset count corresponding to the first extended block and the current first initial value to obtain an output vector.

[0111] Specifically, an XOR operation is performed on the first key offset count corresponding to the first extended block and the SM9 exchange key S_Key to obtain an output vector.

[0112] Step S33: Use the quantum initial key as a second initial value, and use a symmetric encryption algorithm to symmetrically encrypt the second initial value and the current output vector to obtain a first extended block.

[0113] Specifically, in the extended encryption process, according to the above Cipher_suite, a symmetric encryption algorithm is obtained; then, the quantum initial key QT_Key and the output vector obtained in step S32 are symmetrically encrypted using the symmetric encryption algorithm to obtain the first extended block.

[0114] In one embodiment, the mode of the symmetric encryption algorithm is a counter mode (CTR) or a cipher block chaining mode (CBC).

[0115] Step S34: Based on the strategy set by the communicating parties during negotiation, determine the value of N as n, so as to obtain n extended blocks according to the number of extended blocks in the extended key.

[0116] It should be noted that the extended key supports unlimited length extension. In practical applications, the number of times the extended key is calculated, that is, how many extended blocks are obtained, can be determined according to the strategy set by the communicating parties during negotiation.

[0117] like Figure 5 As shown, in one embodiment, the method for obtaining the i-th extended block includes the following steps:

[0118] Step S41: Obtain the i-th key offset count corresponding to the i-th extended block.

[0119] It should be noted that the principle of step S41 refers to the above step S31 and will not be repeated here.

[0120] In one embodiment, the first key offset count is 1; the i-th key offset count is i, that is, the corresponding preset key offset count rule is that the first key offset count is 1, and the i-th key offset count is i.

[0121] Step S42: take the i-1th extended block as the first initial value, perform an XOR operation on the i-th key offset count corresponding to the i-th extended block and the current first initial value to obtain an output vector.

[0122] Assuming that the i-1th extended block is recorded as Blocki-1 and the i-th extended block is recorded as Blocki, then in step S42, the i-th key offset count corresponding to the i-th extended block is XORed with Blocki-1 to obtain an output vector.

[0123] Step S43: Use the symmetric encryption algorithm to symmetric-encrypt the second initial value and the current output vector to obtain an i-th extended block.

[0124] Specifically, the quantum initial key QT_Key and the output vector obtained in step S42 are symmetrically encrypted using a symmetric encryption algorithm to obtain the i-th extended block.

[0125] It should be noted that 2≤i≤n, where i is an integer.

[0126] The method of generating the extended key in step S3 is further explained below through a specific embodiment.

[0127] like Figure 6 As shown, in one embodiment, the generated extended key includes three extended blocks, namely the first extended block, the second extended block and the third extended block, which are respectively recorded as Block1, Block2 and Block3; the output vector is recorded as IV; the symmetric encryption is recorded as Enc; the key offset count is recorded as Counter, and the i-th Counter=i, then the principle of generating the extended key is as follows:

[0128] First, perform XOR operation on S_Key and Counter=1 (corresponding to Figure 6 In ), obtain the output vector IV; then, symmetric encryption (Enc) is performed on QT_Key and the current output vector IV to obtain the first extended block Block1; specifically, QT_Key is used as the encryption key, and the output vector IV is used as iv to symmetric encrypt the all-zero data.

[0129] Block1 is XORed with Counter=2 to obtain the output vector IV; then, QT_Key and the current output vector IV are symmetrically encrypted to obtain the second extended block Block2.

[0130] Block2 is XORed with Counter=3 to obtain the output vector IV; then, QT_Key and the current output vector IV are symmetrically encrypted to obtain the third extended block Block3.

[0131] It should be noted that the extended blocks are stored in sequence to form an extended key, such as, Figure 6 The extended key generated in is: Block1+Block2+Block3.

[0132] In one embodiment, the extended key is stored after the quantum initial key; when reading the key, the extended key is read sequentially backward.

[0133] Specifically, the extended key is stored behind the cached QT_Key, and when reading the key, the extended key is read backward in sequence.

[0134] Furthermore, according to the policy set during negotiation, if unlimited length extension is supported, when the read key is insufficient, a new extended key is temporarily calculated backwards.

[0135] It should be noted that the protection scope of the quantum key expansion method based on SM9 key exchange described in the present invention is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.

[0136] like Figure 7 As shown, in one embodiment, the quantum key expansion system based on SM9 key exchange of the present invention includes a first acquisition module 71, a second acquisition module 72 and a generation module 73.

[0137] The first acquisition module 71 is used to obtain the quantum initial key after the communicating parties complete the quantum key negotiation.

[0138] The second acquisition module 72 is used to obtain the SM9 exchange key negotiated by the communicating parties based on the transmitted information.

[0139] The generating module 73 is used to process the quantum initial key and the SM9 exchange key to generate an extended key.

[0140] It should be noted that the structures and principles of the first acquisition module 71, the second acquisition module 72 and the generation module 73 correspond one-to-one to the steps (steps S1 to S3) in the above-mentioned quantum key expansion method based on SM9 key exchange, so they will not be repeated here.

[0141] It should be noted that it should be understood that the division of the various modules of the above system is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the x module can be a separately established processing element, or it can be integrated in a certain chip of the above system for implementation. In addition, it can also be stored in the memory of the above system in the form of program code, and called and executed by a certain processing element of the above system. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0142] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0143] It should be noted that the quantum key expansion system based on SM9 key exchange of the present invention can implement the quantum key expansion method based on SM9 key exchange of the present invention, but the implementation device of the quantum key expansion method based on SM9 key exchange of the present invention includes but is not limited to the structure of the quantum key expansion system based on SM9 key exchange listed in this embodiment. All structural deformations and replacements of the prior art made according to the principles of the present invention are included in the protection scope of the present invention.

[0144] In summary, compared with the prior art, the quantum key expansion method, system, medium and terminal based on SM9 key exchange of the present invention can enable the communicating parties to obtain updated quantum-level keys by expansion when the key amount is insufficient; the present invention uses the SM9 key exchange algorithm to negotiate extended key parameters, which is more secure than the traditional DH key exchange algorithm; the present invention uses a safe and reliable key expansion algorithm to process extended parameters, supports key expansion, and avoids the problem of insufficient quantum keys; supports multiple extension algorithms, and extended parameter transmission supports optional options, and supports unlimited key length extension without reducing key security; therefore, the present invention effectively overcomes the various shortcomings of the prior art and has a high industrial utilization value.

[0145] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A quantum key expansion method based on SM9 key exchange, characterized in that: The following steps are involved: After the communicating parties complete the quantum key negotiation, the quantum initial key is obtained; Obtaining the SM9 exchange key negotiated by the communicating parties based on the transmitted information; Processing the quantum initial key and the SM9 exchange key to generate an extended key; The extended key includes N extended blocks; N is any positive integer; the quantum initial key and the SM9 exchange key are processed to generate the extended key, including the following steps: Get the first key offset count corresponding to the first extended block; Taking the SM9 exchange key as a first initial value, performing an XOR operation on a first key offset count corresponding to a first extension block and the current first initial value to obtain an output vector; Using the quantum initial key as a second initial value, and using a symmetric encryption algorithm to symmetrically encrypt the second initial value and the current output vector to obtain a first extended block; Based on the strategy set by the communicating parties during negotiation, the value of N is determined to be n, so as to obtain n extended blocks according to the number of extended blocks in the extended key; wherein the method for obtaining the i-th extended block includes the following steps: Get the i-th key offset count corresponding to the i-th extended block; Taking the i-1th extended block as the first initial value, performing an XOR operation on the i-th key offset count corresponding to the i-th extended block and the current first initial value to obtain an output vector; The second initial value and the current output vector are symmetrically encrypted using the symmetric encryption algorithm to obtain an i-th extended block; 2≤i≤n, i and n are integers.

2. The quantum key expansion method based on SM9 key exchange according to claim 1, characterized in that: The first key offset count is 1; the i-th key offset count is i.

3. The quantum key expansion method based on SM9 key exchange according to claim 1, characterized in that: The mode of the symmetric encryption algorithm is calculator mode or cipher block chaining mode.

4. The quantum key expansion method based on SM9 key exchange according to claim 1, characterized in that: The extended key is stored after the quantum initial key; when reading the key, the extended key is read backward in sequence.

5. A quantum key expansion system based on SM9 key exchange implements the quantum key expansion method according to any one of claims 1 to 4, characterized in that: include: A first acquisition module, a second acquisition module and a generation module; The first acquisition module is used to obtain the quantum initial key after the communicating parties complete the quantum key negotiation; The second acquisition module is used to obtain the SM9 exchange key negotiated by the communicating parties based on the transmitted information; the generation module is used to process the quantum initial key and the SM9 exchange key to generate an extended key.

6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the quantum key expansion method based on SM9 key exchange described in any one of claims 1 to 4 is implemented.

7. A terminal, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the terminal executes the quantum key expansion method based on SM9 key exchange described in any one of claims 1 to 4.