Data security transmission method and system based on quantum communication
By using FP tree and hash analysis technology in quantum key allocation, the key length is extended, the problem of too short key length is solved, and the security of quantum communication is improved.
Patent Information
- Application Number
- CN202410669439.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-05-28
AI Technical Summary
The existing iteration of quantum keys through hash functions leads to the problem of being too short for the key length, affecting security.
By building an FP tree, quantifying the node initial value, and performing key segment verification based on character security, obtaining the cutoff key, and analyzing the hash value changes to obtain the added characters to extend the key length.
Improve the security of keys, avoid the problem of too short key length, increase the complexity of keys, and reduce the risk of eavesdropping.
Smart Images

Figure CN118555060B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum key distribution, and in particular to a method and system for secure data transmission based on quantum communication. Background Art
[0002] In the process of judging whether the quantum key has been stolen, a part of the shared key is randomly selected and made public, and then the measurement results of the public quantum bits are compared. If they are consistent, it is considered that these bits are transmitted correctly. If they are inconsistent, it is judged that someone is trying to eavesdrop on the key based on the disturbance of the quantum bits when they are observed, and then the final key is generated through continuous random sampling until the error rate is within the allowable range. If the error rate is always large, a secure key is generated through privacy amplification technology, that is, through the iterative application of hash functions, the key length is gradually shortened. Due to the irreversibility of hash functions, even if the eavesdropper knows part of the original key, he cannot infer the shortened key, thereby achieving the purpose of security. However, in this process, if the final key length is too short, the security of the quantum key will be insufficient, which will affect the confidentiality of the quantum communication process. Summary of the invention
[0003] The present invention provides a data security transmission method and system based on quantum communication to solve the problem that the existing quantum key iteration through hash function causes the key length to be too short and affects the security. The technical solution adopted is as follows:
[0004] The present invention proposes a data security transmission method based on quantum communication, which comprises the following steps:
[0005] Obtain the original keys of both parties in quantum communication;
[0006] Each verification of the original key is regarded as an event, and an FP tree is constructed to obtain several nodes; the node initial value of each node is obtained according to the length of the random key segment corresponding to each event and the verification process of the hash value; the character security of each unverified position in the original key is obtained according to the distribution of characters in the original key, combined with the verification results and distribution of the random key segment, and the node initial value of the node corresponding to the character at each verified position;
[0007] Based on the character security of each position in the original key and the random key segment, several key segments to be verified and their comprehensive security are obtained; based on the comprehensive security, the key segments to be verified are verified to obtain a cutoff key; by replacing the characters in the cutoff key and obtaining the hash value, a replacement hash value group for each position in the cutoff key is obtained; based on the difference between the replacement hash values in the same replacement hash value group, several added characters are obtained, and the final key is obtained by combining with the cutoff key;
[0008] Data transmission is based on the final key.
[0009] Optionally, the constructing of the FP tree and obtaining a plurality of nodes includes the following specific methods:
[0010] The several completed verifications are respectively taken as an item in the FP tree construction, and the characters in different positions that have been verified in the original key are respectively taken as a node in the FP tree to construct the FP tree.
[0011] Optionally, the obtaining of the node initial value of each node includes the following specific methods:
[0012] For any item corresponding to any node, the ratio of the length of the random key segment corresponding to the item to the total length of the original key is recorded as the length factor of the random key segment corresponding to the item; in the verification process corresponding to the item, for the hash value obtained by the random key segments of each of the communicating parties, the ratio of the number of elements involved in the comparison in the hash value to the number of all elements in the hash value is calculated, and recorded as the hash comparison factor of the item;
[0013] According to the length factors and hash comparison factors of all items corresponding to the node, the node initial value of the node is obtained; the node initial value is negatively correlated with the length factor, and the node initial value is positively correlated with all length factors.
[0014] Optionally, the obtaining of the character security of each unverified position in the original key includes the following specific methods:
[0015] Record the characters at the verified positions as the characters at the verified positions, and for any character at the verified positions, take the verification result of the most recent event corresponding to the character at the verified position as the verification result of the character at the verified position;
[0016] For any character at an unverified position, the character at a verified position that is closest to the character at the unverified position and that has been successfully verified is recorded as the reference character of the character at the unverified position; the two characters at verified positions that are closest to the character at the unverified position and that have failed verification are recorded as the first comparison character and the second comparison character of the character at the unverified position, respectively.
[0017] The character security of the unverified position is obtained according to the distance between the character at the unverified position and the reference character, the node initial value of the node corresponding to the reference character, and the distance between the character at the unverified position and the first comparison character and the second comparison character.
[0018] Optionally, the obtaining of the character security of the unverified position includes a specific method as follows:
[0019]
[0020] Among them, s0 represents the node initial value of the node corresponding to the reference character of the character at the unverified position, d0 represents the distance between the character at the unverified position and the reference character, d1 represents the distance between the character at the unverified position and the first comparison character, and d2 represents the distance between the character at the unverified position and the second comparison character.
[0021] Optionally, the obtaining of the plurality of key segments to be verified and their comprehensive security comprises the following specific methods:
[0022] The characters in all verified positions in the original key are removed to obtain a number of key parts in the original key after the removal, and each key part is used as a key segment to be verified to obtain a number of key segments to be verified;
[0023] For any key segment to be verified, the average security value of the characters in all unverified positions in the key segment to be verified is used as the comprehensive security of the key segment to be verified.
[0024] Optionally, the verifying the key segment to be verified based on comprehensive security to obtain the cutoff key includes the following specific methods:
[0025] The comprehensive security of all key segments to be verified is sorted from large to small as the verification order of all key segments to be verified; the key segments to be verified are verified step by step according to the verification order, and after each verification, the ratio of the sum of the lengths of all unverified key segments to be verified to the total length of the original key is recorded as the unverified factor;
[0026] When the unverified factor is less than the cutoff threshold for the first time, the verification process is stopped, and all the unverified key segments to be verified at this time are used as the cutoff key.
[0027] Optionally, the method of obtaining the replacement hash value group for each position in the cutoff key includes:
[0028] Different types of characters in the cutoff key are recorded as several replacement characters. For a character at any position in the cutoff key, the character at the position is replaced with any other different replacement character, and combined with characters at other positions that have not been replaced, a replacement key for the position under the replacement character is obtained, and a hash value is obtained for the replacement key, which is recorded as a replacement hash value for the position under the replacement character;
[0029] The character at the position is replaced with each different replacement character, and a replacement hash value of the position under each replacement character is obtained, and all the replacement hash values constitute a replacement hash value group of the position.
[0030] Optionally, the method of obtaining a plurality of added characters based on the difference between the replacement hash values in the same replacement hash value group includes the following specific methods:
[0031] For any two replacement hash values in any replacement hash value group, based on the total number of elements in the replacement hash value and the number of elements with the same position and the same element value in the two replacement hash values, a hash value change rate of the two replacement hash values is obtained; the hash value change rate is positively correlated with the total number of elements, and the hash value change rate is negatively correlated with the number of elements with the same position and the same element value;
[0032] Taking the average of the hash value change rates of all any two replacement hash values in the replacement hash value group as the replacement change rate of the replacement hash value group;
[0033] The product of the total length of the original key and the cutoff threshold and rounding up is taken as the final key length, and the difference between the final key length and the cutoff key length is taken as the number of added characters; the positions corresponding to each replacement hash value group are sorted from small to large according to the replacement change rate to obtain a position change sequence; the position with the number of characters added before is selected in the position change sequence and recorded as the addition position; for any addition position, the element corresponding to the character of the addition position in the hash value of the cutoff key is taken as the addition character of the addition position.
[0034] The present invention also proposes a data security transmission system based on quantum communication, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the above method when executing the computer program.
[0035] The beneficial effects of the present invention are as follows: the present invention distributes quantum keys to both communicating parties through a quantum channel to obtain an original key; in a random public verification process of the original key, based on the verification result and in combination with the fact that the characters heard by eavesdropping are usually continuous, the character security of each position is quantified, thereby obtaining the comprehensive security of the key segment to be verified; the verification is continued until a cutoff key is obtained, the cutoff key is difficult to be guessed by an eavesdropper; by analyzing the change of the hash value of the cutoff key, the added characters are obtained and the final key is obtained, the key length is increased, and thus the key security is improved; wherein an FP tree is constructed for the verification process, and the characters at the verified positions are used as nodes in the FP tree; the node initial values of the nodes are quantified according to the verification results of each time and the length of the corresponding random key segment, thereby the node initial values of the unverified positions are quantified, thereby The character security is quantified to record the hash iterations during the verification process, and quickly locate the position with greater character security, so as to quickly perform subsequent verification, thereby reducing the communication time and further improving the security of the key; the key segment to be verified and its comprehensive security are obtained based on the character security of the unverified position, and the verification is continued from large to small based on the comprehensive security of the key segment to be verified, so as to quickly obtain a cutoff key that has passed the verification and is sufficiently secure, and the replacement hash value group is obtained by replacing the characters in the cutoff key, and then the added characters are obtained. The character change at the corresponding position of the added character has little effect on the hash value change, and its position is more stable. After the element of the corresponding hash value is used as the added character, it is guaranteed that the final key length will not be too short, while increasing the key complexity and reducing the risk of eavesdropping. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 A schematic flow chart of a method for secure data transmission based on quantum communication provided in accordance with an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] See also Figure 1, which shows a flow chart of a data security transmission method based on quantum communication provided by an embodiment of the present invention, the method comprising the following steps:
[0040] Step S001, obtain the original keys of both parties in quantum communication.
[0041] The purpose of this embodiment is to distribute quantum keys based on quantum channels. The communicating parties obtain the final key by verifying the quantum key, and then realize data security transmission based on the final key. Therefore, it is necessary to obtain the distributed quantum key first.
[0042] Specifically, in this embodiment, the communicating parties are Alice and Bob, where Alice is the transmitter and Bob is the receiver; Alice randomly generates a key, uses the key as the original key, and transmits the original key to Bob through the quantum channel, thereby obtaining the original keys of the communicating parties; quantum channel transmission is a well-known technology and will not be described in detail in this embodiment.
[0043] It should be noted that during the quantum key distribution process, several key segments will be gradually and randomly disclosed. By verifying the disclosed random key segments, if the verification is correct, the corresponding random key segments are secure, and if the verification is wrong, the corresponding random key segments are eavesdropped. If the error rate is always large during the iterative verification process, the final key obtained (the security of the final key is high enough, and the eavesdropper Eve can hardly predict it) will be too short, which will affect the security of data transmission due to the short key length. Therefore, it is necessary to record the hash iteration process through the FP tree structure, and then obtain the added characters by analyzing the changes in the hash value of the cutoff key, so as to avoid the problem of the final key length being too short and affecting security.
[0044] Step S002, taking each verification of the original key as an event, constructing an FP tree and obtaining a number of nodes; obtaining the node initial value of each node according to the length of the random key segment corresponding to each event and the verification process of the hash value; obtaining the character security of each unverified position in the original key according to the distribution of the characters in the original key, combined with the verification results and distribution of the random key segments, and the node initial values of the nodes corresponding to the characters at each verified position.
[0045] Preferably, in one embodiment of the present invention, each verification of the original key is regarded as a matter, an FP tree is constructed and several nodes are obtained, and the specific method includes:
[0046] This embodiment adopts the QKD protocol (quantum key distribution) to verify the original key. The verification process is to randomly select a small part from the original key each time to be made public and verified, and use the randomly selected small part of the original key as a random key segment. After each verification, the successfully verified random key segment is truncated. If the verification result is failure, the corresponding random key segment is not truncated. Therefore, characters in the same position appear in random key segments verified at different times. The random selection of a part for verification and the verification process in the QKD protocol are well-known technologies and will not be repeated in this embodiment. Several verifications and random key segments for each verification are obtained.
[0047] Furthermore, the several completed verifications are respectively taken as an item in the FP tree construction, and the characters at each position in all items are respectively taken as a node, that is, the characters at different positions in the original key that have been verified are respectively taken as a node in the FP tree to construct the FP tree.
[0048] It should be noted that by constructing an FP tree, based on the nodes in the FP tree, the verification results of each verification can be recorded, and the hash iteration process can be recorded; and by analyzing the confidence of the random key segment in the verification process under each item, the node initial value is quantified, providing a basis for obtaining the security of the characters at each position in the subsequent original key; although the hash value will be greatly different with a slight change in the input, since only some bits of the hash value are compared during the subsequent comparison, there is a probability that the hash values at the same position of two different key segments have the same number of bits, the longer the random key segment, the lower the credibility of the hash value verification; at the same time, in the hash value comparison process, the larger the proportion of elements involved in the comparison, the greater the probability that the two hash values are exactly the same, and the greater the possibility that the corresponding random key segments are exactly the same.
[0049] Preferably, in one embodiment of the present invention, the node initial value of each node is obtained according to the length of the random key segment corresponding to each event and the verification process of the hash value, including the specific method of:
[0050] Each node corresponds to several items. For any item corresponding to any node, the ratio of the length of the random key segment corresponding to the item (the number of characters in the random key segment) to the total length of the original key is recorded as the length factor of the random key segment corresponding to the item. In the verification process corresponding to the item, for the hash values obtained by Alice and Bob's respective random key segments, the ratio of the number of elements involved in the comparison in the hash value to the number of all elements in the hash value is calculated, which is recorded as the hash comparison factor of the item. Then the calculation method of the node initial value s of the node is:
[0051]
[0052] Among them, n represents the number of items corresponding to the node, a i Indicates the hash comparison factor of the i-th item corresponding to the node, b i It represents the length factor of the random key segment corresponding to the ith item corresponding to the node. exp( ) represents an exponential function with a natural constant as the base. This embodiment adopts the exp(-x) model to present the inverse proportional relationship. x is the input of the model. The implementer can set the inverse proportional function and the normalization function according to the actual situation.
[0053] It should be noted that the larger the length factor of the random key segment corresponding to the node corresponding to the matter, the longer the length of the random key segment, the smaller the possibility that the communicating parties verify that the random key segment is the same, and the smaller the confidence of the matter; the larger the hash comparison factor of the matter, the greater the probability that the two hash values are exactly the same, the greater the confidence of the matter, and the larger the corresponding node initial value.
[0054] Preferably, in one embodiment of the present invention, the character security of each unverified position in the original key is obtained according to the distribution of the characters in the original key, combined with the verification results and distribution of the random key segments, and the node initial values of the nodes corresponding to the characters at each verified position, and the specific method includes:
[0055] It should be noted that each node represents a character at a position in the original key. Considering that the characters eavesdropped by the attacker are often continuous, the security of the characters at different positions in the remaining key that has not been verified is obtained through the distribution of the node initial values of the continuous characters in the original key, and then the characters at sufficiently secure positions are quickly located and verified, thereby avoiding the exposure of more information due to longer communication time.
[0056] Since each node in the FP tree is a character at a verified position in the original key, the character at the verified position is recorded as the character at the verified position. Then, each character at the verified position corresponds to a node and its node initial value. At the same time, each character at the verified position corresponds to several items. For any character at a verified position, the verification result of the most recent item corresponding to the character at the verified position, that is, verification success or failure, is used as the verification result of the character at the verified position; then, for any character at an unverified position, the character at the verified position that is closest to the character at the unverified position and that has been successfully verified is recorded as the reference character of the character at the unverified position; the two characters at the verified positions that have failed to be verified and that are closest to the character at the unverified position are recorded as the first comparison character and the second comparison character of the character at the unverified position, respectively. The above distance is the distance between the positions where the characters are distributed in the original key; then the calculation method for the security p of the character at the unverified position is:
[0057]
[0058] Among them, s0 represents the node initial value of the node corresponding to the reference character of the character at the unverified position, d0 represents the distance between the character at the unverified position and the reference character, d1 represents the distance between the character at the unverified position and the first comparison character, and d2 represents the distance between the character at the unverified position and the second comparison character.
[0059] It should be noted that the smaller the distance between the character at the unverified position and the reference character, and the larger the node initial value of the reference character, since the reference character is a successfully verified character, the less likely the character at the unverified position is to be eavesdropped, and the greater the security of the character at the unverified position; the larger the distance from the comparison character, i.e. the character that failed verification, this embodiment takes into account the situation that the eavesdropper usually eavesdrops continuously, and therefore quantifies the security of the character at the unverified position by obtaining the distances corresponding to the characters that failed verification at the closest distance and the second closest distance, and the smaller the mean of the two distances, the less likely the character at the unverified position is to exist in the part that the eavesdropper continuously eavesdrops, and the corresponding character at the unverified position is more secure.
[0060] At this point, an FP tree is constructed for the verification process, and the characters at the verified positions are used as nodes in the FP tree. The node initial values of the nodes are quantified through the results of each verification and the length of the corresponding random key segment, and then the security of the characters at the unverified positions is quantified, thereby realizing the record of hash iterations during the verification process, and quickly locating the positions with greater character security, and then quickly performing subsequent verifications, thereby reducing communication time and further improving the security of the key.
[0061] Step S003: Based on the character security of each position in the original key and the random key segment, several key segments to be verified and their comprehensive security are obtained; based on the comprehensive security, the key segments to be verified are verified to obtain a cutoff key; by replacing the characters in the cutoff key and obtaining the hash value, a replacement hash value group for each position in the cutoff key is obtained; based on the difference between the replacement hash values in the same replacement hash value group, several added characters are obtained, and the final key is obtained in combination with the cutoff key.
[0062] Preferably, in one embodiment of the present invention, based on the character security of each position in the original key and the random key segment, a number of key segments to be verified and their comprehensive security are obtained, including the specific method of:
[0063] All characters in the verified positions of the original key are removed to obtain several key parts in the original key after removal, that is, by removing the characters in the verified positions, the characters in the continuous unverified positions are combined into multiple key parts, and each key part is used as a key segment to be verified, then several key segments to be verified are obtained; for any key segment to be verified, the average security value of the characters in all unverified positions in the key segment to be verified is used as the comprehensive security of the key segment to be verified.
[0064] Preferably, in one embodiment of the present invention, the key segment to be verified is verified based on comprehensive security to obtain the cutoff key, including the specific method of:
[0065] The comprehensive security of all key segments to be verified is sorted from large to small as the verification order of all key segments to be verified; the key segments to be verified are verified step by step according to the verification order, and after each verification, the ratio of the sum of the lengths of all unverified key segments to be verified to the total length of the original key is recorded as the unverified factor; a cutoff threshold is preset, and the cutoff threshold in this embodiment is described as 0.3. When the unverified factor is less than the cutoff threshold for the first time, the verification process is stopped, and all the unverified key segments to be verified at this time are collectively used as the cutoff key.
[0066] What needs to be explained is that, by constructing the key segment to be verified by the characters in the continuous unverified positions, and obtaining the comprehensive security, the key segment to be verified is verified from large to small based on the comprehensive security. Since the greater the comprehensive security, the greater the possibility of successful verification of the key segment to be verified, the verification process of the original key is accelerated. At the same time, a cutoff threshold is set to obtain a cutoff key. The length of the cutoff key is small and secure enough to be difficult to be guessed by an eavesdropper. At the same time, the cutoff key length is avoided to be too small to affect the security of the key.
[0067] Preferably, in one embodiment of the present invention, by replacing characters in the cutoff key and obtaining a hash value, a replacement hash value group for each position in the cutoff key is obtained, and the specific method includes:
[0068] Different types of characters in the cutoff key are recorded as several replacement characters. For a character at any position in the cutoff key, the character at the position is replaced with any other different replacement character, that is, a replacement character of a different type from the character at the position, and combined with characters that are not replaced at other positions, a replacement key for the position under the replacement character is obtained, and a hash value is obtained for the replacement key, which is recorded as the replacement hash value of the position under the replacement character; according to the above method, the character at the position is replaced with each different replacement character to obtain a replacement hash value of the position under each replacement character (excluding the hash value when the character at the position is not replaced), and all the replacement hash values constitute a replacement hash value group for the position; according to the above method, a replacement hash value group for each position in the cutoff key is obtained.
[0069] Preferably, in one embodiment of the present invention, based on the difference between the replacement hash values in the same replacement hash value group, a number of added characters are obtained, and the final key is obtained in combination with the cutoff key, including the specific method of:
[0070] For any replacement hash value group, taking replacement hash value A and replacement hash value B as examples, the total number of elements in the replacement hash values are equal, calculate the ratio of the number of elements in all positions and values in replacement hash value A and replacement hash value B to the total number of elements in the replacement hash value, and subtract the difference obtained by subtracting the ratio from 1 as the hash value change rate of replacement hash value A and replacement hash value B; obtain the hash value change rate for any two replacement hash values in the replacement hash value group, and take the average of all hash value change rates as the replacement change rate of the replacement hash value group; obtain the replacement change rate of the replacement hash value group at each position according to the above method.
[0071] Furthermore, the product of the total length of the original key and the cutoff threshold and rounding up is taken as the final key length, and the difference between the final key length and the cutoff key length is taken as the number of added characters; the positions corresponding to the replacement hash value groups are sorted from small to large according to the replacement change rate to obtain a position change sequence; the positions with the number of characters added before are selected in the position change sequence and recorded as the addition positions; for any addition position, the element corresponding to the character of the addition position in the hash value of the cutoff key is taken as the addition character of the addition position, and the addition character of each addition position is obtained according to the above method, so as to obtain a number of addition characters.
[0072] Furthermore, after adding the added characters to the cutoff key one by one in the order of the added positions in the position change sequence, the added cutoff key is connected into a key segment. That is, since the cutoff key contains several key segments to be verified, they need to be connected, and the connected key segment is recorded as the final key.
[0073] At this point, the key segment to be verified and its comprehensive security are obtained based on the character security of the unverified position, and verification is continued from large to small based on the comprehensive security of the key segment to be verified, so as to quickly obtain a cutoff key of sufficient length and sufficient security, and obtain a replacement hash value group by replacing characters in the cutoff key, and then obtain the added character. The change of the character at the corresponding position of the added character has little effect on the change of the hash value, and its position is more stable. After the element of the corresponding hash value is used as the added character, it is guaranteed that the final key length will not be too short, while increasing the key complexity and reducing the risk of eavesdropping.
[0074] Step S004: Transmit data based on the final key.
[0075] Preferably, in one embodiment of the present invention, data transmission is performed based on the final key, and the specific method includes:
[0076] After obtaining the final key, the final key is verified to be secure enough and is updated by adding characters, so Eve (the eavesdropper) cannot infer the final key; when Alice transmits data to Bob, she encrypts the data with the final key to obtain ciphertext data, and transmits the ciphertext data through the traditional channel. After Bob receives the ciphertext data, he decodes it with the final key to obtain the transmitted data, and then quantum key distribution is used to achieve secure data transmission between the communicating parties.
[0077] At this point, quantum keys are distributed to the communicating parties through the quantum channel to obtain the original key. In the random public verification process of the original key, the character security of each position is quantified based on the verification result and combined with the fact that the eavesdropped characters are usually continuous, and then the comprehensive security of the key segment to be verified is obtained. The verification is continued until the cutoff key is obtained. The cutoff key is difficult for eavesdroppers to guess. By analyzing the changes in the hash value of the cutoff key, the added characters are obtained and the final key is obtained, thereby increasing the key length and improving the security of the key.
[0078] Another embodiment of the present invention provides a data security transmission system based on quantum communication, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, steps S001 to S004 of the above method are implemented.
[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A data security transmission method based on quantum communication, characterized in that: The method comprises the following steps: Obtain the original keys of both parties in quantum communication; Each verification of the original key is regarded as an event, and an FP tree is constructed to obtain several nodes; the node initial value of each node is obtained according to the length of the random key segment corresponding to each event and the verification process of the hash value; the character security of each unverified position in the original key is obtained according to the distribution of characters in the original key, combined with the verification results and distribution of the random key segment, and the node initial value of the node corresponding to the character at each verified position; Based on the character security of each position in the original key and the random key segment, several key segments to be verified and their comprehensive security are obtained; based on the comprehensive security, the key segments to be verified are verified to obtain a cutoff key; by replacing the characters in the cutoff key and obtaining the hash value, a replacement hash value group for each position in the cutoff key is obtained; based on the difference between the replacement hash values in the same replacement hash value group, several added characters are obtained, and the final key is obtained by combining with the cutoff key; Data transmission based on the final key; The specific method of treating each verification of the original key as a matter, constructing an FP tree and obtaining several nodes includes: The completed several verifications are respectively used as an item in the FP tree construction, and the characters at different positions in the original key that have been verified are respectively used as a node in the FP tree to construct the FP tree; The specific method of obtaining the node initial value of each node includes: For any item corresponding to any node, the ratio of the length of the random key segment corresponding to the item to the total length of the original key is recorded as the length factor of the random key segment corresponding to the item; in the verification process corresponding to the item, for the hash value obtained by the random key segments of each of the communicating parties, the ratio of the number of elements involved in the comparison in the hash value to the number of all elements in the hash value is calculated, and recorded as the hash comparison factor of the item; Obtaining a node initial value of the node according to the length factor and the hash comparison factor of all matters corresponding to the node; the node initial value is negatively correlated with the length factor, and the node initial value is positively correlated with the hash comparison factor; The calculation method of the node initial value s is: Among them, n represents the number of items corresponding to the node, a i Indicates the hash comparison factor of the i-th item corresponding to the node, b i It represents the length factor of the random key segment corresponding to the ith event corresponding to the node, and exp() represents an exponential function with a natural constant as the base; The method of obtaining the character security of each unverified position in the original key according to the distribution of the characters in the original key, combined with the verification result and distribution of the random key segment, and the node initial value of the node corresponding to the character at each verified position, includes the following specific methods: Record the characters at the verified positions as the characters at the verified positions, and for any character at the verified positions, take the verification result of the most recent event corresponding to the character at the verified position as the verification result of the character at the verified position; For any character at an unverified position, the character at a verified position that is closest to the character at the unverified position and that has been successfully verified is recorded as the reference character of the character at the unverified position; the two characters at verified positions that are closest to the character at the unverified position and that have failed verification are recorded as the first comparison character and the second comparison character of the character at the unverified position, respectively. Obtaining the security of the character at the unverified position according to the distance between the character at the unverified position and the reference character, the node initial value of the node corresponding to the reference character, and the distance between the character at the unverified position and the first comparison character and the second comparison character; The calculation formula of the character security p of the unverified position is: Wherein, s0 represents the node initial value of the node corresponding to the reference character of the character at the unverified position, d0 represents the distance between the character at the unverified position and the reference character, d1 represents the distance between the character at the unverified position and the first comparison character, and d2 represents the distance between the character at the unverified position and the second comparison character; The specific method of obtaining the plurality of key segments to be verified and their comprehensive security includes: The characters in all verified positions in the original key are removed to obtain a number of key parts in the original key after the removal, and each key part is used as a key segment to be verified to obtain a number of key segments to be verified; For any key segment to be verified, the average security value of the characters in all unverified positions in the key segment to be verified is used as the comprehensive security value of the key segment to be verified; The method of verifying the key segment to be verified based on comprehensive security to obtain the cutoff key includes the following specific methods: The comprehensive security of all key segments to be verified is sorted from large to small as the verification order of all key segments to be verified; the key segments to be verified are verified step by step according to the verification order, and after each verification, the ratio of the sum of the lengths of all unverified key segments to be verified to the total length of the original key is recorded as the unverified factor; When the unverified factor is less than the cutoff threshold for the first time, the verification process is stopped, and all the unverified key segments to be verified at this time are used as the cutoff key; The method of replacing the characters in the cutoff key and obtaining the hash value to obtain the replacement hash value group for each position in the cutoff key includes the following specific methods: Different types of characters in the cutoff key are recorded as several replacement characters. For a character at any position in the cutoff key, the character at the position is replaced with any other different replacement character, and combined with characters at other positions that have not been replaced, a replacement key for the position under the replacement character is obtained, and a hash value is obtained for the replacement key, which is recorded as a replacement hash value for the position under the replacement character; Replace the character at the position with each different replacement character, obtain a replacement hash value of the position under each replacement character, and form a replacement hash value group of the position with all the replacement hash values; The method of obtaining a plurality of added characters based on the difference between the replacement hash values in the same replacement hash value group includes: For any two replacement hash values in any replacement hash value group, based on the total number of elements in the replacement hash values and the number of elements in the same position and with the same element value in the two replacement hash values, a hash value change rate of the two replacement hash values is obtained; the hash value change rate is positively correlated with the total number of elements, and the hash value change rate is negatively correlated with the number of elements in the same position and with the same element value; Taking the average of the hash value change rates of all any two replacement hash values in the replacement hash value group as the replacement change rate of the replacement hash value group; The product of the total length of the original key and the cutoff threshold and rounding up is taken as the final key length, and the difference between the final key length and the cutoff key length is taken as the number of added characters; the positions corresponding to each replacement hash value group are sorted from small to large according to the replacement change rate to obtain a position change sequence; the position of the number of added characters is selected in the position change sequence and recorded as the added position; for any added position, the element corresponding to the character of the added position in the hash value of the cutoff key is taken as the added character of the added position.
2. A data security transmission system based on quantum communication, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for secure data transmission based on quantum communication as claimed in claim 1 are implemented.
Citation Information
Patent Citations
Single-step quantum key distribution post-processing method and system based on polarization code, medium and equipment
CN110011792A
Method and device for realizing privacy amplification in quantum key distribution
CN113810175A