CN114040395A - Key generation method and device - Google Patents

Key generation method and device Download PDF

Info

Publication number
CN114040395A
CN114040395A CN202111475278.0A CN202111475278A CN114040395A CN 114040395 A CN114040395 A CN 114040395A CN 202111475278 A CN202111475278 A CN 202111475278A CN 114040395 A CN114040395 A CN 114040395A
Authority
CN
China
Prior art keywords
key
value
calculating
communication device
hash value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111475278.0A
Other languages
Chinese (zh)
Inventor
姜禹
胡爱群
李晨露
李古月
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Network Communication and Security Zijinshan Laboratory
Original Assignee
Network Communication and Security Zijinshan Laboratory
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Network Communication and Security Zijinshan Laboratory filed Critical Network Communication and Security Zijinshan Laboratory
Priority to CN202111475278.0A priority Critical patent/CN114040395A/en
Publication of CN114040395A publication Critical patent/CN114040395A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a key generation method and a device, wherein the method comprises the following steps: receiving a second signal sent by second communication equipment, and extracting first channel state information from the second signal; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and a first difference value; sending the first sequence value to the second communication device; calculating a hash value of the first key, sending the hash value of the first key to the second communication equipment, and receiving the hash value of the second key sent by the second communication equipment; and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device. The method is based on the reciprocity characteristic of the channel characteristic parameters of the two communication parties, the keys generated by the two communication parties are compared to determine the communication key, and the accuracy and the randomness of the generation of the keys of the two communication parties can be effectively improved.

Description

Key generation method and device
Technical Field
The present invention relates to the field of wireless communication and information security, and in particular, to a method and an apparatus for generating a secret key.
Background
The internet of things is composed of multiple devices, and the devices are interconnected, which means that a potential safety hazard of a certain device does not affect the device itself, but also affects other devices in the internet of things, so that the safety risk of the whole network is increased. For this reason, some security mechanisms need to be found to ensure the secure transmission of data between the end nodes.
At present, the method for generating the key of the wireless physical layer is continuously developed, and a plurality of achievements are obtained. The wireless physical layer key generation method mostly utilizes the natural characteristics of a wireless channel, does not need key distribution and key management, does not directly send session keys between devices, and can provide a lightweight secret communication scheme. The method utilizes the characteristics of time-varying property and short-time reciprocity of a wireless channel, and two communication parties generate a session key by utilizing the obtained channel characteristics without distribution, thereby reducing the risk of key leakage, and having strong randomness and difficult deciphering of the channel characteristics.
However, the conventional key generation method has problems of poor randomness, complicated generation method, and the like.
Disclosure of Invention
The invention provides a method and a device for generating a secret key, which are used for overcoming the defects of poor randomness and complex generation method of the secret key generation method in the prior art and enhancing the robustness of the secret key generation method.
In a first aspect, the present invention provides a key generation method, applied to a first communication device, including: receiving a second signal sent by second communication equipment, and extracting first channel state information from the second signal; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and the first difference value; transmitting the first sequence value to the second communications device; calculating a hash value of the first key, sending the hash value of the first key to the second communication device, and receiving the hash value of the second key sent by the second communication device; and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device.
According to the key generation method provided by the present invention, the calculating a first key and a first sequence value according to a preset cyclic code and the first difference value includes: according to the preset cyclic code, the first difference value is evenly divided to obtain a first sub-difference value; calculating the difference value of the time domain amplitudes of the subcarriers in the same time period and the adjacent subcarriers in the first channel state information, and a first multiple corresponding to the ratio of the difference value to the first sub-difference value; calculating the first key and the first sequence value according to the first multiple.
According to the key generation method provided by the present invention, the calculating the first key and the first sequence value according to the first multiple includes: sequentially performing addition and subtraction operation and modulus operation on the first multiple to obtain a new first multiple; taking the gray code corresponding to the new first multiple as the first key; and determining an encoding value corresponding to the operation according to a preset rule, and taking the determined encoding value as the first sequence value.
In a second aspect, the present invention further provides a key generation method, applied to a second communication device, including: receiving a first signal sent by first communication equipment, and extracting second channel state information from the first signal; calculating a second difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the second channel state information; receiving a first sequence value sent by the first communication device; calculating a second key according to the first sequence value, a preset cyclic code and the second difference value; calculating a hash value of the second key, sending the hash value of the second key to the first communication equipment, and receiving the hash value of the first key sent by the first communication equipment; and if the hash value of the first key is equal to the second hash value, determining that the second key is a key for communication between the first communication device and the second communication device.
According to the key generation method provided by the present invention, the calculating a second key according to the first sequence value, a preset cyclic code and the second difference value includes: the second difference value is evenly divided according to the preset cyclic code to obtain a second sub-difference value; calculating the difference value of the time domain amplitudes of the subcarriers in the same time period and the adjacent subcarriers in the second channel state information, and a second multiple corresponding to the ratio of the difference value to the second sub-difference value; calculating the second key from the first sequence value and the second multiplier.
In a third aspect, the present invention further provides a key generation apparatus, applied to a first communication device, including: the first extraction module is used for receiving a second signal sent by second communication equipment and extracting first channel state information from the second signal; the first calculation module is used for calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; the second calculation module is used for calculating a first secret key and a first sequence value according to a preset cyclic code and the first difference value; a first sending module, configured to send the first sequence value to the second communication device; the first sending and receiving module is used for calculating a hash value of the first key, sending the hash value of the first key to the second communication equipment and receiving the hash value of the second key sent by the second communication equipment; a first determining module, configured to determine that the first key is a key for performing communication between the first communication device and the second communication device if the hash value of the first key is equal to the second hash value.
In a fourth aspect, the present invention further provides a key generation apparatus, applied to a second communication device, including: the second extraction module is used for receiving a first signal sent by first communication equipment and extracting second channel state information from the first signal; a third calculating module, configured to calculate a second difference between a maximum value and a minimum value of a time-domain amplitude of a subcarrier in the second channel state information; a second receiving module, configured to receive a first sequence value sent by the first communication device; a fourth calculating module, configured to calculate a second key according to the first sequence value, a preset cyclic code, and the second difference; the second sending and receiving module is used for calculating a hash value of the second key, sending the hash value of the second key to the first communication equipment and receiving the hash value of the first key sent by the first communication equipment; a second determining module, configured to determine that the second key is a key for performing communication between the first communication device and the second communication device if the hash value of the first key is equal to the second hash value.
In a fifth aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the key generation method according to the first aspect or the second aspect when executing the program.
In a sixth aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the key generation method according to the first or second aspect.
In a seventh aspect, an embodiment of the present invention further provides a computer program product, on which executable instructions are stored, and when executed by a processor, the instructions cause the processor to implement the steps of the key generation method according to the first aspect or the second aspect.
According to the key generation method and device provided by the invention, the first channel state information is extracted from the second signal by receiving the second signal sent by the second communication equipment; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and a first difference value; sending the first sequence value to the second communication device; calculating a hash value of the first key, sending the hash value of the first key to the second communication equipment, and receiving the hash value of the second key sent by the second communication equipment; and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device. The method is based on the reciprocity characteristic of the channel characteristic parameters of the two communication parties, the keys generated by the two communication parties are compared to determine the communication key, and the accuracy and the randomness of the generation of the keys of the two communication parties can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an embodiment of a key generation method provided in the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a method for calculating a first key and a first sequence value according to the present invention;
FIG. 3 is a schematic flow chart diagram illustrating another embodiment of a method for calculating a first key and a first sequence value provided by the present invention;
FIG. 4 is a schematic flow chart diagram illustrating another embodiment of a key generation method provided by the present invention;
FIG. 5 is a schematic diagram of an application scenario provided by the present invention;
FIG. 6 is a schematic diagram of a key generation apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a key generation apparatus according to another embodiment of the present invention;
fig. 8 illustrates a schematic structural diagram of an electronic device.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of a key generation method according to an embodiment of the present invention. As shown in fig. 1, the key generation method, applied to a first communication device, may include the following steps:
s101, receiving a second signal sent by a second communication device, and extracting first channel state information of a first communication device from the second signal.
In step S101, the signal is a communication signal, which refers to how easily the communication device receives the required information, and modern communications are generally performed in the form of electromagnetic waves, for example, mobile phones (i.e., mobile phones), radios, radars, etc., which are all transmitted in the form of electromagnetic waves, and the transmitted signal carries the information required by the receiving party.
A channel may refer to a channel of communication, which is a medium of signal transmission. The channels are of various types, and are generally divided into wired channels and wireless channels. The wired channel means that the detection electric signal is transmitted to the controller or the control center through a twisted pair wire, a telephone line, an electric cable or an optical cable. The wireless channel is a special radio channel which is modulated to the detection electric signal firstly and is sent by the sending antenna; after the radio wave in the air is received by the wireless receiver of the controller or the control center, the radio wave is demodulated and restored to control the alarm signal. The channel in the embodiment of the present invention refers to a wireless channel.
Channel State Information (CSI) is Information used to estimate Channel characteristics of a communication link. The CSI describes how a signal propagates in a channel, combines various influences such as time delay, amplitude attenuation, phase offset and the like, and the amplitude and phase of each subcarrier corresponding to a Frequency domain space, belongs to physical layer information, has high stability, is suitable for combining partial network cards with open source firmware, is fine-grained physical information, comes from subcarriers decoded under an Orthogonal Frequency Division Multiplexing (OFDM) system, is more sensitive to the environment, and can be applied to the fields of action recognition, gesture recognition, keystroke recognition, tracking and the like. The OFDM system provides technical support for acquiring the multipath propagation information of the wireless signal.
S102, calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information.
In step S102, a carrier wave (carrier signal or carrier) is an electric wave generated by an oscillator and transmitted on a communication channel, and is modulated to transmit voice or other information. Dividing the channel into several sub-channels which are mutually crossed, then converting the high-speed serial data stream into a plurality of low-speed parallel sub-data streams, and modulating the sub-data streams into orthogonal sub-channels to be transmitted, wherein each sub-data stream is called as a sub-carrier, and each sub-carrier is mutually orthogonal. The maximum value and the minimum value of the time domain amplitude of the subcarrier respectively represent a peak farthest from the equilibrium position and a trough farthest from the equilibrium position in the subcarrier. The first difference represents the distance between the peak farthest from the equilibrium position and the valley finger farthest from the equilibrium position on the corresponding carrier.
S103, calculating a first key and a first sequence value according to a preset cyclic code and the first difference value.
First, the structure of the code can be constructed and analyzed by algebraic methods, and various practical decoding methods can be found; secondly, due to the cyclic characteristic, the coding operation and the syndrome calculation, the method can be realized by a feedback shift register, and the hardware is simple to realize. The cyclic code includes only two numbers of 0 and/or 1, and may be any one of a hexadecimal number, a natural binary code, and a cyclic binary code, and the embodiment of the present invention is not limited by this way.
S104, the first sequence value is sent to the second communication device.
And S105, calculating the hash value of the first key, sending the hash value of the first key to the second communication equipment, and receiving the hash value of the second key sent by the second communication equipment.
In step S105, a Hash value (Hash Function), also called Hash Function, or Hash algorithm and Hash Function, is a method for creating a small digital "fingerprint" from any kind of data. The hash function compresses a message or data into a digest so that the amount of data becomes small, fixing the format of the data. This function mixes the data in a hash, recreating a fingerprint called a hash value (hash sums, or hashes). The hash value is typically represented by a short string of random letters and numbers.
And S106, if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device.
In step S106, the hash values of the first key generated by the first communication device and the hash value of the second key generated by the second communication device are compared, and if the hash values are equal to each other, it means that the first communication device and the second communication device can communicate with each other by using the first key.
According to the key generation method provided by the invention, first channel state information is extracted from a second signal by receiving the second signal sent by second communication equipment; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and a first difference value; sending the first sequence value to the second communication device; calculating a hash value of the first key, sending the hash value of the first key to the second communication equipment, and receiving the hash value of the second key sent by the second communication equipment; and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device. The method is based on the reciprocity characteristic of the channel characteristic parameters of the two communication parties, the keys generated by the two communication parties are compared to determine the communication key, and the accuracy and the randomness of the generation of the keys of the two communication parties can be effectively improved.
Fig. 2 is a flowchart illustrating an embodiment of a method for calculating a first key and a first sequence value according to the present invention. As shown in fig. 2, the method of calculating the first key and the first sequence value may comprise the steps of:
s201, the first difference value is evenly divided according to a preset cyclic code to obtain a first sub-difference value.
In step S201, a preset number of bits of the cyclic code is obtained, an averaged number of parts is determined according to the preset number of bits of the cyclic code, and then the first difference value is averaged according to the averaged number of parts, so as to obtain a first sub-difference value. The calculation formula is as follows:
m=2n(formula 1)
Δ ═ A/m (equation 2)
Wherein m is the number of equal shares, n is the number of bits of the cyclic code, Δ is a first sub-difference value, and A is a first difference value.
S202, calculate a difference between the time-domain amplitudes of the subcarriers of the same time period and the adjacent subcarriers in the first channel state information, and a first multiple corresponding to a ratio of the difference to the first sub-difference.
In step S202, a difference between the time-domain amplitudes of the sub-carriers and the adjacent sub-carriers and a ratio of the difference to the first sub-difference are calculated, and if the ratio is an integer, the ratio is a first multiple. If the ratio is not an integer, the ratio is rounded down to obtain the first multiple. For example, when the calculated ratio is 7.3, the first multiple is 7 according to the downward rounding principle; for another example, when the calculated ratio is 7.9, the value of the first multiple should be 7 according to the rounding-down principle.
S203, calculating a first key and a first sequence value according to the first multiple.
Fig. 3 is a flowchart illustrating another embodiment of a method for calculating a first key and a first sequence value according to the present invention. As shown in fig. 3, the method of calculating the first key and the first sequence value may comprise the steps of:
s301, conducting addition and subtraction operation and modulus operation on the first multiple in sequence to obtain a new first multiple.
In step S301, first, an addition operation may be performed on the first multiple, for example, the first multiple is added by 1 to obtain a new first multiple; alternatively, the first multiple may be subtracted, for example, subtracting 1 from the first multiple, which is not limited in this embodiment of the present invention. And then carrying out modulus operation on the first multiple after the addition and subtraction operation to obtain a new first multiple. The first multiple after the addition and subtraction operation may be made to perform a modulo operation on m to obtain a new first multiple.
And S302, taking the Gray code corresponding to the new first multiple as a first key.
In step S302, the gray code is a binary digital system in which the gray coded sequence values must start with 0 and two consecutive values differ by only one bit. And converting the obtained new first multiple into a corresponding Gray code, and taking the Gray code as a first key.
And S303, determining a code value corresponding to the addition and subtraction operation according to a preset rule, and taking the determined code value as a first sequence value.
In step S303, the addition and subtraction operation in step S301 is recorded as a first sequence value. The preset rule may be to record the addition and subtraction operations as "1" and "0", respectively. If the first multiple is 0 and the first multiple is decremented by 1, then the first sequence value is m-1.
Fig. 4 is a schematic flowchart of another embodiment of a key generation method provided in the present invention. As shown in fig. 4, the key generation method, applied to the second communication device, may include the following steps:
s401, receiving a first signal sent by a first communication device, and extracting second channel state information from the first signal.
In step S401, the description of step S401 is referred to in step S101, and is not described herein again.
S402, calculating a second difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the second channel state information.
In step S402, the description of step S402 is referred to in step S102, and is not described herein.
S403, receiving a first sequence value sent by the first communication device.
S404, calculating a second secret key according to the first sequence value, the preset cyclic code and the second difference value.
In step S404, the second difference values may be averaged according to a preset cyclic code to obtain second sub-difference values; calculating the time domain amplitude difference value of the sub-carrier wave in the same time period and the adjacent sub-carrier wave in the second channel state information and a second multiple corresponding to the ratio of the difference value to the second sub-difference value; a second key is calculated based on the first sequence value and the second multiplier. The above process can be described in detail in fig. 2, and will not be described herein.
Alternatively, the new second number multiple may be acquired according to the description in step S103. The new second multiplier and the corresponding first sequence value may be summed to obtain a corresponding value. And converting the value into a corresponding Gray code as a second key.
S405, calculating a hash value of the second key, sending the hash value of the second key to the first communication device, and receiving the hash value of the first key sent by the first communication device.
In step S405, the description of step S405 is referred to in step S105, and is not described herein again.
S406, if the hash value of the first key is equal to the second hash value, determining that the second key is a key for performing communication between the first communication device and the second communication device.
In step S406, the description of step S406 is referred to in step S106, and is not repeated herein.
Fig. 5 is a schematic diagram of an application scenario provided by the present invention. As shown in fig. 5, the method of generating a key may include the steps of:
the method comprises the steps that communication is established between a device A and a device B, the device A sends a first signal to the device B, and the device B extracts second channel state information from the first signal; device B sends second information to device a, which extracts the first channel state information from the second signal. The device a and the device B respectively calculate the difference between the maximum value and the minimum value of the time domain amplitude of the subcarrier on the first channel state information and the second channel state information which are respectively extracted. And the equipment A and the equipment B respectively divide the obtained difference equally according to the preset cyclic code to respectively obtain a first sub-difference and a second sub-difference. The device A calculates the time domain amplitude difference between the sub-carrier and the adjacent sub-carrier in the same time period and the first multiple corresponding to the ratio of the difference to the first sub-difference, and performs addition and subtraction operation and modulus operation on the first multiple to obtain a new first multiple. And taking the gray code corresponding to the new first multiple as a first key, recording the operation of addition and subtraction as a first sequence value, and sending the first sequence value to the device B. And the device B receives the first sequence value sent by the device A, calculates a new second multiple according to the method of the device A, adds the first sequence value and the new second multiple to obtain a corresponding numerical value, uses the Gray code corresponding to the obtained data as a second key, and calculates the Hash value of the second key. The device A calculates the hash value of the first key and sends the hash value to the device B, the device B sends the hash value of the second key to the device A, the device A compares the hash value of the first key with the hash value of the second key, and if the hash value of the first key is the same as the hash value of the second key, the first key can be used as a key for communication between the device A and the device B; similarly, device B compares the hash value of the first key with the hash value of the second key, and if the two are the same, determines that the second key can be used as the key for device a and device B to communicate. Otherwise, the channel state information generation key is acquired again.
Fig. 6 is a schematic diagram of a composition structure of an embodiment of a key generation apparatus provided in the present invention, and as shown in fig. 6, the key generation apparatus, applied to a first communication device, includes:
a first extracting module 601, configured to receive a second signal sent by a second communication device, and extract first channel state information from the second signal;
a first calculating module 602, configured to calculate a first difference between a maximum value and a minimum value of a time-domain amplitude of a subcarrier in the first channel state information;
a second calculating module 603, configured to calculate a first key and a first sequence value according to a preset cyclic code and a first difference value;
a first sending module 604 for sending the first sequence value to the second communication device;
a first sending and receiving module 605, configured to calculate a hash value of the first key, send the hash value of the first key to the second communication device, and receive the hash value of the second key sent by the second communication device;
the first determining module 606 is configured to determine that the first key is a key for performing communication between the first communication device and the second communication device if the hash value of the first key is equal to the second hash value.
Optionally, the second calculating module 603 includes:
the averaging unit is used for averaging the first difference value according to a preset cyclic code to obtain a first sub-difference value;
the first calculation unit is used for calculating the time domain amplitude difference value of the sub-carrier wave in the same time period and the adjacent sub-carrier wave in the first channel state information and the first multiple corresponding to the ratio of the difference value to the first sub-difference value;
and the second calculation unit is used for calculating the first key and the first sequence value according to the first multiple.
Optionally, the second computing unit comprises:
the operation subunit is used for sequentially performing addition and subtraction operation and modulus operation on the first multiple to obtain a new first multiple;
the determining subunit is used for taking the gray code corresponding to the new first multiple as a first key;
and the recording subunit is used for determining the coding value corresponding to the addition and subtraction operation according to a preset rule and taking the determined coding value as a first sequence value.
Fig. 7 is a schematic diagram of a composition structure of another embodiment of a key generation apparatus provided in the present invention, and as shown in fig. 7, the key generation apparatus, applied to a second communication device, includes:
a second extracting module 701, configured to receive a first signal sent by a first communication device, and extract second channel state information from the first signal;
a third calculating module 702, configured to calculate a second difference between a maximum value and a minimum value of the time-domain amplitude of the subcarrier in the second channel state information;
a second receiving module 703, configured to receive a first sequence value sent by the first communications device;
a fourth calculating module 704, configured to calculate a second key according to the first sequence value, a preset cyclic code, and the second difference;
a second sending and receiving module 705, configured to calculate a hash value of the second key, send the hash value of the second key to the first communication device, and receive the hash value of the first key sent by the first communication device;
the second determining module 706 is configured to determine that the second key is a key for performing communication between the first communication device and the second communication device if the hash value of the first key is equal to the second hash value.
Optionally, the second sending and receiving module 704 includes:
the averaging unit is used for averaging the second difference value according to a preset cyclic code to obtain a second sub-difference value;
the first calculating unit is used for calculating the time domain amplitude difference value of the subcarrier in the same time period and the adjacent subcarrier in the second channel state information and a second multiple corresponding to the ratio of the difference value to the second sub-difference value;
a second calculation unit for calculating a second key based on the first sequence value and the second multiplier.
Fig. 8 illustrates a schematic structural diagram of an electronic device. As shown in fig. 8, the head mounted device may include: a processor (processor)801, a communication Interface (Communications Interface)802, a memory (memory)803 and a communication bus 804, wherein the processor 801, the communication Interface 802 and the memory 803 complete communication with each other through the communication bus 804. The processor 801 may call logic instructions in the memory 803 to perform a key generation method comprising:
receiving a second signal sent by second communication equipment, and extracting first channel state information from the second signal; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and a first difference value; sending the first sequence value to the second communication device; and calculating the hash value of the first key, sending the hash value of the first key to the second communication equipment, receiving the hash value of the second key sent by the second communication equipment, and determining the first key as the key for communication between the first communication equipment and the second communication equipment if the hash value of the first key is equal to the second hash value.
In addition, the logic instructions in the memory 803 may be implemented in the form of software functional modules and stored in a computer readable storage medium when the software functional modules are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the key generation method provided by the above methods, the method comprising:
receiving a second signal sent by second communication equipment, and extracting first channel state information from the second signal; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and a first difference value; sending the first sequence value to the second communication device; calculating a hash value of the first key, sending the hash value of the first key to the second communication equipment, and receiving the hash value of the second key sent by the second communication equipment; and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the key generation method provided by the above methods, the method including:
receiving a second signal sent by second communication equipment, and extracting first channel state information from the second signal; calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information; calculating a first key and a first sequence value according to a preset cyclic code and a first difference value; sending the first sequence value to the second communication device; receiving a hash value of a second key sent by a second communication device; and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device.
The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A key generation method, applied to a first communication device, comprising:
receiving a second signal sent by second communication equipment, and extracting first channel state information from the second signal;
calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information;
calculating a first key and a first sequence value according to a preset cyclic code and the first difference value;
transmitting the first sequence value to the second communications device;
calculating a hash value of the first key, sending the hash value of the first key to the second communication device, and receiving the hash value of the second key sent by the second communication device;
and if the hash value of the first key is equal to the second hash value, determining that the first key is a key for communication between the first communication device and the second communication device.
2. The key generation method of claim 1, wherein the calculating a first key and a first sequence value according to a preset cyclic code and the first difference value comprises:
according to the preset cyclic code, the first difference value is evenly divided to obtain a first sub-difference value;
calculating the difference value of the time domain amplitudes of the subcarriers in the same time period and the adjacent subcarriers in the first channel state information, and a first multiple corresponding to the ratio of the difference value to the first sub-difference value;
calculating the first key and the first sequence value according to the first multiple.
3. The key generation method of claim 2, wherein said calculating the first key and the first sequence value from the first multiple comprises:
sequentially performing addition and subtraction operation and modulus operation on the first multiple to obtain a new first multiple;
taking the gray code corresponding to the new first multiple as the first key;
and determining a code value corresponding to the addition and subtraction operation according to a preset rule, and taking the determined code value as the first sequence value.
4. A key generation method, applied to a second communication device, comprising:
receiving a first signal sent by first communication equipment, and extracting second channel state information from the first signal;
calculating a second difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the second channel state information;
receiving a first sequence value sent by the first communication device;
calculating a second key according to the first sequence value, a preset cyclic code and the second difference value;
calculating a hash value of the second key, sending the hash value of the second key to the first communication equipment, and receiving the hash value of the first key sent by the first communication equipment;
and if the hash value of the first key is equal to the second hash value, determining that the second key is a key for communication between the first communication device and the second communication device.
5. The key generation method of claim 4, wherein the calculating a second key according to the first sequence value, a preset cyclic code and the second difference value comprises:
the second difference value is evenly divided according to the preset cyclic code to obtain a second sub-difference value;
calculating the difference value of the time domain amplitudes of the subcarriers in the same time period and the adjacent subcarriers in the second channel state information, and a second multiple corresponding to the ratio of the difference value to the second sub-difference value;
calculating the second key from the first sequence value and the second multiplier.
6. A key generation apparatus, applied to a first communication device, comprising:
the first extraction module is used for receiving a second signal sent by second communication equipment and extracting first channel state information from the second signal;
the first calculation module is used for calculating a first difference value between the maximum value and the minimum value of the time domain amplitude of the subcarrier in the first channel state information;
the second calculation module is used for calculating a first secret key and a first sequence value according to a preset cyclic code and the first difference value;
a first sending module, configured to send the first sequence value to the second communication device;
the first sending and receiving module is used for calculating a hash value of the first key, sending the hash value of the first key to the second communication equipment and receiving the hash value of the second key sent by the second communication equipment;
a first determining module, configured to determine that the first key is a key for performing communication between the first communication device and the second communication device if the hash value of the first key is equal to the second hash value.
7. A key generation apparatus applied to a second communication device, comprising:
the second extraction module is used for receiving a first signal sent by first communication equipment and extracting second channel state information from the first signal;
a third calculating module, configured to calculate a second difference between a maximum value and a minimum value of a time-domain amplitude of a subcarrier in the second channel state information;
a second receiving module, configured to receive a first sequence value sent by the first communication device;
a fourth calculating module, configured to calculate a second key according to the first sequence value, a preset cyclic code, and the second difference;
the second sending and receiving module is used for calculating a hash value of the second key, sending the hash value of the second key to the first communication equipment and receiving the hash value of the first key sent by the first communication equipment;
a second determining module, configured to determine that the second key is a key for performing communication between the first communication device and the second communication device if the hash value of the first key is equal to the second hash value.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the key generation method according to any of claims 1 to 5 are implemented when the processor executes the program.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the key generation method according to any one of claims 1 to 5.
10. A computer program product having stored thereon executable instructions, characterized in that the instructions, when executed by a processor, cause the processor to carry out the steps of the key generation method according to any of claims 1 to 5.
CN202111475278.0A 2021-12-03 2021-12-03 Key generation method and device Pending CN114040395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111475278.0A CN114040395A (en) 2021-12-03 2021-12-03 Key generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111475278.0A CN114040395A (en) 2021-12-03 2021-12-03 Key generation method and device

Publications (1)

Publication Number Publication Date
CN114040395A true CN114040395A (en) 2022-02-11

Family

ID=80139902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111475278.0A Pending CN114040395A (en) 2021-12-03 2021-12-03 Key generation method and device

Country Status (1)

Country Link
CN (1) CN114040395A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5828317A (en) * 1994-09-16 1998-10-27 Alpine Electronics, Inc. Remote control method and remote control system
US8270602B1 (en) * 2009-08-13 2012-09-18 Sandia Corporation Communication systems, transceivers, and methods for generating data based on channel characteristics
CN110213767A (en) * 2019-06-03 2019-09-06 西北工业大学 Physical layer key extraction method based on channel gain compensation and subcarrier correlation
US20190373458A1 (en) * 2018-06-05 2019-12-05 Drexel University Physical Layer Key based Interleaving for Secure Wireless Communication
US20200351255A1 (en) * 2019-05-02 2020-11-05 Electronics And Telecommunications Research Institute Method and apparatus for communications using secret key in communication system
WO2021088213A1 (en) * 2019-11-06 2021-05-14 南京邮电大学 Method and apparatus for generating frequency hopping sequence on basis of wireless channel physical layer key
CN113114455A (en) * 2021-03-16 2021-07-13 中国人民解放军陆军工程大学 Symmetric key generation method, device and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5828317A (en) * 1994-09-16 1998-10-27 Alpine Electronics, Inc. Remote control method and remote control system
US8270602B1 (en) * 2009-08-13 2012-09-18 Sandia Corporation Communication systems, transceivers, and methods for generating data based on channel characteristics
US20190373458A1 (en) * 2018-06-05 2019-12-05 Drexel University Physical Layer Key based Interleaving for Secure Wireless Communication
US20200351255A1 (en) * 2019-05-02 2020-11-05 Electronics And Telecommunications Research Institute Method and apparatus for communications using secret key in communication system
CN110213767A (en) * 2019-06-03 2019-09-06 西北工业大学 Physical layer key extraction method based on channel gain compensation and subcarrier correlation
WO2021088213A1 (en) * 2019-11-06 2021-05-14 南京邮电大学 Method and apparatus for generating frequency hopping sequence on basis of wireless channel physical layer key
CN113114455A (en) * 2021-03-16 2021-07-13 中国人民解放军陆军工程大学 Symmetric key generation method, device and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭登科: "基于无线信道状态信息的密钥提取方案设计与实现", 信号处理, vol. 37, no. 3 *

Similar Documents

Publication Publication Date Title
CN112788599B (en) Physical layer key generation method based on channel state information
CN107483212A (en) A kind of method of both sides' cooperation generation digital signature
CN110336657B (en) Optical OFDM dynamic key generation method based on channel characteristics
CN110086616B (en) Forward one-time pad secret communication method based on wireless channel
CN112533199A (en) OFDM channel physical key generation method and device based on USRP and computer equipment
CN110336664B (en) SM2 cryptographic algorithm-based cross-domain authentication method for information service entity
EP3190842B1 (en) Data transmission method and device
CN101873292A (en) Signal emission and reception method of transform domain communication system and functional module framework
Zhou et al. Physical layer dynamic key encryption in OFDM-PON system based on cellular neural network
CN114390519A (en) Wireless channel key generation method, device, equipment and storage medium
CN111147222B (en) Reciprocal random source extraction method and device for time division duplex system
CN108737097A (en) A kind of elliptic curve cryptography method using quantum random number
CN112579045A (en) Method and device for generating pseudorandom sequence and storage medium
CN114040395A (en) Key generation method and device
KR100584604B1 (en) Method of generating key for authenticating device, the apparatus therefor, device authentication method and the apparatus therefor
Zhuo et al. Secure scheme for OFDM-PON system using TR based on modified Henon chaos
CN114221753B (en) Key data processing method and electronic equipment
US11889444B2 (en) Synchronization signal transmission method and terminal device
CN111277529A (en) Communication device and communication method
US20140301554A1 (en) Key insulation method and device
CN112104444B (en) Reference signal sending method, terminal and network side equipment
CN107431906A (en) Reference signal is sent and method of reseptance and device
CN111404673A (en) Quantum key distribution method and equipment
CN110300449B (en) Secure communication method and device based on pseudo multipath
CN112887336B (en) Communication safety protection method and device

Legal Events

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