Channel key generation method and data transmission method
By updating the target random vector and initial key in wireless communication and generating a new channel key, the problem of slow channel environment changes is solved, resulting in reduced key uniqueness, and the security of data transmission is improved.
Patent Information
- Application Number
- CN202211114863.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-09-14
AI Technical Summary
In wireless communication, due to slow changes in the channel environment, the uniqueness of the generated channel key is reduced, which affects the security and secretness of the communication environment.
By responding to the key generation request, the target random vector is obtained, the channel key is generated based on the initial key and the target random vector, and when a new key generation request is generated, the target random vector and the initial key are updated to generate a new channel secret key.
The security of the channel key is improved, ensuring that the key can change with the change of channel status information between the two parties in the communication, thereby enhancing the security of data transmission.
Smart Images

Figure CN115567933B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication encryption technology, and in particular to a channel key generation method, a data transmission method, an apparatus, a computer device and a storage medium. Background Art
[0002] With the continuous advancement of 5G construction, mobile communications are moving towards the goals of ultra-high-speed data transmission, ultra-wide wireless coverage, ultra-large number of device interconnections, and ultra-low data latency. 5G services will gradually expand from consumption to various vertical industries, and 5G+ industry application scenarios will also be fully opened. However, due to the broadcast characteristics of wireless channels, wireless communication networks are particularly vulnerable to eavesdropping attacks. In response to eavesdropping attacks, the security requirements of wireless communication network confidentiality ensure that eavesdroppers cannot read confidential information.
[0003] Traditional wireless secure communication methods use traditional cryptographic schemes such as symmetric and asymmetric cryptographic algorithms. Security depends on the reliability of third-party organizations (CA), mathematical difficulties, and the complexity of cryptographic schemes. The implementation of security is limited by the number of reliable third-party organizations and the computing power of terminals. With the rapid increase in the number of network connections and the development of heterogeneous networks, the above defects restrict the implementation of secure communications and increase the security risks of users.
[0004] Physical layer keys based on physical characteristics can achieve the distribution and update of keys based on wireless channel characteristics without the need for traditional cryptographic schemes by utilizing the characteristics of wireless communication devices, channels and noise, thereby achieving confidentiality of wireless secure communications. As a supplement to traditional wireless secure communication methods, wireless secure transmission theory and technology based on physical characteristics has broad application prospects.
[0005] However, in the actual physical layer key generation process, the channel environment usually faces a quasi-static state where the channel environment changes slowly, which will reduce the uniqueness of the key and thus affect the security and confidentiality of the communication environment. Summary of the invention
[0006] Based on this, it is necessary to provide a channel key generation method, data transmission method, device, computer equipment and storage medium that can improve the security of the channel key in response to the above technical problems.
[0007] In a first aspect, the present application provides a channel key generation method, comprising:
[0008] In response to the key generation request, a target random vector is obtained, wherein the target random vector is generated according to channel state information obtained by channel detection of both communicating parties;
[0009] An initial key is obtained, and a channel key is generated according to the initial key and the target random vector, wherein after the channel key corresponding to the current key generation request is generated, a new target random vector is obtained in response to a new key generation request, and a channel key corresponding to a new key generation request is generated according to the new target random vector and the channel key corresponding to the current key generation request.
[0010] In one embodiment, the method further comprises:
[0011] When the key generation request is a first key generation request, determining the initial key according to an initial random vector; the initial random vector is generated based on channel state information obtained by channel detection between the communicating parties after the first key generation request;
[0012] When the key generation request is not the first key generation request, the channel key generated in the last key generation request before the non-first key generation request is used as the initial key.
[0013] In one embodiment, the initial random vector includes a first initial random vector and a second initial random vector; and the step of determining the initial key according to the initial random vector includes:
[0014] The initial key is determined according to the first initial random vector and the second initial random vector.
[0015] In one embodiment, determining the initial key according to the first initial random vector and the second initial random vector includes:
[0016] Performing obfuscation encryption processing on the first initial random vector to obtain an obfuscation result; performing XOR processing on the obfuscation result and the second initial random vector to obtain an XOR processing result; performing obfuscation encryption processing on the XOR processing result to obtain an initial key;
[0017] Alternatively, performing an XOR process on the first initial random vector and the second initial random vector to obtain an initial key;
[0018] Alternatively, the first initial random vector and the second initial random vector are subjected to an XOR process, and then an obfuscated encryption process is performed on the XOR process result to obtain the initial key.
[0019] In one embodiment, the step of determining the initial key according to the initial random vector comprises:
[0020] Using an initial random vector generated by a channel detection between the two communicating parties as the initial key;
[0021] Alternatively, the initial random vector generated by a channel detection between the two communicating parties is subjected to obfuscation encryption processing to obtain the initial key.
[0022] In one embodiment, the step of obtaining an initial key and generating a channel key according to the initial key and the target random vector includes:
[0023] Performing an XOR process on the initial key and the target random vector to obtain an XOR process result;
[0024] The XOR processing result is subjected to obfuscation encryption processing to obtain the channel key.
[0025] In one embodiment, the method further comprises:
[0026] When the key generation request is a first key generation request, determining the initial key according to an initial random vector, the preset vector, a current value of a counter, and the target random vector; the initial random vector is generated based on channel state information obtained by channel detection between two communicating parties after the first key generation request;
[0027] When the key generation request is not the first key generation request, the channel key generated in the last key generation request before the non-first key generation request is used as the initial key.
[0028] In one embodiment, the step of determining the initial key according to the initial random vector, the preset vector, the current value of the counter and the target random vector comprises:
[0029] Determine a reference vector according to the preset vector and a current value of the counter;
[0030] Performing obfuscation encryption processing on the initial random vector to obtain an obfuscation result;
[0031] The obfuscation result, the reference vector and the target random vector are subjected to XOR processing, and the result of the XOR processing is subjected to obfuscation encryption processing to obtain the initial key.
[0032] In one embodiment, the step of obtaining an initial key and generating a channel key according to the initial key and the target random vector includes:
[0033] Determine a reference vector according to the preset vector and a current value of the counter;
[0034] Performing XOR processing on the target random vector, the reference vector, and the initial key, and then performing obfuscation encryption processing on the result of the XOR processing to obtain the channel key;
[0035] After the channel key corresponding to the key generation request is determined, the value of the counter is updated according to a preset step.
[0036] In one embodiment, the step of determining a reference vector according to the preset vector and a current value of a counter comprises:
[0037] The preset vector and the current value of the counter are combined to obtain the reference vector.
[0038] In a second aspect, the present application also provides a data transmission method, applied to a sending end, comprising:
[0039] receiving data transmission instructions;
[0040] Encrypting the data to be transmitted according to the channel key generated by the channel key generation method in any of the above embodiments to obtain encrypted data;
[0041] Transmit the encrypted data to a receiving end.
[0042] In a third aspect, the present application also provides a channel key generation device, including:
[0043] An acquisition module, configured to respond to a key generation request and acquire a target random vector, wherein the target random vector is generated according to channel state information obtained by channel detection by both communicating parties;
[0044] A generation module is used to obtain an initial key and generate a channel key according to the initial key and a target random vector, wherein after generating a channel key corresponding to a current key generation request, in response to a new key generation request, a new target random vector is obtained, and a channel key corresponding to a new key generation request is generated according to the new target random vector and the channel key corresponding to the current key generation request.
[0045] In a fourth aspect, the present application further provides a data transmission device, which is arranged at a transmitting end and includes:
[0046] A receiving module, used for receiving a data transmission instruction;
[0047] An encryption module, used to encrypt the data to be transmitted according to the channel key generated by the channel key generation method in any of the above embodiments to obtain encrypted data;
[0048] The transmission module is used to transmit the encrypted data to the receiving end.
[0049] In a fifth aspect, the present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned channel key generation method when executing the computer program.
[0050] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the channel key generation method are implemented.
[0051] The above-mentioned channel key generation method, data transmission method, device, computer equipment and storage medium can obtain channel state information based on channel detection performed by the communicating parties, and process the channel state information and the initial key obtained during the current key generation request to obtain the channel key. When the communicating parties need to encrypt the transmitted data, the channel key generation method can generate a corresponding channel key based on the real-time channel state information of the communicating parties when receiving the key generation request. The channel key can change with the change of the channel state information of the communicating parties, which solves the eavesdropping attack security problem caused by insufficient channel key change rate due to slow changes in the channel environment of the communicating parties, thereby improving the security of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A diagram showing an application environment of a channel key generation method in an embodiment;
[0053] Figure 2 Schematic diagram of the process of generating a channel key in the first embodiment;
[0054] Figure 3 Schematic diagram of the flow of the channel key generation method in the second embodiment;
[0055] Figure 4 Schematic diagram of the flow of the channel key generation method in the third embodiment;
[0056] Figure 5 Schematic diagram of the flow of the channel key generation method in the fourth embodiment;
[0057] Figure 6 is a flow chart of a channel key generation method in a fifth embodiment;
[0058] Figure 7 is a flow chart of a channel key generation method in a sixth embodiment;
[0059] Figure 8 A schematic diagram of a flow chart of a data transmission method in an embodiment;
[0060] Fig. 9 is a structural block diagram of a channel key generating device in an embodiment;
[0061] Fig.10is a structural block diagram of a data transmission device in one embodiment;
[0062] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] The channel key generation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The terminal 104 can be connected to the server 102. Among them, the above-mentioned terminal 104 can be but not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The above-mentioned server 102 can be implemented with an independent server or a server cluster composed of multiple servers. The above-mentioned server 102 can be connected to a data storage system, and the above-mentioned data storage system can store data that needs to be encrypted by the server 102. The data storage system can be integrated on the server 102, or it can be placed on the cloud or other network servers.
[0065] For example, the channel key generation method is applied to the terminal 104. After receiving the key generation request, the terminal 104 obtains the channel state information obtained by the channel detection of the communicating parties, and generates a target random vector based on the channel state information, and then obtains the initial key, and generates a channel key based on the initial key and the target random vector. The channel key generated by the terminal 104 can be transmitted to a memory for storage, which can be an independent storage device, or the memory can be built into the server 102, or the memory can be located on another terminal 104.
[0066] For another example, the channel key generation method is applied to the server 102. After receiving the key generation request, the server 102 obtains the channel state information obtained by the channel detection of the communicating parties, and generates a target random vector based on the channel state information, and then obtains the initial key, generates a channel key based on the initial key and the target random vector, and transmits the generated channel key to the memory for storage. The memory can be an independent storage device or built into the server 102.
[0067] In one embodiment, a channel key generation method is provided. This embodiment uses the channel key generation method applied to a processor as an example. It can be understood that the processor can be located in a terminal or a server. Figure 2 As shown, the channel key generation includes:
[0068] Step 202: In response to the key generation request, a target random vector is obtained, wherein the target random vector is generated according to channel state information obtained by channel detection by both communicating parties.
[0069] The key generation request can be a signal instruction directly received by the processor from the user, or a signal instruction automatically generated by the processor when the processor monitors that the user sends a data sending request that meets the preset conditions to the sending end of the two communicating parties; or a signal instruction continuously generated by the processor according to a preset second generation frequency when the processor monitors that the user sends a data sending request that meets the preset conditions to the sending end of the two communicating parties. The above preset condition can be that the data sending request requires the sending end of the two communicating parties to send encrypted data to the receiving end, that is, it can be understood that when the two communicating parties need to encrypt the transmitted data, the processor automatically generates a key generation request.
[0070] The communicating parties can perform channel detection by sending pilot signals to each other to obtain channel state information, which includes but is not limited to the average signal energy of the channel, steady-state channel state information (CSI) and transient CSI, which can be used to describe the channel characteristics.
[0071] The generation process of the target random vector includes: the processor first detects the connection channel of the two communicating parties, the processor controls the transmitting end to send a pilot signal to the receiving end, the receiving end performs channel detection according to the pilot signal, obtains the corresponding channel state information, and the processor quantizes the channel state information to generate a first detection vector with a preset bit length. Further, the processor controls the receiving end to send a pilot signal to the transmitting end, the transmitting end performs channel detection according to the pilot signal, obtains the channel state information, and the processor quantizes the channel state information to generate a second detection vector with a preset bit length. Then, the reconciliation and error correction processing is performed, and the processor receives the reconciliation and error correction information sent by the transmitting end and the integrity check code of the second detection vector, such as the MD5 code. The processor reconciles and corrects the first detection vector through the reconciliation and error correction information, and calculates the integrity check code for the error-corrected result. The algorithms used in the reconciliation and error correction process include reconciliation algorithms and error correction algorithms, such as Low Density Parity Check Code (LDPC), polar code, Bose code (BoseChaudhuri Hocquenghemcodes, BCH), BBBSS protocol, etc. Then the processor compares the integrity check code of the first detection vector with the integrity check code of the second detection vector to obtain a comparison result. If the comparison result indicates that the integrity check code of the first detection vector and the integrity check code of the second detection vector are inconsistent, the processor stops generating the target random vector and issues an alarm to prompt the user that the channel state between the sender and the receiver is abnormal; if the comparison result indicates that the integrity check code of the first detection vector and the integrity check code of the second detection vector are consistent, the processor further uses the hash function library preset by the communicating parties to perform privacy amplification processing on the first detection vector or the second detection vector. In this process, the communicating parties use the same hash function related parameters through channel negotiation. The related parameters can be understood as a preset matrix. After the preset matrix is multiplied with the first detection vector or the second detection vector, a vector of a fixed length can be obtained. The vector of the fixed length is the latest generated target random vector.
[0072] Specifically, the fixed length may be 128 bits.
[0073] In the channel key generation method of the above embodiment, the processor controls the two parties of the communication connection to send pilot signals to each other to perform channel detection according to the key generation request, obtains channel state information of both parties of the channel, and processes the channel state information to obtain the target random vector.
[0074] In step 202, when the communicating parties need to encrypt the transmitted data, the processor continuously generates the target random vector according to the preset first generation frequency, for example, and when the processor obtains the key generation request according to the second generation frequency, in response to each key generation request, the processor obtains the latest generated target random vector. The second generation frequency and the first generation frequency may be different, that is, it can be understood that the generation process of the target random vector and the generation process of the key generation request are independent of each other.
[0075] Step 204: Acquire an initial key, and generate a channel key according to the initial key and the target random vector, wherein, after generating the channel key corresponding to the current key generation request, in response to a new key generation request, acquire a new target random vector, and generate a channel key corresponding to a new key generation request according to the new target random vector and the channel key corresponding to the current key generation request.
[0076] In step 204, the processor obtains the channel key according to the target random vector and the initial key, and the target random vector is generated according to the real-time channel state information of the communicating parties, and can reflect the change of the channel state of the communicating parties, so that the channel keys corresponding to different key generation requests can be different according to the change of the real-time channel state of the channel of the communicating parties, thereby ensuring the difference between the continuously generated channel keys.
[0077] In the channel key generation method of the above embodiment, after obtaining the latest generated target random vector, the processor obtains the initial key corresponding to the current key generation request according to the channel state information of the communicating parties, and obtains the channel key corresponding to the current key generation request according to the initial key and the target random vector, completing the channel key generation process. When receiving the next key generation request, the processor again obtains the target random vector corresponding to the new key generation request, and generates the channel key corresponding to the new key generation request according to the new target random vector and the channel key corresponding to the previous key generation request, completing the new channel key generation process. Moreover, it can be seen from the foregoing content that the key generation instruction can be a signal instruction that the processor automatically generates continuously at a preset generation frequency, that is, it can be understood that the channel key generation process is an automatically iterative generation process, and the processor continuously iterates and generates new channel keys during data transmission between the communicating parties.
[0078] In the above-mentioned channel key generation method, when the communicating parties need to encrypt the transmitted data, the processor obtains the target random vector according to the key generation request, and the target random vector is generated by the processor according to the first generation frequency. The generation process of the target random vector includes: the processor controls the communicating parties to perform a channel detection to obtain channel state information, and then the processor processes the channel state information to generate a target random vector; then the processor obtains the channel state information again according to the channel detection additionally performed by the communicating parties, and obtains the initial key according to this channel state information, and finally the processor combines the target random vector and the initial key to obtain the channel key. According to actual needs, the processor can continuously obtain new channel keys according to the continuously updated key generation request, which ensures that the channel keys used by the communicating parties can be continuously updated, which solves the eavesdropping attack security problem caused by the slow change of the channel keys of the communicating parties for a long time, and improves the security of data transmission.
[0079] In some optional embodiments, the channel key generation method also includes: when the key generation request is the first key generation request, determining the initial key based on the initial random vector; the initial random vector is generated based on the channel state information obtained by channel detection between the communicating parties after the first key generation request; when the key generation request is not the first key generation request, using the channel key generated in the last key generation request of the non-first key generation request as the initial key.
[0080] The generation process of the initial random vector includes: before receiving the first key generation request corresponding to the communicating parties, for example, when the communicating parties have just established a communication connection, the processor controls the communicating parties to perform a channel detection to obtain channel state information, and further quantizes, reconciles error correction and privacy amplification on the channel state information to obtain the initial random vector. Specifically, the generation process of the initial random vector is the same as the generation process of the target random vector, which will not be repeated here.
[0081] When receiving a key generation request, the processor first determines whether the key generation request is the first time the key generation request corresponding to the current communicating parties is received. If so, the initial key is determined according to the initial random vector obtained when the communicating parties just establish a communication connection. If not, the channel key corresponding to the current key generation request is determined according to the channel key generated when the key generation request corresponding to the current communicating parties was received last time.
[0082] The process of determining whether the key generation request is the first time that the key generation request corresponding to the current communicating parties is received may be to determine whether the key generation request corresponding to the current communicating parties is received for the first time within a preset time period. In this embodiment, if the communicating parties perform data transmission twice in succession, and the interval between the two transmission processes is less than the preset time period, then if the first key generation request is received during the latter data transmission process, the latest channel key generated during the previous data transmission process may be directly used as the initial key.
[0083] Alternatively, it may be determined whether it is the first time to receive a key generation request corresponding to the current two communicating parties starting from a new handshake between the two communicating parties. In this embodiment, if the two communicating parties perform data transmission twice in succession, the two communicating parties make a breakup request after completing the previous data transmission, and re-shake hands during the next data transmission. If the first key generation request during the next data transmission process is received, the initial key should be determined according to the initial random vector obtained by the two communicating parties during the re-handshake.
[0084] In the above-mentioned channel key generation method, the processor determines whether it is the first time to generate the channel key of the current communicating parties according to the received key generation request. If so, the initial key is determined according to the initial random vector and the target random key generated when the communicating parties establish a communication connection. If not, the channel key corresponding to the current one-time key generation request is determined according to the channel key generated when the key generation request was received last time and the target random key. Through this setting, the channel keys of the communicating parties can have higher and higher security in the process of frequent changes, and because the target random key is generated when the current one-time key generation request is received, the randomness of the latest channel key is also guaranteed.
[0085] In some optional embodiments, the initial random vector includes a first initial random vector and a second initial random vector; and the step of determining the initial key according to the initial random vector includes:
[0086] An initial key is determined according to the first initial random vector and the second initial random vector.
[0087] In some optional embodiments, determining the initial key according to the first initial random vector and the second initial random vector includes:
[0088] The first initial random vector is subjected to obfuscation encryption processing to obtain an obfuscation result; the obfuscation result is subjected to XOR processing with the second initial random vector to obtain an XOR processing result; the XOR processing result is subjected to obfuscation encryption processing to obtain an initial key.
[0089] Specifically, the first initial random vector is obfuscated by, for example, byte substitution (SubBytes), row shift (ShiftRows) and column confusion (MixColumns) to obtain an obfuscated result; the obfuscated result is further bitwise XORed with the second initial random key to obtain an XOR processing result, and then the XOR processing result is again subjected to byte substitution, row shift and column confusion processing in sequence to obtain the initial key.
[0090] The obfuscation process includes, for example, sorting the first initial random vector by bytes, splitting the first initial random vector according to preset byte values, and performing byte replacement, row shifting, and column obfuscation on the multiple byte sequences obtained after the splitting to obtain an obfuscated encrypted byte sequence, and finally recombining the obfuscated byte sequence in order to obtain the above obfuscated result. The process of obtaining the initial key by obfuscation is the same as the process of obtaining the obfuscation result by obfuscation, and will not be repeated here.
[0091] In some optional embodiments, determining the initial key according to the first initial random vector and the second initial random vector further includes:
[0092] The first initial random vector and the second initial random vector are XORed to obtain an initial key.
[0093] Specifically, the first initial random vector and the second initial random vector are subjected to bitwise XOR, and the XOR result is directly used as the initial key.
[0094] In some embodiments, determining the initial key according to the first initial random vector and the second initial random vector further includes:
[0095] The first initial random vector and the second initial random vector are subjected to XOR processing, and then the XOR processing result is subjected to obfuscation encryption processing to obtain an initial key.
[0096] Specifically, the first initial random vector and the second initial random vector are subjected to bitwise XOR, and the XOR processing result is subjected to byte replacement, row shift and column obfuscation processing in sequence to obtain the initial key.
[0097] In this embodiment, when a key generation request is received for the first time, the processor performs obfuscation encryption, bitwise XOR and other processing based on the first initial random vector and the second initial random vector, and obtains the initial key while ensuring security and confidentiality. The processor further generates a channel key corresponding to a subsequent non-first key generation request based on the initial key corresponding to the first key generation request.
[0098] In some other feasible embodiments, the initial random vector includes three or more initial random vectors. Taking the initial random vector including a first initial random vector, a second initial random vector, a third initial random vector and a fourth initial random vector as an example, determining the initial key according to the first initial random vector, the second initial random vector, the third initial random vector and the fourth initial random vector includes:
[0099] The first initial random vector is subjected to obfuscation encryption processing to obtain a first obfuscation result; the first obfuscation result is subjected to XOR processing with the second initial random vector to obtain a first XOR processing result; the first XOR processing result is subjected to obfuscation encryption processing to obtain a second obfuscation result; the second obfuscation result is subjected to XOR processing with the third initial random vector to obtain a second XOR processing result; the second XOR processing result is subjected to obfuscation encryption processing to obtain a third obfuscation result; the third obfuscation result is subjected to XOR processing with the fourth initial random vector to obtain a third XOR processing result; the third XOR processing result is subjected to obfuscation encryption processing to obtain an initial key.
[0100] In this embodiment, the number of initial random vectors included in the initial random vector can be changed according to the actual setting of the user. The process of obtaining the initial key according to the initial random vector can refer to the iterative processing process described in the embodiment in which the initial random vector includes the first initial random vector, the second initial random vector, the third initial random vector and the fourth initial random vector.
[0101] In some optional embodiments, the step of determining the initial key according to the initial random vector includes:
[0102] The initial random vector generated by a channel detection between the two communicating parties is used as the initial key;
[0103] Alternatively, an initial random vector generated by a channel detection between the two communicating parties is subjected to obfuscation encryption processing to obtain an initial key.
[0104] Specifically, in this embodiment, channel state information can be obtained based on channel detection between the communicating parties after the first key generation request, and then feature extraction, quantization, reconciliation and error correction, and privacy amplification and other processing can be performed on the channel state information to obtain an initial random vector, and the initial random vector can be directly used as the initial key; or, channel state information can be obtained based on channel detection between the communicating parties after the first key generation request, and then feature extraction, quantization, reconciliation and error correction, and privacy amplification and other processing can be performed on the channel state information to obtain an initial random vector, and the initial random vector can be further subjected to byte replacement, row shift, and column obfuscation processing in sequence to obtain the initial key.
[0105] In this embodiment, the processor will generate a corresponding channel key no matter whether it receives a first or non-first key generation request, that is, the first key generation request can also generate a channel key for encrypting data.
[0106] In some optional embodiments, the step of obtaining an initial key and generating a channel key according to the initial key and a target random vector includes:
[0107] Performing XOR processing on the initial key and the target random vector to obtain an XOR processing result;
[0108] The XOR processing result is obfuscated and encrypted to obtain the channel key.
[0109] In this embodiment, the processor performs bitwise XOR processing on the initial key and the target random vector, and performs byte replacement, row shift and column obfuscation processing on the XOR processing result in sequence to obtain the channel key corresponding to the current key generation request.
[0110] In some other optional embodiments, when the key generation request is the first key generation request, the corresponding channel key can be obtained after XOR processing of the initial random vector and the target random vector, wherein the initial random vector is generated based on the channel state information obtained by channel detection between the communicating parties after the first key generation request.
[0111] In some other optional embodiments, when the key generation request is the first key generation request, the target random vector may be directly used as the channel key.
[0112] In the above-mentioned channel key generation method, according to the key generation requests continuously received, the corresponding channel key can be obtained according to the real-time channel state information of the communicating parties, which solves the communication security risk caused by the channel key remaining unchanged for a long time when the communicating parties remain in a quasi-static state while maintaining a connection.
[0113] like Figure 3 As shown, in this embodiment, the channel key generation method includes:
[0114] Step 302: determine whether the key generation request is the first key generation request;
[0115] Step 3041: If it is the first key generation request, a first initial random vector and a second initial random vector are generated according to the channel state information obtained based on the channel detection of the communicating parties after the first key generation request, and the first initial random vector is subjected to obfuscation encryption processing to obtain an obfuscation result; the obfuscation result is subjected to XOR processing with the second initial random vector to obtain an XOR processing result; the XOR processing result is subjected to obfuscation encryption processing to obtain an initial key, and a new key generation request is continuously detected;
[0116] Step 3042: If it is the second key generation request, the initial key generated by the first key generation request is obtained; if it is the third or later key generation request, the channel key corresponding to the previous key generation request is used as the initial key;
[0117] Step 306: XOR the initial key and the target random vector to obtain an XOR result;
[0118] Step 308: Perform obfuscation encryption processing on the XOR processing result to obtain the channel key corresponding to the current key generation request, and continue to detect new key generation requests.
[0119] In the above-mentioned channel key generation method, when the key generation request is the first key generation request, an initial key is generated; when the key generation request is the second key generation request, a corresponding channel key is generated according to the initial key corresponding to the first key generation request; when the key generation request is the third or more key generation requests, the channel key corresponding to the previous key generation request is used as the initial key to generate the corresponding channel key; in a quasi-static state where the communicating parties maintain a connection, the channel key can be continuously updated, which greatly reduces the probability of security issues such as eavesdropping attacks; and the use of AES obfuscation encryption and bitwise XOR processing methods provides a guarantee for the security of the finally generated channel key.
[0120] like Figure 4 As shown, in this embodiment, the channel key generation method includes:
[0121] Step 402: determine whether the key generation request is the first key generation request;
[0122] Step 4041: if it is the first key generation request, generate a first initial random vector and a second initial random vector according to the channel state information obtained based on the channel detection of the communicating parties after the first key generation request, and perform obfuscation encryption processing on the first initial random vector and the second initial random vector to obtain an initial key;
[0123] Step 4042: If it is not the first key generation request, the channel key corresponding to the previous key generation request is used as the initial key;
[0124] Step 406: XOR the initial key and the target random vector to obtain an XOR result;
[0125] Step 408: Perform obfuscation encryption processing on the XOR processing result to obtain the channel key corresponding to the current one-time key generation request.
[0126] In the above-mentioned channel key generation method, when the key generation request is the first key generation request, the initial key is generated according to the initial random vector, and the channel key corresponding to the first key generation request is generated according to the initial key; when the key generation request is not the first key generation request, the channel key corresponding to the previous key generation request is used as the initial key to generate the corresponding channel key; in a quasi-static state where the communicating parties maintain a connection, the channel key can be continuously updated, which greatly reduces the probability of security issues such as eavesdropping attacks; and the use of AES obfuscation encryption and bitwise XOR processing methods provides a guarantee for the security of the finally generated channel key.
[0127] like Figure 5 As shown, in a possible implementation, the channel key generation method includes:
[0128] Step 502: Control the transmitting end to send a pilot signal to the receiving end, and the receiving end performs channel detection according to the pilot signal to obtain corresponding channel state information;
[0129] Step 504: quantize the channel state information acquired by the receiving end to generate a first detection vector;
[0130] Step 506: Control the receiving end to send a pilot signal to the transmitting end, and the transmitting end performs channel detection according to the pilot signal to obtain channel state information;
[0131] Step 508: quantize the channel state information acquired by the transmitting end to generate a second detection vector;
[0132] Step 510, receiving the reconciliation error correction information and the integrity check code of the second detection vector sent by the transmitting end;
[0133] Step 512: perform reconciliation and error correction on the first detection vector according to the reconciliation and error correction information, and calculate an integrity check code for the error-corrected result;
[0134] Step 514: compare the integrity check code of the first detection vector after error correction with the integrity check code of the second detection vector after error correction to obtain a comparison result;
[0135] Step 516: When the comparison result indicates consistency, in response to the first key generation request, generate a first initial random vector and a second initial random vector according to channel state information obtained based on channel detection of the communicating parties;
[0136] Step 518: Perform obfuscation encryption processing on the first initial random vector to obtain an obfuscation result; perform XOR processing on the obfuscation result and the second initial random vector to obtain an XOR processing result; perform obfuscation encryption processing on the XOR processing result to obtain an initial key;
[0137] Step 520: In response to the second channel key generation request, the channel state information obtained by the channel detection of the communicating parties is acquired again, and a target random vector is generated according to the channel state information;
[0138] Step 522: XOR the initial key generated by the first key generation request and the target random vector to obtain an XOR processing result; perform obfuscation encryption processing on the XOR processing result to obtain a channel key;
[0139] Step 524: In response to the third and subsequent channel key generation requests, the channel key corresponding to the previous channel key generation request is used as the initial key, the initial key and the target random vector are XORed to obtain an XOR result, and the XOR result is obfuscated and encrypted to obtain the channel key.
[0140] In the above-mentioned channel key generation method, after the communication parties establish a communication connection, the processor first verifies the integrity of the channel between the sender and the receiver. When the verification result is that the integrity check code of the first detection vector and the integrity check code of the second detection vector are consistent, it is considered that the channel between the communication parties meets the communication requirements. At this time, in response to the first key generation request, the first initial random vector and the second initial random vector are generated according to the channel state information obtained by the channel detection of the communication parties, and the initial key is determined according to the first initial random vector and the second initial random vector. Subsequently, in response to the second key generation request, the channel state information obtained by the channel detection of the communication parties is obtained again, and the target random vector is generated according to the channel state information. According to the initial key corresponding to the first key generation request, the channel key corresponding to the second key generation request is determined, and when responding to the subsequent key generation request, the channel state information obtained by the channel detection of the communication parties is re-acquired, and the target random vector corresponding to the current key generation request is generated according to the channel state information. Further, according to the target random vector and the channel key corresponding to the previous channel key generation request, the channel key corresponding to the current key generation request is determined. Through this setting, the continuous update of the channel keys of the communication parties is realized, and the security of data transmission is ensured.
[0141] In some optional embodiments, the channel key generation method further includes:
[0142] When the key generation request is the first key generation request, the initial key is determined according to the initial random vector, the preset vector, the current value of the counter and the target random vector; the initial random vector is generated based on the channel state information obtained by channel detection between the communicating parties after the first key generation request;
[0143] When the key generation request is not the first key generation request, the channel key generated in the last key generation request of the non-first key generation request is used as the initial key.
[0144] The generation process of the initial random vector includes: before receiving the first key generation request corresponding to the communicating parties, for example, when the communicating parties have just established a communication connection, the processor controls the communicating parties to perform a channel detection to obtain channel state information, and further performs feature extraction, quantization, harmonization and error correction, and privacy amplification on the channel state information to obtain the initial random vector.
[0145] As an example, when the key generation request is the first key generation request, the processor initializes the counter so that the value of the counter is 0 and the length of the counter is fixed.
[0146] When the processor receives a key generation request, it first determines whether the key generation request is the first key generation request corresponding to the current communicating parties. If so, the initial key is determined based on the initial random vector, preset vector, current value of the counter and target random vector obtained when the communicating parties just establish a communication connection. If not, the channel key generated in the last key generation request is directly used as the initial key.
[0147] In the channel key generation method of the above embodiment, the processor determines whether it is the first time to generate the channel key of the current communicating parties according to the received key generation request. If so, the initial key is determined according to the initial random vector, preset vector, current value of the counter and target random vector generated when the communicating parties establish the communication connection. If not, the channel key generated in the last key generation request is directly used as the initial key, and after obtaining the initial key, the value of the counter is updated according to the preset step, so that the next key generation request can obtain the initial key according to the updated value of the counter. Through this setting, the channel keys of the communicating parties can have higher and higher security in the process of frequent changes, and because the initial random vector is generated in real time when the current key generation request is received, the randomness of the latest channel key is also guaranteed.
[0148] In some optional embodiments, the step of determining the initial key according to the initial random vector, the preset vector, the current value of the counter and the target random vector includes:
[0149] A reference vector is determined according to a preset vector and a current value of a counter; an initial random vector is subjected to obfuscation encryption processing to obtain an obfuscation result; the obfuscation result, the reference vector and the target random vector are subjected to XOR processing, and the XOR processing result is then subjected to obfuscation processing to obtain an initial key.
[0150] As an example, the reference vector may be obtained by combining a preset vector and a current value of a counter.
[0151] Among them, for example, byte substitution (SubBytes), row shift (ShiftRows) and column confusion (MixColumns) are used to confuse the initial random vector to obtain a confusion result, which can be considered as a confusion vector; the confusion vector is further bitwise XORed with the reference vector and the target random vector to obtain an XOR processing result, and the XOR processing result is then sequentially subjected to byte substitution, row shift and column confusion processing to obtain the initial key.
[0152] The process of obtaining the obfuscated result by obfuscation processing includes, for example: sorting the initial random vector by bytes, splitting the initial random vector according to the preset byte values, and performing byte replacement, row shift and column obfuscation processing on the multiple byte sequences obtained after the splitting, respectively, to obtain the obfuscated encrypted byte sequence, and finally recombining the obfuscated byte sequence in order to obtain the above obfuscated result. The process of obtaining the initial key by obfuscation processing is the same as the process of obtaining the obfuscated result by obfuscation processing, and will not be repeated here.
[0153] In this embodiment, the initial key corresponding to the first key generation request can be directly used as the channel key corresponding to the first key generation request.
[0154] In the channel key generation method of the above embodiment, when the processor determines that the current key generation request is the first key generation request, the preset vector and the current value of the counter are first combined to obtain a reference vector, and then the initial random vector is obfuscated by byte replacement, row shift and column obfuscation to obtain an obfuscated result. Finally, the obfuscated result, the reference vector and the target random vector are bitwise XORed, and the XOR result is byte replaced, row shifted and column obfuscated in turn to obtain the initial key corresponding to the first key generation request.
[0155] In some embodiments, the steps of obtaining an initial key and generating a channel key according to the initial key and a target random vector include:
[0156] Determine a reference vector according to a preset vector and a current value of a counter;
[0157] The target random vector, the reference vector, and the initial key are subjected to XOR processing, and the result of the XOR processing is subjected to obfuscated encryption processing to obtain the channel key;
[0158] After the channel key corresponding to the key generation request is determined, the value of the counter is updated according to a preset step.
[0159] Specifically, updating the value of the counter according to the preset step length may be to increase or decrease the value successively, and during the process of changing the value of the counter, the length of the value remains unchanged.
[0160] As an example, the reference vector may be obtained by combining a preset vector and a current value of a counter.
[0161] Among them, the process of obfuscated encryption processing includes, for example: sorting the initial key by bytes, splitting the initial key according to preset byte values, and performing byte replacement, row shifting and column obfuscation processing on the multiple byte sequences obtained after the splitting to obtain the obfuscated encrypted byte sequence, and finally recombining the obfuscated byte sequence in order to obtain the channel key corresponding to the current key generation request.
[0162] In the above-mentioned channel key generation method, according to the key generation requests continuously received, the corresponding target random vector can be obtained according to the real-time channel state information of the communicating parties, which solves the communication security risk caused by the channel key remaining unchanged for a long time when the communicating parties maintain a quasi-static state of connection.
[0163] In the channel key generation method of the above embodiment, the processor first combines the preset vector and the current value of the counter to obtain a reference vector, then obtains the channel key generated when the key generation request corresponding to the current communicating parties was received last time, and uses the channel key as the initial key corresponding to the current key generation request, and finally performs bitwise XOR on the initial key, the reference vector, and the new target random vector, and encrypts the XOR processing result to obtain the channel key corresponding to the current non-first key generation request. It can be seen from the foregoing content that the key generation instruction can be a signal instruction that the processor automatically generates continuously at a preset generation frequency, that is, it can be understood that the channel key generation process is an automatically iterative generation process, and during the data transmission between the communicating parties, the processor continuously iterates to generate new channel keys.
[0164] like Figure 6 As shown, in this embodiment, the channel key generation method includes:
[0165] Step 602: determine whether the key generation request is the first key generation request;
[0166] Step 6041: If it is the first key generation request, an initial random vector and a target random vector are generated according to the channel state information obtained based on the channel detection of the communicating parties after the first key generation request, and the initial random vector corresponding to the current key generation request is subjected to obfuscation encryption processing to obtain an obfuscation vector; a reference vector is then determined according to a preset vector and the current value of the counter, and the obfuscation vector, the reference vector and the target random vector are subjected to XOR processing to obtain an XOR processing result; the XOR processing result is subjected to obfuscation encryption processing to obtain an initial key, and the count of the counter is updated according to a preset step, and new key generation requests are continuously detected;
[0167] Step 6042: If it is the second key generation request, obtain the channel key corresponding to the first key generation request and use it as the initial key corresponding to the second key generation request; if it is the third or subsequent key generation request, use the channel key corresponding to the previous key generation request as the initial key corresponding to the current key generation request;
[0168] Step 606: Determine a reference vector according to the preset vector and the current value of the counter;
[0169] Step 608, performing XOR processing on the initial key, the reference vector, and the target random vector to obtain an XOR processing result;
[0170] Step 610: Obfuscate and encrypt the XOR processing result to obtain the channel key corresponding to the current key generation request, and update the count of the counter according to the preset step to continuously detect new key generation requests.
[0171] In the above-mentioned channel key generation method, when the key generation request is the first key generation request, an initial random vector is generated according to the actual channel state information of the communicating parties, when the key generation request is the second key generation request, the channel key corresponding to the first key generation request is used as the initial key corresponding to the second key generation request, when the key generation request is the third key generation request or above, the channel key corresponding to the previous key generation request is used as the initial key corresponding to the current key generation request, then, a reference vector is determined according to the preset vector and the current value of the counter, and the initial key corresponding to the current key generation request is XORed with the reference vector and the target random vector, and the XOR result is subjected to obfuscated encryption to obtain the channel key corresponding to the current key generation request, and the channel key generation method in this embodiment will update the value of the counter according to the preset step after generating the channel key corresponding to each key generation request. The channel key generation method in this embodiment can continuously update the channel key in a quasi-static state in which the communicating parties remain connected, greatly reducing the probability of security issues such as eavesdropping attacks, and adopts obfuscated encryption and bitwise XOR processing to provide a guarantee for the security of the channel key finally generated.
[0172] like Figure 7 As shown, in a possible implementation, the channel key generation method includes:
[0173] Step 702: Control the transmitting end to send a pilot signal to the receiving end, and the receiving end performs channel detection according to the pilot signal to obtain corresponding channel state information;
[0174] Step 704: quantize the channel state information acquired by the receiving end to generate a first detection vector;
[0175] Step 706: Control the receiving end to send a pilot signal to the transmitting end, and the transmitting end performs channel detection according to the pilot signal to obtain channel state information;
[0176] Step 708: quantize the channel state information acquired by the transmitting end to generate a second detection vector;
[0177] Step 710: Receive the reconciliation error correction information and the integrity check code of the second detection vector sent by the transmitting end;
[0178] Step 712: perform reconciliation and error correction on the first detection vector according to the reconciliation and error correction information, and calculate an integrity check code for the error-corrected result;
[0179] Step 714: compare the integrity check code of the first detection vector with the integrity check code of the second detection vector to obtain a comparison result;
[0180] Step 716: When the comparison result indicates that the integrity check code of the first detection vector is consistent with the integrity check code of the second detection vector, in response to the first key generation request, the channel state information of the communication channels of both parties is detected twice to generate a target random vector and an initial random vector;
[0181] Step 718: Combine the preset vector and the current value of the counter to obtain a reference vector, and perform obfuscation encryption processing on the initial random vector to obtain an obfuscated vector; perform XOR processing on the obfuscated vector, the target random vector, and the reference vector to obtain an XOR processing result, and then perform obfuscation encryption processing on the XOR processing result to obtain an initial key, that is, a channel key corresponding to the first key generation request; and update the value of the counter according to the preset step;
[0182] Step 720: In response to the second key generation request, the channel state information obtained by channel detection between the communicating parties is again acquired, and a target random vector corresponding to the second key generation request is generated according to the channel state information;
[0183] Step 722: The preset vector and the updated value of the counter are combined to obtain a reference vector corresponding to the second key generation request, the channel key generated by the first key generation request is used as the initial key corresponding to the second key generation request, the reference vector, the initial key and the target random vector corresponding to the second key generation request are XORed to obtain an XOR result, and the XOR result is then obfuscated and encrypted to obtain the channel key corresponding to the second key generation request; at the same time, the value of the counter is updated again according to the preset step;
[0184] Step 724: In response to the third and subsequent key generation requests, obtain channel state information obtained by channel detection between the communicating parties, and generate a target random vector corresponding to the current key generation request according to the channel state information;
[0185] Step 726: Combine the preset vector and the latest value of the counter to obtain a reference vector corresponding to the current key generation request, use the channel key corresponding to the previous key generation request as the initial key corresponding to the current key generation request, perform XOR processing on the reference vector, the initial key and the target random vector corresponding to the current key generation request to obtain an XOR processing result, and then perform obfuscation encryption processing on the XOR processing result to obtain the channel key corresponding to the current key generation request; at the same time, update the value of the counter according to the preset step.
[0186] In the above-mentioned channel key generation method, after the communicating parties establish a communication connection, the processor first verifies the integrity of the channel between the sender and the receiver. When the verification result is that the integrity check code of the first detection vector is consistent with the integrity check code of the second detection vector, it is considered that the channel between the communicating parties meets the communication requirements. At this time, in response to the first key generation request, an initial random vector and a target random vector are generated based on the channel state information obtained based on the channel detection of the communicating parties, and the initial key is determined according to the initial random vector, the target random vector, the preset vector and the current value of the counter, that is, the channel key corresponding to the first key generation request, and the value of the counter is updated according to the preset step; further, in response to the first key generation request, The secondary key generation request obtains the channel state information obtained by the channel detection of the two communicating parties again, generates the target random vector according to the channel state information, and determines the channel key corresponding to the second key generation request according to the target random vector, the channel key corresponding to the first key generation request, the preset vector and the updated value of the counter, and when responding to the subsequent key generation request, re-obtains the channel state information obtained by the channel detection of the two communicating parties, generates the target random vector corresponding to the current key generation request according to the channel state information, and further determines the channel key corresponding to the current key generation request according to the target random vector, the channel key corresponding to the previous key generation request, the preset vector and the latest value of the counter. Through this setting, the continuous update of the channel keys of the two communicating parties is realized, ensuring the security of data transmission.
[0187] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0188] Based on the same inventive concept, the embodiment of the present application also provides a data transmission method for implementing the channel key generation method involved above. The implementation solution provided by the data transmission method for solving the problem is based on the implementation solution recorded in the above method, so the specific limitations in one or more data transmission method embodiments provided below can refer to the limitations on the channel key generation method above, and will not be repeated here.
[0189] In one embodiment, Figure 8 As shown, a data transmission method is provided, which is applied to a sending end and includes:
[0190] Step 802: receiving a data transmission instruction;
[0191] Step 804: Encrypt the data to be transmitted using the channel key generated by the channel key generation method in any of the above embodiments to obtain encrypted data;
[0192] Step 806: Transmit the encrypted data to the receiving end.
[0193] When the sender transmits data to the receiver, it will divide the data to be transmitted and transmit it in batches according to the size of the data packet that can be transmitted at one time. Before each data transmission, if a new channel key is detected, the sender will use the new channel key to encrypt the data to be transmitted and transmit the encrypted data to the receiver.
[0194] In the above data transmission method, according to the continuously updated channel key, the sender calls the latest channel key to encrypt the data each time it transmits data during the data transmission process, so that the channel key used during the transmission of the data to be transmitted can change in real time, which greatly improves the security of data transmission.
[0195] Based on the same inventive concept, the embodiment of the present application also provides a channel key generation device for implementing the channel key generation method involved above. The implementation solution provided by the channel key generation device is based on the implementation solution recorded in the above method, so the specific limitations in one or more channel key generation device embodiments provided below can refer to the limitations on the channel key generation method above, and will not be repeated here.
[0196] In one embodiment, Fig. 9 As shown, a channel key generation device 900 is provided, comprising:
[0197] An acquisition module 910 is used to respond to a key generation request and acquire a target random vector, wherein the target random vector is generated according to channel state information obtained by channel detection between two communicating parties;
[0198] The generating module 920 is configured to obtain an initial key, and generate a channel key according to the initial key and a target random vector, wherein after generating the channel key corresponding to the current key generation request, in response to a new key generation request, a new target random vector is obtained, and a channel key corresponding to a new key generation request is generated according to the new target random vector and the channel key corresponding to the current key generation request.
[0199] In some embodiments, the generating module 920 is further configured to:
[0200] When the key generation request is the first key generation request, the initial key is determined according to the initial random vector; the initial random vector is generated based on the channel state information obtained by channel detection between the communicating parties after the first key generation request;
[0201] When the key generation request is not the first key generation request, the channel key generated in the last key generation request of the non-first key generation request is used as the initial key.
[0202] In some embodiments, the initial random vector includes a first initial random vector and a second initial random vector; the generating module 920 is further used to:
[0203] An initial key is determined according to the first initial random vector and the second initial random vector.
[0204] In some embodiments, the generating module 920 is further configured to:
[0205] Performing obfuscation encryption processing on the first initial random vector to obtain an obfuscation result; performing XOR processing on the obfuscation result and the second initial random vector to obtain an XOR processing result; performing obfuscation encryption processing on the XOR processing result to obtain an initial key;
[0206] Alternatively, the first initial random vector and the second initial random vector are subjected to an XOR process to obtain an initial key;
[0207] Alternatively, the first initial random vector and the second initial random vector are subjected to an XOR process, and then an obfuscated encryption process is performed on the XOR process result to obtain the initial key.
[0208] In some embodiments, the generating module 920 is further configured to:
[0209] The initial random vector generated by a channel detection between the two communicating parties is used as the initial key;
[0210] Alternatively, an initial random vector generated by a channel detection between the two communicating parties is subjected to obfuscation encryption processing to obtain an initial key.
[0211] In some embodiments, the generating module 920 is further configured to:
[0212] Performing an XOR process on the initial key and the target random vector to obtain an XOR process result;
[0213] The XOR processing result is obfuscated and encrypted to obtain the channel key.
[0214] In some embodiments, the generating module 920 is further configured to:
[0215] When the key generation request is the first key generation request, the initial key is determined according to the initial random vector, the preset vector, the current value of the counter and the target random vector; the initial random vector is generated based on the channel state information obtained by channel detection between the communicating parties after the first key generation request;
[0216] When the key generation request is not the first key generation request, the channel key generated in the last key generation request of the non-first key generation request is used as the initial key.
[0217] In some embodiments, the generating module 920 is further configured to:
[0218] Determine a reference vector according to a preset vector and a current value of a counter;
[0219] Performing obfuscation encryption processing on the initial random vector to obtain an obfuscated result;
[0220] The obfuscation result, the reference vector and the target random vector are subjected to XOR processing, and the result of the XOR processing is then subjected to obfuscation encryption processing to obtain the initial key.
[0221] In some embodiments, the generating module 920 is further configured to:
[0222] Determine a reference vector according to a preset vector and a current value of a counter;
[0223] The target random vector, the reference vector, and the initial key are subjected to XOR processing, and the result of the XOR processing is subjected to obfuscated encryption processing to obtain the channel key;
[0224] After the channel key corresponding to the key generation request is determined, the value of the counter is updated according to a preset step.
[0225] In some embodiments, the generating module 920 is further configured to:
[0226] The preset vector and the current value of the counter are combined to obtain a reference vector.
[0227] In one embodiment, Fig.10 As shown, a data transmission device 1000 is provided, comprising:
[0228] Receiving module 1010, used for receiving data transmission instructions;
[0229] An encryption module 1020, configured to encrypt the data to be transmitted using the channel key generated by the channel key generation method in any of the above embodiments to obtain encrypted data;
[0230] The transmission module 1030 is used to transmit the encrypted data to the receiving end.
[0231] Each module in the above-mentioned channel key generation device 900 or data transmission device 1000 can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0232] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements each step of the above-mentioned channel key generation method when executing the computer program.
[0233] The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a memory data access method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0234] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0235] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, each step of the above-mentioned channel key generation method is implemented.
[0236] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0237] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A channel key generation method, characterized in that: include: In response to a key generation request, control the communicating parties to send pilot signals to each other to perform channel detection according to the key generation request, obtain channel state information of the communicating parties, quantify the channel states of the communicating parties respectively, and generate a first detection vector and a second detection vector; if the integrity check code of the first detection vector is consistent with the integrity check code of the second detection vector, perform privacy amplification processing on the first detection vector or the second detection vector to generate a target random vector; An initial key is obtained, and a channel key is generated according to the initial key and the target random vector, wherein after the channel key corresponding to the current key generation request is generated, a new target random vector is obtained in response to a new key generation request, and a channel key corresponding to a new key generation request is generated according to the new target random vector and the channel key corresponding to the current key generation request.
2. The method according to claim 1, characterized in that The step of generating the target random vector comprises: According to the preset generation frequency, the target random vector is obtained by processing the channel state information obtained by channel detection of the communicating parties, or In response to the key generation request, the target random vector is obtained by processing according to channel state information obtained by channel detection of both communicating parties.
3. The method according to claim 1, characterized in that The method further comprises: When the key generation request is a first key generation request, determining the initial key according to an initial random vector; the initial random vector is generated based on channel state information obtained by channel detection between the communicating parties after the first key generation request; When the key generation request is not the first key generation request, the channel key generated in the last key generation request before the non-first key generation request is used as the initial key.
4. The method according to claim 3, characterized in that The initial random vector includes a first initial random vector and a second initial random vector; and the step of determining the initial key according to the initial random vector includes: The initial key is determined according to the first initial random vector and the second initial random vector.
5. The method according to claim 4, characterized in that The determining the initial key according to the first initial random vector and the second initial random vector comprises: Performing obfuscation encryption processing on the first initial random vector to obtain an obfuscation result; performing XOR processing on the obfuscation result and the second initial random vector to obtain an XOR processing result; performing obfuscation encryption processing on the XOR processing result to obtain an initial key; Alternatively, performing an XOR process on the first initial random vector and the second initial random vector to obtain an initial key; Alternatively, the first initial random vector and the second initial random vector are subjected to an XOR process, and then an obfuscated encryption process is performed on the XOR process result to obtain the initial key.
6. The method according to claim 3, characterized in that The step of determining the initial key according to the initial random vector comprises: Using an initial random vector generated by a channel detection between the two communicating parties as the initial key; Alternatively, the initial random vector generated by a channel detection between the two communicating parties is subjected to obfuscation encryption processing to obtain the initial key.
7. The method according to claim 3, characterized in that The step of obtaining an initial key and generating a channel key according to the initial key and the target random vector comprises: Performing an XOR process on the initial key and the target random vector to obtain an XOR process result; The XOR processing result is subjected to obfuscation encryption processing to obtain the channel key.
8. The method according to claim 1, characterized in that The method further comprises: When the key generation request is a first key generation request, determining the initial key according to an initial random vector, a preset vector, a current value of a counter and the target random vector; the initial random vector is generated based on channel state information obtained by channel detection between the communicating parties after the first key generation request; When the key generation request is not the first key generation request, the channel key generated in the last key generation request before the non-first key generation request is used as the initial key.
9. The method according to claim 8, characterized in that The step of determining the initial key according to the initial random vector, the preset vector, the current value of the counter and the target random vector comprises: Determine a reference vector according to the preset vector and a current value of the counter; Performing obfuscation encryption processing on the initial random vector to obtain an obfuscation result; The obfuscation result, the reference vector and the target random vector are subjected to XOR processing, and the result of the XOR processing is subjected to obfuscation encryption processing to obtain the initial key.
10. The method according to claim 9, characterized in that The step of obtaining an initial key and generating a channel key according to the initial key and the target random vector comprises: Determine a reference vector according to the preset vector and a current value of the counter; Performing XOR processing on the target random vector, the reference vector, and the initial key, and then performing obfuscation encryption processing on the result of the XOR processing to obtain the channel key; After the channel key corresponding to the key generation request is determined, the value of the counter is updated according to a preset step.
11. The method according to claim 10, characterized in that The step of determining the reference vector according to the preset vector and the current value of the counter comprises: The preset vector and the current value of the counter are combined to obtain the reference vector.
12. A data transmission method, characterized in that: Applied to the sending end, including: receiving data transmission instructions; Encrypting the data to be transmitted according to the channel key generated according to any one of claims 1 to 11 to obtain encrypted data; Transmit the encrypted data to a receiving end.
13. A channel key generation device, characterized in that: include: an acquisition module, configured to respond to a key generation request, control the communicating parties to send pilot signals to each other to perform channel detection according to the key generation request, obtain channel state information of the communicating parties, quantify the channel states of the communicating parties respectively, and generate a first detection vector and a second detection vector; if the integrity check code of the first detection vector is consistent with the integrity check code of the second detection vector, perform privacy amplification processing on the first detection vector or the second detection vector to generate a target random vector; a generating module, configured to obtain an initial key, and generate a channel key according to the initial key and the target random vector, wherein after generating the channel key corresponding to the current key generation request, in response to a new key generation request, a new target random vector is obtained, and according to the new target random vector and the channel key corresponding to the current key generation request, a channel key corresponding to the new key generation request is generated.
14. A data transmission device, characterized in that: The data transmission device is arranged at the sending end and includes: A receiving module, used for receiving a data transmission instruction; An encryption module, used for encrypting data to be transmitted according to a channel key generated according to any one of claims 1 to 11 to obtain encrypted data; The transmission module is used to transmit the encrypted data to a receiving end.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the channel key generation method according to any one of claims 1 to 11 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the channel key generation method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Internet of Things communication protocol encryption method and device, and storage medium
CN112333699A
Channel key consistency negotiation method and device, electronic equipment and storage medium
CN112968771A