Key generation methods, apparatus and related products
By dividing the original binary key, phase mapping and phase offset processing, the reconstruction key is generated, which solves the problem of key expansion and achieves infinite expansion and high security performance of the key.
Patent Information
- Application Number
- CN202411320657.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In the prior art, due to the limited storage space of the data sender and the receiver, the number of pre-charged keys is limited, making it difficult to effectively expand the key.
By dividing the original binary key into key segments, mapping it into phase according to phase mapping rules, and performing phase offset processing, and finally generating a reconstruction key according to the reflection rules, realizing infinite expansion of the key.
There is no need to apply for and store additional keys from third parties, which takes up less storage space, and the generated reconstruction keys have high security performance and the key type is the same as the original key.
Smart Images

Figure CN118842586B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of key technology, and in particular to a key generation method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] In the related art, the data sender and the data receiver often use pre-filled keys for data transmission. However, due to the limited storage space of the device where the data receiver or the data sender is located, the number of pre-filled keys they can use is limited.
[0004] The technical problem to be solved by this application is how to expand a limited key. Summary of the invention
[0005] The purpose of the present disclosure is to provide a key generation method, device, electronic device, computer-readable storage medium and computer program product, which can safely and effectively reconstruct a new key based on the original binary key.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] The embodiment of the present disclosure provides a key generation method, including: determining an original binary key; dividing the original binary key to obtain at least one key segment; mapping each key segment to a phase according to a phase mapping rule; performing phase shift processing on the phase corresponding to each key segment according to a target phase shift value to obtain at least one shifted phase; inversely mapping the at least one shifted phase to at least one new key segment according to a phase inverse mapping rule; and splicing the new key segments to generate a reconstructed key.
[0008] In some embodiments, the original binary key is divided to obtain at least one key segment, including: obtaining the number of key segment bits; and dividing the original binary key according to the number of key segment bits to obtain the at least one key segment.
[0009] In some embodiments, the method further includes: determining that the number of bits of the last key segment of the at least one key segment is less than the number of bits of the key segment; padding the last key segment of the at least one key segment by a preset binary value; or discarding the last key segment of the at least one key segment.
[0010] In some embodiments, each key segment is mapped to a phase according to a phase mapping rule, including: mapping each key segment to a modulation constellation diagram to determine a target symbol corresponding to the key segment on the modulation constellation diagram; determining the coordinates of each target symbol on the modulation constellation diagram, wherein the coordinates of the target symbol include phase information.
[0011] In some embodiments, phase offset processing is performed on the phases corresponding to the respective key segments according to the target phase offset value to obtain at least one offset phase, including: phase offset processing is performed on the coordinates corresponding to the respective key segments according to the target phase offset value to obtain at least one offset coordinate, wherein the offset coordinate includes phase information.
[0012] In some embodiments, before performing phase offset processing on the phases corresponding to the respective key segments according to the target phase offset value, the method further includes: obtaining a plurality of phase differences corresponding to the modulation constellation diagram, wherein the phase difference is used to describe the phase difference between two symbols in the modulation constellation diagram; and determining the target phase offset value among the plurality of phase differences.
[0013] In some embodiments, the at least one offset phase is de-mapped into at least one new key segment according to a phase de-mapping rule, including: comparing the modulation constellation diagram, resolving the at least one offset coordinate into the at least one new key segment.
[0014] In some embodiments, the key generation method is applied to a first device, and the first device and a second device share and store multiple preset keys; wherein determining the original binary key includes: determining the original binary key among the multiple preset keys; the method also includes: the first device sending the key identifier of the original binary key to the second device, so that the second device generates the reconstructed key based on the original binary key.
[0015] In some embodiments, the key generation method is applied to a first device, and the first device and a second device share and store multiple preset keys; wherein, determining the original binary key includes: receiving a key identifier from the second device, wherein the key identifier is an identifier of the original binary key determined by the second device from the multiple preset keys stored in the second device; and determining the original binary key from the multiple preset keys stored in the first device according to the key identifier.
[0016] In some embodiments, the key generation method is applied to a first device; wherein, determining the original binary key includes: carrying a secure medium on the first device to a key filling point to fill multiple preset keys offline, wherein the multiple preset keys are used to communicate with a second device; each time the first device communicates with the second device, a preset key is consumed; when the multiple preset keys are consumed, the original binary key is determined.
[0017] The embodiment of the present disclosure provides a key generation device, including: an original key determination module, a key division processing module, a phase mapping module, a phase shift module, a reverse mapping module and a key segment splicing module.
[0018] Among them, the original key determination module is used to determine the original binary key; the key division processing module can be used to divide the original binary key to obtain at least one key segment; the phase mapping module can be used to map each key segment into a phase according to a phase mapping rule; the phase offset module can be used to perform phase offset processing on the phase corresponding to each key segment according to a target phase offset value to obtain at least one offset phase; the inverse mapping module can be used to inversely map the at least one offset phase into at least one new key segment according to a phase inverse mapping rule; the key segment splicing module can be used to splice the new key segments to generate a reconstructed key.
[0019] An embodiment of the present disclosure provides an electronic device, which includes: a memory and a processor; the memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement any of the key generation methods described above.
[0020] The embodiment of the present disclosure provides a computer-readable storage medium on which computer program instructions are stored to implement the key generation method as described in any one of the above items.
[0021] The embodiment of the present disclosure provides a computer program product or a computer program, which includes computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the above-mentioned key generation method.
[0022] The key generation method, device, electronic device, computer-readable storage medium and computer program product provided by the embodiments of the present disclosure can first divide the original binary key, then map each divided key segment to a phase, then offset the mapped phase, and finally reversely map it to a reconstructed key. The key generated by the above method can, on the one hand, infinitely expand the original binary key without applying to a third party for and storing the binary key, and without occupying too much storage space; on the other hand, the key type of the reconstructed key is the same as the original binary key, and a binary key with higher security performance can be generated without applying to a third party.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0025] Figure 1 A schematic diagram of a scenario that can be applied to a key generation method or a key generation device in an embodiment of the present disclosure is shown.
[0026] Figure 2 The present invention is a flowchart of a key generation method according to an exemplary embodiment.
[0027] Figure 3 The present invention is a flowchart of a method for generating a key segment according to an exemplary embodiment.
[0028] Figure 4 The present invention is a flowchart of a method for generating a key segment according to an exemplary embodiment.
[0029] Figure 5 The present invention is a flowchart of a method for generating a key segment according to an exemplary embodiment.
[0030] Figure 6 A modulation constellation diagram is shown according to an exemplary embodiment.
[0031] Figure 7 A key generation method is shown according to an exemplary embodiment.
[0032] Figure 8 A key generation method is shown according to an exemplary embodiment.
[0033] Fig. 9 It is a framework diagram corresponding to a key generation method according to an exemplary embodiment.
[0034] Fig.10 The figure is an interaction diagram corresponding to a key generation method according to an exemplary embodiment.
[0035] Fig.11 The invention is a block diagram of a key generating device according to an exemplary embodiment.
[0036] Fig.12 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0037] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0038] Those skilled in the art will appreciate that the embodiments of the present disclosure may be a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0039] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0040] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0041] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0042] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0043] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different; the terms "comprising", "including" and "having" are used to express the meaning of open inclusion and mean that in addition to the listed elements / components / etc., there may be other elements / components / etc.
[0044] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0045] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0046] First, some terms involved in the embodiments of the present disclosure are explained below to facilitate understanding by those skilled in the art.
[0047] QKD (Quantum Key Distribution): A method and process based on the basic principles of quantum mechanics that ensures that both communicating parties can generate a string of identical random numbers that cannot be obtained by attackers as a shared key.
[0048] QRNG (Quantum Random Number Generator): Quantum random number generation technology utilizes the randomness of quantum mechanics and generates true random numbers based on quantum principles.
[0049] The security of quantum keys:
[0050] 1. Detection of secret attack: Since the quantum state will be destroyed when it is measured during transmission, once someone steals the password, it will be detected by both parties in the communication;
[0051] 2. Complete confidentiality: Even if the attacker has unlimited computing resources and time, he cannot crack the quantum key. This is because the security of the quantum key is based on the basic principles of quantum mechanics, not computational complexity;
[0052] 3. Completely secret transferability: No matter what method the attacker uses to attack the transmission process, the quantum key is completely confidential during the transmission process. This is because the non-cloning of quantum states and the uncertainty principle ensure the security of information during transmission.
[0053] In summary, the reason why quantum keys are considered safe is that they are based on the basic principles of quantum mechanics and the security design of quantum key distribution protocols, as well as the advantages of quantum keys themselves. These factors together constitute the security foundation of quantum keys, making quantum key distribution a highly secure communication method.
[0054] The foregoing introduces some terms and concepts involved in the embodiments of the present disclosure. The following introduces the technical features involved in the embodiments of the present disclosure.
[0055] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0056] Figure 1 A schematic diagram of a scenario that can be applied to a key generation method or a key generation device in an embodiment of the present disclosure is shown.
[0057] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present disclosure.
[0058] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0059] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart homes, etc.
[0060] The server 105 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received request data, and feed back the processing results to the terminal device.
[0061] The server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as basic cloud computing services such as big data and artificial intelligence platforms, etc. The present disclosure does not impose any restrictions on this.
[0062] The server 105 may, for example, determine the original binary key; the server 105 may, for example, divide the original binary key to obtain at least one key segment; the server 105 may, for example, map each key segment to a phase according to a phase mapping rule; the server 105 may, for example, perform phase shift processing on the phases corresponding to the each key segment according to a target phase shift value to obtain at least one shifted phase; the server 105 may, for example, de-map the at least one shifted phase into at least one new key segment according to a phase de-mapping rule; the server 105 may, for example, splice the new key segments to generate a reconstructed key.
[0063] It should be understood that Figure 1 The number of terminal devices, networks and servers in the figure is only for illustration. The server 105 may be a physical server or may be composed of multiple servers. According to actual needs, it may have any number of terminal devices, networks and servers.
[0064] Under the above system architecture, a key generation method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0065] Figure 2 The method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities. For example, the method can be executed by the above-mentioned Figure 1 The server or terminal device in the embodiment may be executed, or the server and the terminal device may be executed together. In the following embodiments, an electronic device is taken as an example for illustration, but the present disclosure is not limited to this.
[0066] In some embodiments, the following Figure 2 The illustrated embodiments may be implemented on a device of a data sender, may be implemented on a device of a data receiver, or may be implemented by both the data receiver and the data sender at the same time, and this application does not impose any limitation on this.
[0067] The data sender and the data receiver can perform secure data communication based on the original binary key or the reconstructed key.
[0068] Reference Figure 2 The key generation method provided by the embodiment of the present disclosure may include the following steps.
[0069] Step S202, determining the original binary key.
[0070] In some embodiments, the original binary key may be an original binary key that pre-exists in an electronic device (eg, the first device or the second device).
[0071] A binary key refers to a key represented as a string of binary digits consisting of 0 and 1. In a computer system, a key is usually represented as a binary value for encryption and decryption operations, such as 010101001, 01111000, etc. This application does not limit the length of the binary key.
[0072] In some embodiments, the original binary key may be a quantum key, which may be a key that is injected offline from the first device or the second device to a key injection point, and the first device and the second device may use the quantum key to communicate securely between the first device and the second device.
[0073] In some embodiments, it is assumed that the above-mentioned key generation method can be applied to a first device, which can be a data sender, and the first device and a second device (which can be a data receiver) can share and store multiple preset keys (the multiple preset keys can include original binary keys, and the first device and the second device can communicate securely through the multiple preset keys).
[0074] It should be noted that during the communication process, the data sending and data receiving roles of the first device and the second device may change, and this application does not limit this. For example, in the key generation process this time, the first device is the data sender and the second device is the data receiver; in the next key generation process, the first device may be the data receiver and the second device may be the data sender.
[0075] In some embodiments, the first device and the second device may store a plurality of preset keys in common, and the first device and the second device may communicate securely through the keys. The key generation method may be applied to both the first device and the second device, and this application does not limit this.
[0076] In some embodiments, assuming that the above-mentioned key generation method can be used for the first device, and the first device plays the role of the data sender in the key generation process, then determining the original binary key may include: the first device determines the original binary key from multiple preset keys. In some embodiments, after the multiple preset keys determine the original binary key, the first device may send the key identifier of the original binary key to the second device so that the second device generates a reconstructed key based on the original binary key. For example, after receiving the key identifier, the second device can filter out the original binary key specified by the first device from the multiple preset keys stored in itself, and then execute the same key generation method as the first device to generate the reconstructed key. In this way, the reconstructed keys generated by the first device and the second device are exactly the same.
[0077] In some embodiments, assuming that the above key generation method can be used for the first device, and the first device plays the role of a key receiver in the key generation process, then determining the original binary key may include: receiving a key identifier from the second device, wherein the key identifier is an identifier of the original binary key determined by the second device from multiple preset keys stored in the second device; determining the original binary key from multiple preset keys stored in the first device according to the key identifier; and then executing the same key generation method as the second device to generate a reconstructed key. In this way, the reconstructed keys generated by the first device and the human device are exactly the same.
[0078] In some embodiments, the first device or the second device goes to a key charging point to charge multiple preset keys offline, where the multiple preset keys are used to communicate with the second device; then the first device consumes one preset key each time it communicates with the second device; when the multiple preset keys are consumed, the first device or the second device determines (e.g., randomly determines) the original binary key from the multiple preset keys to generate a reconstructed key.
[0079] Step S204: divide the original binary key to obtain at least one key segment.
[0080] In some embodiments, the original binary key may be binary data (such as a binary string), and the original binary key may be segmented to obtain the at least one key segment. It should be noted that the original binary key may be obtained by concatenating the at least one key segment.
[0081] For example, assuming that the original binary key is 011100011011, then at least one key segment obtained after division may include: 01, 11, 00, 01, 10, 11, or 011, 100, 011, 011. It is understandable that if the number of key segment digits (or bits) preset during division is different (such as 2, 3, 4, etc. bits / digits), then the key segments finally generated may also be different, and this application does not impose any limitation on this.
[0082] Each key segment may also be a binary data.
[0083] Step S206: Map each key segment to a phase according to a phase mapping rule.
[0084] In some embodiments, the phase mapping rule may be a preset rule that can map binary data to a unique phase. For example, a binary value (such as 01) may be mapped to a phase according to a preset rule. , Map the binary value (10) to the phase etc.; for another example, a binary value (01) may be mapped to a certain coordinate value according to a preset rule, and the angle between the coordinate value and the horizontal axis may be a phase; for another example, a binary value may be mapped to a polar coordinate according to a preset rule, etc. As long as the rule can map the key segment to a data containing phase information, it can be a preset rule in this application, and this application does not limit the specific content of the above phase mapping rule.
[0085] In some embodiments, the above phase mapping rule may be a modulation constellation mapping rule, which may map a binary value into a symbol on a modulation constellation.
[0086] In some embodiments, the first device and the second device may use the same phase mapping rule to generate the same reconstruction key.
[0087] In some embodiments, the first device and the second device may negotiate the phase mapping rule in advance, or may temporarily negotiate the phase mapping rule.
[0088] It should be noted that different binary data may be associated with different phases for mapping, that is, the phases mapped out by different binary data may be different, and the phases mapped out by the same binary data may be the same.
[0089] Step S208: Perform phase shift processing on the phase corresponding to each key segment according to the target phase shift value to obtain at least one shifted phase.
[0090] The target phase offset may be greater than 0.
[0091] In some embodiments, the first device and the second device may use the same target phase offset value to perform offset processing on the key segment so that the first device and the second device generate the same reconstructed key.
[0092] In some embodiments, the target phase offset value may be a value negotiated between the first device and the second device. The target phase offset value may be negotiated in advance or temporarily, and this application does not limit this.
[0093] In some embodiments, the target offset value may be one, two or more.
[0094] If the above-mentioned target phase offset values are two or more, then when the key segment is phase-shifted by the two or more values, the order of using the target phase offset values when performing the phase shift and the order of processing the key segment need to be agreed upon by the first device and the second device, so that the reconstructed keys generated by the first device and the second device are exactly the same.
[0095] Step S210: De-map at least one shifted phase into at least one new key segment according to a phase de-mapping rule.
[0096] In some embodiments, the above phase reverse mapping rule can reversely map the phase or the coordinates or other data including the phase into binary data, and the binary data obtained after the reverse mapping can be the above new key segment. One phase or one data including the phase (such as coordinates) can uniquely correspond to one binary data.
[0097] It should be noted that different phases can be mapped to different binary data, and the same phase can be mapped to the same binary data.
[0098] In some embodiments, the above phase mapping rule and phase inverse mapping rule may be symmetrical rules. For example, the phase mapping rule may map binary data 01 to phase (or coordinates (0,1) including phase information), then the phase inverse mapping rule can be used to Or the coordinate (0,1) is inversely mapped to 01.
[0099] In some embodiments, the above phase mapping rule and the phase inverse mapping rule may be asymmetric, and the above phase mapping rule and the phase inverse mapping rule may be completely irrelevant, and the present application does not impose any limitation on this.
[0100] In some embodiments, the first device and the second device may use the same phase inverse mapping rule to generate the same reconstructed key.
[0101] In some embodiments, the first device and the second device may negotiate the above phase reverse mapping rule in advance, or may temporarily negotiate the above phase reverse mapping rule.
[0102] Step S212, concatenating the new key segments to generate a reconstructed key.
[0103] In some embodiments, the new key segments may be concatenated in the order in which they were split to generate a reconstructed key.
[0104] The above method can first divide the original binary key, then map each divided key segment to a phase, then offset the mapped phase, and finally de-map it to a reconstructed key. The key generated by the above method can, on the one hand, infinitely expand the original binary key without applying to a third party and storing the binary key, and thus does not need to occupy too much storage space; on the other hand, the key type of the reconstructed key is the same as the original binary key, and a binary key with higher security performance can be generated without applying to a third party.
[0105] Figure 3 The present invention is a flowchart of a method for generating a key segment according to an exemplary embodiment.
[0106] refer to Figure 3 , the above-mentioned key segment generation method may include the following steps.
[0107] Step S302, obtaining the number of key segments.
[0108] In some embodiments, the number of bits in the key segment may refer to the number of binary bits or bits that can be included in a preset key segment, for example, it may be 2 bits, 3 bits, 4 bits, etc., and this application does not impose any restrictions on this.
[0109] Step S304, dividing the original binary key according to the number of key segment bits to obtain at least one key segment.
[0110] In some embodiments, the first device and the second device may use the same number of key segments or bits to perform segmentation processing on the original binary key.
[0111] In some embodiments, the first device and the second device may negotiate the number of key segments in advance, and may also temporarily negotiate the number of key segments during the key generation process, and this application does not impose any restrictions on this.
[0112] In some embodiments, the first device and the second device may also determine the number of key segments by negotiation to divide the original binary key. For example, the first device and the second device may negotiate to determine that the original binary key is divided into N segments, and then the first device and the second device may divide the original binary key into N groups, where N is an integer greater than or equal to 1.
[0113] In other embodiments, the first device and the second device may also divide the original binary key by other methods, as long as the key segment in the first device and the key segment in the second device are the same after the division.
[0114] Figure 4 The present invention is a flowchart of a method for generating a key segment according to an exemplary embodiment.
[0115] refer to Figure 4 , the above-mentioned key segment generation method may include the following steps.
[0116] Step S402, obtaining the number of key segments.
[0117] Step S404, dividing the original binary key according to the number of key segment bits to obtain at least one key segment.
[0118] Step S406, determining that the number of bits of the last key segment of at least one key segment is less than the number of bits of the key segment.
[0119] Step S408: padding the last key segment of at least one key segment by using a preset binary value.
[0120] In some embodiments, if the number of bits of the last key segment of at least one key segment is equal to the number of bits of the preset key segment, the last key segment may not be processed.
[0121] Figure 5 The present invention is a flowchart of a method for generating a key segment according to an exemplary embodiment.
[0122] refer to Figure 5, the above-mentioned key segment generation method may include the following steps.
[0123] Step S502, obtaining the number of key segments.
[0124] Step S504, dividing the original binary key according to the number of key segment bits to obtain at least one key segment.
[0125] Step S506: determine whether the number of bits of the last key segment of at least one key segment is less than the number of bits of the key segment.
[0126] Step S508: discard the last key segment of at least one key segment.
[0127] In some embodiments, if the number of bits of the last key segment of at least one key segment is equal to the number of bits of the preset key segment, the last key segment may not be processed.
[0128] Through the above embodiment, the key segment can be supplemented or deleted when the number of data bits in the key segment is insufficient, so that the key segments in the first device and the second device are completely identical and the number of binary data in each key segment is the same.
[0129] In some embodiments, if it is determined that the number of bits of the last key segment in at least one key segment is less than the number of key segment bits, the last key segment can be retained unchanged and no phase shift processing is performed on the last key segment so that the number of key bits of the reconstructed key is the same as that of the original binary key.
[0130] The modulation constellation diagram is a graphical method used in the field of digital communications to intuitively represent signals and their relationships. It displays the signals and their relationships by representing digital signals on the complex plane. In digital modulation, the changes in carrier parameters (such as amplitude and phase) are determined by discrete digital signals. These discrete states are called symbol points on the vector diagram, and the combination of symbol points constitutes the constellation diagram.
[0131] The constellation mapping rule in modulation is an important concept in communication principles. It defines how to map a digital signal (bit stream) to the amplitude and phase of the modulated signal so that this information can be effectively represented during transmission. The following are some key points of the constellation mapping rule.
[0132] 1. Basic concepts of constellation diagram.
[0133] Constellation Diagram: The combination of all symbol points of the modulated signal on the IQ (In-phase and Quadrature) plane (or complex plane).
[0134] Symbol Point: It represents discrete modulation states on the vector diagram. Information is transmitted by mapping digital modulation into carrier states, i.e. symbols.
[0135] 2. Mapping rules.
[0136] 1. Group mapping:
[0137] In the modulation process, multiple bits (such as 2 or more) are usually combined into a symbol and then mapped to a point on the constellation diagram. For example, in QPSK (Quadrature Phase Shift Keying), every two bits (00, 01, 10, 11) are mapped to four different phase points on the constellation diagram.
[0138] 2. Phase and amplitude mapping:
[0139] Each point in the constellation is determined by its amplitude and phase. In QPSK, the amplitude usually remains constant, while phase changes represent different bit combinations. For more complex modulation techniques such as Quadrature Amplitude Modulation (QAM), both amplitude and phase may vary.
[0140] 3. Normalization processing:
[0141] In actual implementation, in order to keep the signal energy consistent, the points on the constellation diagram are usually normalized. For example, in QPSK, the normalized constellation points may be located on the unit circle, that is, their amplitude is 1 (but in some cases, such as to match a specific power spectral density, they may be multiplied by a coefficient, such as 1 / sqrt(2)).
[0142] 4. Mapping method:
[0143] Different modulation techniques have different constellation mapping methods. For example, QPSK usually uses four phases (such as , , , ) to represent four different bit combinations. QAM (Quadrature Amplitude Modulation) uses both amplitude and phase changes to represent more bit combinations.
[0144] Taking QPSK as an example, the constellation mapping rule is as follows: divide the input binary bit stream into groups of two bits (such as 00, 01, 10, 11). Each group of bits is mapped to a point (i.e., symbol) on the constellation diagram. These points are located in four quadrants of the complex plane, with a phase difference of 90 degrees (or 180 degrees, 270 degrees, or 360 degrees). After normalization, these points are usually located on the unit circle.
[0145] Figure 6 is a modulation constellation diagram corresponding to QPSK according to an exemplary embodiment. Figure 6 There are four symbols in the modulation constellation diagram shown (symbols corresponding to the four black dots, such as the symbols corresponding to 00, 01, 10 and 11), and each of the four symbols has a coordinate, such as the coordinate corresponding to 00 is (1,1), the coordinate corresponding to 01 is (-1,1), the coordinate corresponding to 10 is (-1,-1), the coordinate corresponding to 11 is (1,-1), and so on.
[0146] Next, the present application will provide a key generation method in combination with the above modulation constellation diagram.
[0147] Figure 7 A key generation method is shown according to an exemplary embodiment.
[0148] refer to Figure 7 , the above-mentioned key generation method may include the following steps.
[0149] Step S702, determining the original binary key.
[0150] Step S704: divide the original binary key to obtain at least one key segment.
[0151] Step S706: Map each key segment to a modulation constellation diagram to determine a target symbol corresponding to the key segment on the modulation constellation diagram.
[0152] In some embodiments, each key segment may be mapped to the modulation constellation according to a modulation constellation mapping rule to determine a target symbol corresponding to the key segment on the modulation constellation.
[0153] Step S708: determine the coordinates of each target symbol on the modulation constellation diagram, wherein the coordinates of the target symbol include phase information.
[0154] Step S710, performing phase shift processing on the coordinates corresponding to each key segment according to the target phase shift value to obtain at least one shifted coordinate, where the shifted coordinate includes phase information.
[0155] Step S712: Compare the modulation constellation diagram and resolve at least one shifted coordinate into at least one new key segment.
[0156] In some embodiments, before performing phase offset processing on the phase corresponding to each key segment according to the target phase offset value, the above-mentioned key generation method may also include: obtaining multiple phase differences corresponding to the modulation constellation diagram (such as the 90 degrees mentioned above, or 180 degrees, 270 degrees or 360 degrees), where the phase difference is used to describe the phase difference between two symbols in the modulation constellation diagram; determining the target phase offset value among the multiple phase differences.
[0157] The phase difference determined by the above method can ensure that the target symbol remains a symbol on the modulation constellation after the phase shift, which facilitates the reverse mapping of the shifted symbol into binary data according to the modulation constellation reverse mapping rule.
[0158] Figure 8 A key generation method is shown according to an exemplary embodiment.
[0159] In some embodiments, the above-mentioned key generation method can be applied to the first device.
[0160] refer to Figure 8 , the above-mentioned key generation method may include the following steps.
[0161] Step S802: Carry the secure medium on the first device to a key charging point to charge multiple preset keys offline, where the multiple preset keys are used to communicate with the second device.
[0162] In some embodiments, the first device may be a terminal device.
[0163] In some embodiments, the second device may be a network element device (such as a base station device) in a communication network.
[0164] In some embodiments, the first device may carry a secure medium to a key filling point to fill multiple preset keys offline, wherein the multiple preset keys are used to communicate with the second device.
[0165] Among them, secure media plays a vital role in the field of information security. They are used to protect data stored on the media from unauthorized access, theft, tampering or destruction. For example, smart cards / IC cards (Integrated Circuit Cards), USIM cards (Universal Subscriber Identity Modules), etc. This application does not limit what the secure media is.
[0166] In some embodiments, the first device or the second device may store the multiple preset keys obtained by filling in a secure medium to prevent the multiple preset keys from being accessed, stolen, tampered with, or destroyed.
[0167] Step S804: Each time the first device communicates with the second device, a preset key is consumed.
[0168] Step S806: When the multiple preset keys are consumed, the original binary key is determined.
[0169] Step S808: divide the original binary key to obtain at least one key segment.
[0170] Step S810: Map each key segment to a phase according to a phase mapping rule.
[0171] Step S812: Perform phase shift processing on the phase corresponding to each key segment according to the target phase shift value to obtain at least one shifted phase.
[0172] Step S814: De-map at least one shifted phase into at least one new key segment according to a phase de-mapping rule.
[0173] Step S816, concatenate the new key segments to generate a reconstructed key.
[0174] QKD (Quantum Key Distribution) is a new key negotiation scheme based on quantum information technology, which is used to generate information-theoretic security between two or more physical nodes. Compared with traditional schemes, QKD keys have information-theoretic security and can effectively counter the threats brought by the development of quantum computing technology. The main process of the QKD protocol is to achieve secure transmission of information by preparing and measuring quantum states encoded in carriers such as photons.
[0175] QKD networking usually relies on optical fiber media, while wireless communication does not rely on optical fiber media. It requires an offline filling method to fill a certain amount of pre-generated quantum keys into terminal security media such as USIM cards and password cards, and distribute them to mobile terminal users for use. However, due to the limited storage space of security media, it is necessary to regularly carry mobile terminals to designated locations to recharge and update keys. Frequent recharging brings inconvenience to both users and service providers.
[0176] In response to the above technical problems, the present application proposes a key generation method, which can expand more keys based on the original key to provide secure communication for both parties.
[0177] Fig. 9 It is a framework diagram corresponding to a key generation method according to an exemplary embodiment.
[0178] Fig.10 The figure is an interaction diagram corresponding to a key generation method according to an exemplary embodiment.
[0179] like Fig. 9 As shown, in the above key generation method, a key management platform 901, a terminal 902 (which may be a first device) and a base station 903 (which may be a second device) may be included. Fig. 9 The provided key generation method may include the following steps: Terminal 902 requests the key management platform 901 to inject the QKD key , so that the terminal 902 and the base station 901 can be based on the quantum key Then when the quantum key is insufficient, the terminal 902 and the base station 901 perform phase shift processing based on the injected quantum key to obtain the reconstructed key. , and then rebuild the key based on Continue with secure communications.
[0180] Combination Fig.10 Before executing the above key generation method, the following steps may be included.
[0181] 1. Terminal 02 carries the terminal security medium (USIM card / password card, etc.) to the key charging point (such as key management platform 01) to charge the quantum key offline, which is recorded as is the key length, and records the amount of key injected this time .
[0182] Combination Fig.10 The technical solution provided in this embodiment may include the following steps.
[0183] Step S1001, request to establish a secure link and key ID.
[0184] Before establishing a secure link with base station 03 each time, terminal 02 sends the key ID (i.e. key identification) to base station 03, and base station 03 passes the key ID to key management platform 01 to obtain the quantum key.
[0185] Step S1002, determine whether the remaining key quantity is sufficient; negotiate the modulation mode.
[0186] To ensure one-time one-key, the communicating parties will consume a pair of quantum keys each time they communicate, denoted as k=k-1. When k=0, the phase shift process needs to be enabled to generate a new key in the device. Before enabling the phase shift process, the terminal and the device need to negotiate the modulation method (such as BPSK / QPSK / 16QAM, etc.) and the modulation order.
[0187] S1003, key grouping.
[0188] According to the modulation order pre-negotiated by both parties, the original injection key Divide into m groups, where m=N / modulation order.
[0189] S1004, mapping, phase shifting, and analysis.
[0190] Mapping: Map the grouped keys to the modulation constellation and record the coordinates as , m is an integer greater than 1 or equal to.
[0191] Phase offset: Randomly select the offset angle , and Each key segment performs phase shift to obtain the new key coordinates , ,……, .in, is the phase difference between symbols in the modulation constellation.
[0192] Analysis: Compare with the modulation constellation diagram and analyze each coordinate into a new key segment.
[0193] Step S1005: key splicing.
[0194] Concatenate the segmented keys to get a new key ;
[0195] By repeating the above steps, the k keys pre-filled and stored can be phase-shifted to generate new keys, or the modulation method can be changed to generate different keys.
[0196] S1006, build a secure channel.
[0197] Below, this application will specifically explain the above key generation method in conjunction with a specific application scenario embodiment.
[0198] Assume that the pre-charge key is 10011100. When the remaining key amount k=0, the phase shift process is enabled to generate a new key in the device.
[0199] Assuming the currently negotiated modulation mode is QPSK, then , the key is divided into 4 groups with 2 bits as a group, and the grouping result is: 10 / 01 / 11 / 00.
[0200] Map the grouped keys to the modulation constellation diagram, see Figure 6 , and record the coordinates as: (-1,-1), (-1,1), (1,-1), (1,1).
[0201] Terminal in From the set of angles, randomly select an offset angle , and inform the base station, assuming , and Each key segment is phase shifted, that is, multiplied by , and obtain the new key coordinates: (1,1), (1,-1), (-1,1), (-1,-1).
[0202] Comparing with the modulation constellation diagram, each coordinate is parsed into a new key segment: 00 / 11 / 01 / 10.
[0203] Concatenate the segmented keys to get a new key , that is 00110110.
[0204] The embodiments of the present application may have the following beneficial effects:
[0205] 1) Calculate the key surplus in real time to determine whether the pre-filled key is sufficient, and enable phase offset calculation while maximizing the use of the existing key;
[0206] 2) Based on the modulation principle of traditional communication technology and referring to the constellation diagram, new keys can be continuously generated, effectively increasing the amount of keys under limited computing power consumption;
[0207] 3) Any modulation method can be negotiated, that is, the grouping method is not fixed, and the offset angle can be randomly selected , ensuring the randomness of the key;
[0208] 4) The base station can generate symmetric keys synchronously with the terminal according to the offset angle, eliminating the need to transmit the key ID to the key management platform to obtain the key, thereby reducing the risk of key exposure.
[0209] The module described in this embodiment can be built into the devices of the communication sender and receiver. When the amount of pre-charged keys is insufficient, the keys are grouped and mapped to the modulation constellation diagram, and then the phase is randomly shifted. The results are parsed from the constellation diagram according to the offset position coordinates to generate new keys. On the basis of retaining the randomness of the original key, the availability of the charged key is improved, and the problem of insufficient key quantity caused by limited storage space is avoided.
[0210] This embodiment can be an extension of the wireless QKD key injection technology, and can be applied to secure communications between terminals and base stations, ensuring network encryption requirements and avoiding the inconvenience caused by frequent injection and key updates.
[0211] It should be particularly pointed out that the various steps in the various embodiments of the above-mentioned key generation method can be mutually crossed, replaced, added, or deleted. Therefore, these reasonable permutations and combinations of the key generation method should also fall within the scope of protection of the present disclosure, and the scope of protection of the present disclosure should not be limited to the embodiments.
[0212] Based on the same inventive concept, the present disclosure also provides a key generation device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0213] Fig.11 is a block diagram of a key generation device according to an exemplary embodiment. Fig.11 The key generation device 1100 provided in the embodiment of the present disclosure may include: an original key determination module 1101, a key division processing module 1102, a phase mapping module 1103, a phase shift module 1104, a reverse mapping module 1105 and a key segment splicing module 1106.
[0214] Among them, the original key determination module 1101 can be used to determine the original binary key; the key division processing module 1102 can be used to divide the original binary key to obtain at least one key segment; the phase mapping module 1103 can be used to map each key segment into a phase according to a phase mapping rule; the phase offset module 1104 can be used to perform phase offset processing on the phase corresponding to each key segment according to a target phase offset value to obtain at least one offset phase; the inverse mapping module 1105 can be used to inversely map the at least one offset phase into at least one new key segment according to a phase inverse mapping rule; the key segment splicing module 1106 can be used to splice the new key segments to generate a reconstructed key.
[0215] It should be noted that the original key determination module 1101, the key division processing module 1102, the phase mapping module 1103, the phase shift module 1104, the reverse mapping module 1105 and the key segment splicing module 1106 correspond to S202 to S212 in the method embodiment, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above method embodiment. It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0216] In some embodiments, the key division processing module 1102 may include: a key segment number acquisition submodule and a division submodule.
[0217] Among them, the key segment bit acquisition submodule can be used to obtain the key segment bit number; the division submodule can be used to divide the original binary key according to the key segment bit number to obtain the at least one key segment.
[0218] In some embodiments, the key generation device 1100 may further include: a digit determination submodule, a padding submodule, or a discarding submodule.
[0219] Among them, the bit number judgment submodule can be used to determine that the number of bits of the last key segment of the at least one key segment is less than the number of bits of the key segment; the padding submodule can be used to pad the last key segment of the at least one key segment by a preset binary value; the discarding submodule can be used to discard the last key segment of the at least one key segment.
[0220] In some embodiments, the phase mapping module 1103 may include: a modulation constellation mapping submodule and a coordinate determination submodule.
[0221] Among them, the modulation constellation mapping submodule can be used to map each key segment to the modulation constellation respectively to determine the target symbol corresponding to the key segment on the modulation constellation; the coordinate determination submodule can be used to determine the coordinates of each target symbol on the modulation constellation, wherein the coordinates of the target symbol include phase information.
[0222] In some embodiments, the phase shift module 1104 may include: a phase shift submodule.
[0223] The phase shift submodule may be used to perform phase shift processing on the coordinates corresponding to each key segment according to the target phase shift value to obtain at least one shifted coordinate, wherein the shifted coordinate includes phase information.
[0224] In some embodiments, the key generation device 1100 may include: a plurality of phase difference acquisition modules and a target phase offset value determination submodule.
[0225] Among them, multiple phase difference acquisition modules can be used to obtain multiple phase differences corresponding to the modulation constellation diagram before performing phase offset processing on the phases corresponding to the each key segment according to the target phase offset value, wherein the phase difference is used to describe the phase difference between two symbols in the modulation constellation diagram; the target phase offset value determination submodule can be used to determine the target phase offset value among the multiple phase differences.
[0226] In some embodiments, the de-mapping module 1105 may include: a de-mapping sub-module.
[0227] The inverse mapping submodule may be used to compare the modulation constellation diagram and resolve the at least one shifted coordinate into the at least one new key segment.
[0228] In some embodiments, the key generation method is applied to a first device, and the first device and a second device share and store a plurality of preset keys; wherein the original key determination module 1101 may include: an original binary key determination submodule.
[0229] The original binary key determination submodule may be used to determine the original binary key from the multiple preset keys.
[0230] The key generation device 1100 may further include: a key identifier sending submodule.
[0231] The key identifier sending submodule may be used for the first device to send the key identifier of the original binary key to the second device, so that the second device generates the reconstructed key according to the original binary key.
[0232] In some embodiments, the key generation method is applied to a first device, and the first device and a second device share and store multiple preset keys; wherein the original key determination module 1101 may include: a key identification receiving submodule and a binary key screening submodule.
[0233] Among them, the key identification receiving submodule can be used to receive a key identification from the second device, wherein the key identification is the identification of the original binary key determined by the second device from the multiple preset keys stored in the second device; the binary key screening submodule can be used to determine the original binary key from the multiple preset keys stored in the first device according to the key identification.
[0234] In some embodiments, the key generation method is applied to a first device; wherein the original key determination module 1101 may include: a key filling submodule, a preset key consumption submodule and a binary key determination submodule.
[0235] Among them, the key filling submodule can be used to carry the secure medium on the first device to the key filling point to offline fill multiple preset keys, wherein the multiple preset keys are used to communicate with the second device; the preset key consumption submodule can be used to consume a preset key each time the first device communicates with the second device; the binary key determination submodule can be used to determine the original binary key after the multiple preset keys are consumed.
[0236] Since the functions of the device 1100 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0237] The modules and / or submodules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The modules and / or submodules described may also be arranged in a processor. The names of these modules and / or submodules do not, in certain cases, constitute limitations on the modules and / or submodules themselves.
[0238] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a part of a module or program segment, and a part of the above-mentioned module or program segment contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer program instructions.
[0239] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0240] Fig.12 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig.12 The electronic device 1200 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0241] like Fig.12 As shown, the electronic device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage part 1208 to a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the electronic device 1200 are also stored. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0242] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed, so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0243] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains computer program instructions for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, the above-mentioned functions defined in the system of the present disclosure are executed.
[0244] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. 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 may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (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 the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable computer program instructions. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The computer program instructions contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0245] As another aspect, the present disclosure also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by a device, the device can implement functions including: determining the original binary key; dividing the original binary key to obtain at least one key segment; mapping each key segment to a phase according to a phase mapping rule; performing phase shift processing on the phase corresponding to each key segment according to a target phase shift value to obtain at least one shifted phase; reverse mapping the at least one shifted phase to at least one new key segment according to a phase reverse mapping rule; splicing the new key segments to generate a reconstructed key.
[0246] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program instructions, the computer program instructions being stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the methods provided in various optional implementations of the above embodiments.
[0247] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of computer program instructions for enabling an electronic device (which can be a server or a terminal device, etc.) to execute the method according to the embodiment of the present disclosure.
[0248] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0249] It should be understood that the present disclosure is not limited to the detailed structures, drawings or implementations shown herein, but rather the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A key generation method, characterized in that: include: Determine the original binary key; Dividing the original binary key to obtain at least one key segment; Mapping each key segment to a phase according to a phase mapping rule; Performing phase shift processing on the phases corresponding to the key segments according to the target phase shift value to obtain at least one shifted phase; De-mapping the at least one shifted phase into at least one new key segment according to a phase de-mapping rule; splicing the new key segments to generate a reconstructed key; The key segments are mapped to phases according to the phase mapping rule, including: Mapping each key segment to a modulation constellation diagram respectively to determine a target symbol corresponding to the key segment on the modulation constellation diagram; Determining the coordinates of each target symbol on the modulation constellation diagram, wherein the coordinates of the target symbol include phase information; The phase shifting process is performed on the phases corresponding to the key segments according to the target phase shift value to obtain at least one shifted phase, including: Phase shift processing is performed on the coordinates corresponding to each key segment according to the target phase shift value to obtain at least one shifted coordinate, where the shifted coordinate includes phase information.
2. The method according to claim 1, characterized in that: The original binary key is divided to obtain at least one key segment, including: Get the number of key segments; The original binary key is divided according to the number of bits of the key segment to obtain the at least one key segment.
3. The method according to claim 2, characterized in that: The method further comprises: Determining that the number of bits of the last key segment of the at least one key segment is less than the number of bits of the key segment; The last key segment of the at least one key segment is padded by a preset binary value; or, The last key segment of the at least one key segment is discarded.
4. The method according to claim 1, characterized in that: Before performing phase shift processing on the phases corresponding to the key segments according to the target phase shift value, the method further includes: Acquire multiple phase differences corresponding to the modulation constellation diagram, wherein the phase difference is used to describe the phase difference between two symbols in the modulation constellation diagram; The target phase offset value is determined among the plurality of phase differences.
5. The method according to claim 1, characterized in that: De-mapping the at least one shifted phase into at least one new key segment according to a phase de-mapping rule, comprising: The at least one shifted coordinate is resolved into the at least one new key segment by comparing the modulation constellation.
6. The method according to claim 1, characterized in that: The key generation method is applied to a first device, wherein the first device and a second device store a plurality of preset keys in a shared manner; wherein determining the original binary key comprises: Determining the original binary key among the plurality of preset keys; The method further comprises: The first device sends the key identifier of the original binary key to the second device, so that the second device generates the reconstructed key according to the original binary key.
7. The method according to claim 1, characterized in that: The key generation method is applied to a first device, wherein the first device and a second device store a plurality of preset keys in a shared manner; wherein determining the original binary key comprises: receiving a key identifier from the second device, wherein the key identifier is an identifier of an original binary key determined by the second device from among the plurality of preset keys stored in the second device; The original binary key is determined from the plurality of preset keys stored in the first device according to the key identifier.
8. The method according to claim 1, characterized in that: The key generation method is applied to a first device; wherein determining the original binary key comprises: Carrying the secure medium on the first device to a key charging point to charge multiple preset keys offline, wherein the multiple preset keys are used to communicate with the second device; Each time the first device communicates with the second device, a preset key is consumed; When the plurality of preset keys are consumed, the original binary key is determined.
9. A key generation device, characterized in that: Applied to a first device, comprising: An original key determination module, used for determining an original binary key; A key division processing module, used for dividing the original binary key to obtain at least one key segment; A phase mapping module, used to map each key segment to a phase according to a phase mapping rule; A phase shift module, used to perform phase shift processing on the phases corresponding to the key segments according to the target phase shift value to obtain at least one shifted phase; A demapping module, configured to demap the at least one shifted phase into at least one new key segment according to a phase demapping rule; A key segment splicing module, used for splicing the new key segments to generate a reconstructed key; The key segments are mapped to phases according to the phase mapping rule, including: Mapping each key segment to a modulation constellation diagram respectively to determine a target symbol corresponding to the key segment on the modulation constellation diagram; Determining the coordinates of each target symbol on the modulation constellation diagram, wherein the coordinates of the target symbol include phase information; The phase shifting process is performed on the phases corresponding to the key segments according to the target phase shift value to obtain at least one shifted phase, including: Phase shift processing is performed on the coordinates corresponding to each key segment according to the target phase shift value to obtain at least one shifted coordinate, where the shifted coordinate includes phase information.
10. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement the key generation method according to any one of claims 1 to 8.
11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the key generation method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising computer program instructions, wherein the computer program instructions are stored in a computer readable storage medium, wherein: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Secret key stream generation method and device
CN110086619A