Method and device for calculating distance of communication equipment, and communication equipment
By encrypting the location information of communication devices and verifying its authenticity, the accuracy and security issues of inter-satellite distance calculation are solved, and privacy protection of satellite orbit overlap analysis is achieved.
Patent Information
- Application Number
- CN202210100069.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-01-27
AI Technical Summary
In existing technologies, due to the high confidentiality of satellite orbit data, it is impossible to accurately calculate the distance between satellites through a semi-honest model, resulting in the inability to guarantee the correctness of the calculation results.
The location information of communication devices is encrypted, and the authenticity of the other party's location information is verified through encryption algorithms and hash functions to ensure data transmission security and calculation accuracy.
The accuracy of inter-satellite distance calculation and the security of data transmission are improved, and miscalculations caused by false position information are prevented.
Smart Images

Figure CN116567518B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication equipment orbit calculation, and in particular to a method and device for calculating the distance of communication equipment, and communication equipment. Background Art
[0002] In recent years, with the rapid development of satellite communications, the number of satellites in geostationary orbit has increased, and the spacing between them has become increasingly smaller. This has impacted satellite communication frequencies, leading to an increasing incidence of interference between closely spaced satellites. Therefore, before launching a satellite, all parties must analyze the orbital overlap with nearby satellites to avoid interference. However, satellite orbital data is highly confidential and is not disclosed by all parties. Therefore, this analysis of orbital overlap must be conducted under the premise of protecting privacy.
[0003] Existing technologies calculate the orbital distance between two satellites, or use a semi-honest model to determine the similarity of the two satellite vectors. However, since the semi-honest model requires real data from both parties for calculation, neither party can obtain the other's highly confidential data. Therefore, the semi-honest model has significant limitations in calculating the orbital distance between two satellites. Alternatively, the similarity of the two satellite coordinate vectors is determined by simply comparing the moduli of the two satellite coordinate vectors through homomorphic encryption, without actually calculating their Euclidean distance itself, resulting in low accuracy. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device and communication device for calculating the distance between communication devices, so as to solve the problem in the prior art that when calculating the distance between communication devices based on a semi-honest model, the authenticity of the other party's data cannot be determined, resulting in the inability to guarantee the correctness of the calculation result.
[0005] To achieve the above-mentioned object, an embodiment of the present invention provides a method for calculating the distance of a communication device, which is applied to a first communication device and includes:
[0006] Sending first encrypted data obtained by encrypting the first location information of the first communication device to the second communication device;
[0007] receiving first intermediate data fed back by the second communication device according to the first encrypted data, wherein the first intermediate data includes: encrypted second location information of the second communication device;
[0008] verifying the authenticity of the second location information based on the first intermediate data;
[0009] If the verification is successful, the distance between the first communication device and the second communication device is determined based on the first intermediate data.
[0010] Furthermore, obtaining first encrypted data according to the first location information of the first communication device includes:
[0011] Encrypting the location coordinates in the first location information to obtain first sub-encrypted data;
[0012] encrypting the first random number generated by the first communication device to obtain an encrypted first random number;
[0013] Processing the first sub-encrypted data and the encrypted first random number according to a first encryption algorithm to obtain second sub-encrypted data;
[0014] The first encrypted data includes the first sub-encrypted data and the second sub-encrypted data.
[0015] Furthermore, verifying the authenticity of the second location information based on the first intermediate data includes:
[0016] Decrypting the first intermediate data using a private key to obtain second intermediate data;
[0017] determining a first reference value according to the second intermediate data, and sending the first reference value to the second communication device;
[0018] receiving third intermediate data and fourth intermediate data fed back by the second communication device according to the first reference value;
[0019] decrypting and derandomizing at least one data item in the third intermediate data to obtain fifth intermediate data, decrypting and derandomizing at least one data item in the fourth intermediate data to obtain sixth intermediate data, and sending the fifth intermediate data, the sixth intermediate data, and a hash function pre-generated by the first communication device to the second communication device;
[0020] Receive the random salt value, the second random number, and the first hash value sent by the second communication device, and the seventh intermediate data fed back by the second communication device based on the sixth intermediate data;
[0021] verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data;
[0022] The sum of the fifth intermediate data and the sixth intermediate data is 3.
[0023] Furthermore, verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data includes:
[0024] Processing the random salt value and the second random number according to a hash function pre-generated by the first communication device to obtain a second hash value;
[0025] When the second Hash value is equal to the first Hash value, summing the fifth intermediate data and the seventh intermediate data to obtain an eighth intermediate value;
[0026] If the product of the eighth intermediate data and the square of the second random number is equal to the first reference value, the authenticity of the second position information is verified.
[0027] Furthermore, when the verification is passed, determining the distance between the first communication device and the second communication device according to the first intermediate data includes:
[0028] The distance between the first communication device and the second communication device is equal to the first power of half of the eighth intermediate data.
[0029] To achieve the above-mentioned object, an embodiment of the present invention provides a method for calculating the distance between communication devices, which is applied to a second communication device and includes:
[0030] receiving first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device;
[0031] Determine first intermediate data based on the first encrypted data, and send the first intermediate data to the first communication device; the first intermediate data includes: encrypted second location information of the second communication device;
[0032] verifying the authenticity of the first location information based on the first intermediate data;
[0033] If the verification is successful, the distance between the first communication device and the second communication device is determined based on the first intermediate data.
[0034] Furthermore, the first encrypted data includes first sub-encrypted data and second sub-encrypted data;
[0035] encrypting the location coordinates in the second location information to obtain third sub-encrypted data;
[0036] The determining of first intermediate data according to the first encrypted data includes:
[0037] The second sub-encrypted data, the third sub-encrypted data, and the second random number generated by the second communication device are processed according to a first encryption algorithm to obtain the first intermediate data.
[0038] Furthermore, verifying the authenticity of the first location information based on the first intermediate data includes:
[0039] receiving a first reference value fed back by the first communication device according to the first intermediate data, and performing encryption calculation on the first reference value;
[0040] determining third intermediate data and fourth intermediate data according to the first reference value after encryption calculation, and sending the third intermediate data and the fourth intermediate data to the first communication device;
[0041] receiving fifth intermediate data and sixth intermediate data fed back by the first communication device based on the third intermediate data and the fourth intermediate data, and a hash function pre-generated by the first communication device;
[0042] performing derandomization processing on the sixth intermediate data to obtain seventh intermediate data;
[0043] Processing the random salt value and the second random number generated by the second communication device according to the hash function to determine a first hash value, and sending the first intermediate value, the random salt value, the second random number, and the first hash value to the first communication device;
[0044] The authenticity of the first position information is verified based on the seventh intermediate data, the fifth intermediate data, and the first reference value.
[0045] Furthermore, verifying the authenticity of the first location information based on the seventh intermediate data, the fifth intermediate data, and the first reference value includes:
[0046] adding the seventh intermediate data and the fifth intermediate data to obtain ninth intermediate data;
[0047] If the product of the ninth intermediate data and the square of the second random number is equal to the first reference value, the authenticity of the first position information is verified.
[0048] Furthermore, when the verification is passed, determining the distance between the first communication device and the second communication device according to the first intermediate data includes:
[0049] The distance between the first communication device and the second communication device is equal to the first power of half of the ninth intermediate data.
[0050] To achieve the above-mentioned object, an embodiment of the present invention provides a communication device distance calculation device, which is applied to a first communication device and includes:
[0051] an encryption module, configured to send first encrypted data obtained by encrypting the first location information of the first communication device to a second communication device;
[0052] a first receiving module, configured to receive first intermediate data fed back by the second communication device according to the first encrypted data; the first intermediate data comprising: encrypted second location information of the second communication device;
[0053] a first verification module, configured to verify the authenticity of the second location information based on the first intermediate data;
[0054] The first determining module is configured to determine the distance between the first communication device and the second communication device according to the first intermediate data when the verification is passed.
[0055] To achieve the above-mentioned object, an embodiment of the present invention provides a communication device distance calculation device, which is applied to a second communication device, including:
[0056] a second receiving module, configured to receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device;
[0057] a second determining module, configured to determine first intermediate data based on the first encrypted data, and send the first intermediate data to the first communication device; the first intermediate data comprising: encrypted second location information of the second communication device;
[0058] a second verification module, configured to verify the authenticity of the first location information based on the first intermediate data;
[0059] The third determining module is configured to determine the distance between the first communication device and the second communication device according to the first intermediate data when the verification is passed.
[0060] To achieve the above object, an embodiment of the present invention provides a communication device, which is a first communication device and includes a processor and a transceiver, wherein:
[0061] The transceiver is used to send first encrypted data obtained by encrypting the first location information of the first communication device to the second communication device;
[0062] receiving first intermediate data fed back by the second communication device according to the first encrypted data, wherein the first intermediate data includes: encrypted second location information of the second communication device;
[0063] The processor is configured to verify the authenticity of the second location information based on the first intermediate data;
[0064] If the verification is successful, the distance between the first communication device and the second communication device is determined based on the first intermediate data.
[0065] To achieve the above object, an embodiment of the present invention provides a communication device, which is a second communication device and includes a processor and a transceiver, wherein:
[0066] The transceiver is configured to receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device;
[0067] The processor is configured to determine first intermediate data based on the first encrypted data; the first intermediate data comprising: encrypted second location information of the second communication device;
[0068] The transceiver is further configured to send the first intermediate data to the first communication device;
[0069] verifying the authenticity of the first location information based on the first intermediate data;
[0070] The processor is further configured to determine, if the verification is successful, a distance between the first communication device and the second communication device based on the first intermediate data.
[0071] To achieve the above-mentioned purpose, an embodiment of the present invention provides a communication device, including a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, the method for calculating the distance of the communication device as described above is implemented.
[0072] To achieve the above-mentioned object, an embodiment of the present invention provides a readable storage medium having a program or instruction stored thereon, which implements the steps in the above-mentioned method for calculating the distance of a communication device when the program or instruction is executed by a processor.
[0073] The beneficial effects of the above technical solution of the present invention are as follows:
[0074] The method for calculating the distance between communication devices in an embodiment of the present invention includes: encrypting the first location information of the first communication device to obtain first encrypted data and sending it to the second communication device; receiving first intermediate data fed back by the second communication device based on the first encrypted data; the first intermediate data includes: the encrypted second location information of the second communication device; by encrypting the first location information and sending it to the second communication device, and receiving the encrypted second location information of the second communication device, encrypted transmission is performed between the first communication device and the second communication device to prevent malicious tampering by a third party, thereby improving the security of data transmission between communication devices. Based on the first intermediate data, the authenticity of the second location information is verified; if the verification is successful, the distance between the first communication device and the second communication device is determined based on the first intermediate data; verifying the authenticity of the second location information through the first intermediate data avoids the second communication device sending false location information, which results in the calculated distance between the first and second communication devices being an incorrect distance, thereby improving the accuracy of the distance calculation between the first and second communication devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 1 is a flow chart of a method for calculating a communication device distance applied to a first communication device according to an embodiment of the present invention;
[0076] Figure 2 1 is a flow chart of a method for calculating a communication device distance applied to a second communication device according to an embodiment of the present invention;
[0077] Figure 3 Schematic diagram of a communication device distance calculation apparatus applied to a first communication device according to an embodiment of the present invention;
[0078] Figure 4 Schematic diagram of a communication device distance calculation apparatus applied to a second communication device according to an embodiment of the present invention;
[0079] Figure 5 This is a schematic diagram of the structure of a communication device according to an embodiment of the present invention;
[0080] Figure 6 This is a second structural diagram of a communication device according to an embodiment of the present invention;
[0081] Figure 7 2 is a schematic structural diagram of another communication device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0082] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0083] It should be understood that references throughout this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic associated with the embodiment is included in at least one embodiment of the present invention. Therefore, the appearances of "in one embodiment" or "in an embodiment" throughout this specification do not necessarily refer to the same embodiment. Furthermore, these particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0084] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0085] Additionally, the terms "system" and "network" are often used interchangeably herein.
[0086] In the embodiments provided herein, it should be understood that "B corresponding to A" means that B is associated with A and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information.
[0087] like Figure 1 As shown, a method for calculating the distance of a communication device according to an embodiment of the present invention is applied to a first communication device and includes the following steps:
[0088] Step 101: Send first encrypted data obtained by encrypting first location information of the first communication device to a second communication device;
[0089] Step 102: Receive first intermediate data fed back by the second communication device based on the first encrypted data; the first intermediate data includes: encrypted second location information of the second communication device;
[0090] Step 103: Verify the authenticity of the second location information based on the first intermediate data;
[0091] Step 104: If the verification is successful, determine the distance between the first communication device and the second communication device based on the first intermediate data.
[0092] It should be noted that the communication device may be a satellite, the first communication device may be satellite A, and the second communication device may be satellite B. The first location information includes the three-dimensional coordinates of the first communication device, and the second location information includes the three-dimensional coordinates of the second communication device.
[0093] The method for calculating the distance between communication devices in an embodiment of the present invention encrypts first location information and sends it to a second communication device, and receives encrypted second location information of the second communication device, and encrypts the transmission between the first communication device and the second communication device to prevent malicious tampering by a third party, thereby improving the security of data transmission between communication devices; verifies the authenticity of the second location information through first intermediate data, thereby avoiding the second communication device sending false location information, which causes the calculated distance between the first communication device and the second communication device to be an incorrect distance, thereby improving the accuracy of the distance calculation between the first communication device and the second communication device.
[0094] Optionally, obtaining first encrypted data according to the first location information of the first communication device includes:
[0095] Encrypting the location coordinates in the first location information to obtain first sub-encrypted data;
[0096] encrypting the first random number generated by the first communication device to obtain an encrypted first random number;
[0097] Processing the first sub-encrypted data and the encrypted first random number according to a first encryption algorithm to obtain second sub-encrypted data;
[0098] The first encrypted data includes the first sub-encrypted data and the second sub-encrypted data.
[0099] In one embodiment of the present invention, the position coordinates in the first position information are X=(x1, x2, x3), and the position coordinates in the second position information are Y=(y1, y2, y3).
[0100] The location coordinates in the first location information are encrypted to obtain the first sub-encrypted data E(x i ), i=1,2,3. A Encryption is performed to obtain the encrypted first random number E(r A ).
[0101] In one embodiment of the present invention, the first encryption algorithm may be the Paillier encryption algorithm. According to the additive homomorphism of the Paillier encryption algorithm, the second sub-encrypted data E(x i +r A ), where E(x i +r A )=E(x i )·E(r A ).
[0102] The method for calculating the distance between communication devices in an embodiment of the present invention improves the security of data transmission between communication devices by encrypting the position coordinates and the first random number in the first position information and then transmitting them.
[0103] Optionally, verifying the authenticity of the second location information based on the first intermediate data includes:
[0104] Decrypting the first intermediate data using a private key to obtain second intermediate data;
[0105] determining a first reference value according to the second intermediate data, and sending the first reference value to the second communication device;
[0106] receiving third intermediate data and fourth intermediate data fed back by the second communication device according to the first reference value;
[0107] decrypting and derandomizing at least one data item in the third intermediate data to obtain fifth intermediate data, decrypting and derandomizing at least one data item in the fourth intermediate data to obtain sixth intermediate data, and sending the fifth intermediate data, the sixth intermediate data, and a hash function pre-generated by the first communication device to the second communication device;
[0108] Receive the random salt value, the second random number, and the first hash value sent by the second communication device, and the seventh intermediate data fed back by the second communication device based on the sixth intermediate data;
[0109] verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data;
[0110] The sum of the fifth intermediate data and the sixth intermediate data is 3.
[0111] In one embodiment of the present invention, the first intermediate data may be E(Rx i -Ry i ), where R is a second random number; decrypting the first intermediate data using a private key to obtain the second intermediate data Rx i -Ry i , and then calculate the first reference value ∑ i (Rx i -Ry i ) 2 , that is, the square of the Euclidean distance between the first communication device and the second communication device.
[0112] In one embodiment of the present invention, the third intermediate data may be E(x i +rA )·E(-y i ), the fourth intermediate data may be E(x i +r A )·E(-y i +r B ), where r B A third random number is generated for the second communication device.
[0113] Decrypt and derandomize s of the third intermediate data to obtain s fifth intermediate data (x m -y m ) 2 , decrypt and derandomize 3-s of the fourth intermediate data to obtain 3-s sixth intermediate data
[0114] Receive the random salt value salt, the second random number R and the first hash value h sent by the second communication device, and the seventh intermediate data ∑ n∈[1,3-s] (x n -y n ) 2 .
[0115] The method for calculating the distance between communication devices in an embodiment of the present invention verifies the authenticity of the second location information through first intermediate data, thereby avoiding the second communication device sending false location information, which causes the calculated distance between the first communication device and the second communication device to be an incorrect distance, and improves the accuracy of the distance calculation between the first communication device and the second communication device.
[0116] Optionally, verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data includes:
[0117] Processing the random salt value and the second random number according to a hash function pre-generated by the first communication device to obtain a second hash value;
[0118] When the second Hash value is equal to the first Hash value, summing the fifth intermediate data and the seventh intermediate data to obtain an eighth intermediate value;
[0119] If the product of the eighth intermediate data and the square of the second random number is equal to the first reference value, the authenticity of the second position information is verified.
[0120] In one embodiment of the present invention, the hash function is H, the second hash value is h′=H(salt||R), and when h′=h, the fifth intermediate data and the seventh intermediate data are summed to obtain the eighth intermediate data z=∑ m∈[1,s] (x m -y m ) 2 +∑ n∈[1,3-s] (x n -y n ) 2 By comparing the first hash value with the second hash value, if the first hash value and the second hash value are not equal, the random salt value and the second random number sent by the second communication device are false data. Therefore, by verifying the second hash value, the authenticity of the random salt value and the second random number sent by the second communication device can be determined.
[0121] Then, the product z·R of the eighth intermediate data z and the square of the second random number is compared. 2 With the first reference value ∑ i (Rx i -Ry i ) 2 Whether they are equal to each other determines the authenticity of the second position information. If z·R 2 =∑ i (Rx i -Ry i ) 2 , then the second location information passes the verification and is the real location information.
[0122] The method for calculating the distance between communication devices in an embodiment of the present invention verifies the authenticity of the second location information, thereby avoiding the second communication device sending false location information, which causes the calculated distance between the first communication device and the second communication device to be an incorrect distance, thereby improving the accuracy of the distance calculation between the first communication device and the second communication device.
[0123] Optionally, when the verification is passed, determining the distance between the first communication device and the second communication device according to the first intermediate data includes:
[0124] The distance between the first communication device and the second communication device is equal to the first power of half of the eighth intermediate data.
[0125] In one embodiment of the present invention, if z·R 2 =∑ i (Rx i -Ry i ) 2 , then the Euclidean distance between the first communication device and the second communication device is
[0126] like Figure 2 As shown, an embodiment of the present invention provides a method for calculating the distance between communication devices, which is applied to a second communication device and includes the following steps:
[0127] Step 201: Receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device;
[0128] Step 202: Determine first intermediate data based on the first encrypted data, and send the first intermediate data to the first communication device; the first intermediate data includes: encrypted second location information of the second communication device;
[0129] Step 203: Verify the authenticity of the first location information based on the first intermediate data;
[0130] Step 204: If the verification is successful, determine the distance between the first communication device and the second communication device based on the first intermediate data.
[0131] According to an embodiment of the present invention, a method for calculating the distance between communication devices determines, based on first encrypted data received from a first communication device, first intermediate data including the encrypted second location information of the second communication device, and sends it to the first communication device. The data is encrypted and transmitted between the first communication device and the second communication device to prevent malicious tampering by a third party, thereby improving the security of data transmission between the communication devices. The authenticity of the first location information of the first communication device is verified through the first intermediate data, thereby avoiding the first communication device sending false location information, which results in the calculated distance between the first communication device and the second communication device being an incorrect distance, thereby improving the accuracy of the distance calculation between the first communication device and the second communication device.
[0132] Optionally, the first encrypted data includes first sub-encrypted data and second sub-encrypted data;
[0133] encrypting the location coordinates in the second location information to obtain third sub-encrypted data;
[0134] The determining of first intermediate data according to the first encrypted data includes:
[0135] The second sub-encrypted data, the third sub-encrypted data, and the second random number generated by the second communication device are processed according to a first encryption algorithm to obtain the first intermediate data.
[0136] In one embodiment of the present invention, the position coordinates in the second position information are encrypted to obtain the third sub-encrypted data E(y i), the first encryption algorithm may be the Paillier encryption algorithm, and the first intermediate data E(Rx i -Ry i ), where E(Rx i -Ry i )=(E(x i )) R ·(E(-y i )) R .
[0137] Optionally, verifying the authenticity of the first location information according to the first intermediate data includes:
[0138] receiving a first reference value fed back by the first communication device according to the first intermediate data, and performing encryption calculation on the first reference value;
[0139] determining third intermediate data and fourth intermediate data according to the first reference value after encryption calculation, and sending the third intermediate data and the fourth intermediate data to the first communication device;
[0140] receiving fifth intermediate data and sixth intermediate data fed back by the first communication device based on the third intermediate data and the fourth intermediate data, and a hash function pre-generated by the first communication device;
[0141] performing derandomization processing on the sixth intermediate data to obtain seventh intermediate data;
[0142] Processing the random salt value and the second random number generated by the second communication device according to the hash function to determine a first hash value, and sending the first intermediate value, the random salt value, the second random number, and the first hash value to the first communication device;
[0143] The authenticity of the first position information is verified based on the seventh intermediate data, the fifth intermediate data, and the first reference value.
[0144] In one embodiment of the present invention, a first reference value ∑ i (Rx i -Ry i ) 2 , the first reference value is encrypted and calculated according to the first random value and the third random value to obtain the third intermediate data E(x i +r A )·E(-y i ) and the fourth intermediate data E(x i +r A )·E(-y i +rB ).
[0145] Receive the fifth intermediate data ∑ m∈[1,s] (x m -y m ) 2 and the sixth intermediate data and the hash function H; for the sixth intermediate data Perform derandomization processing to obtain the seventh intermediate data ∑ n∈[1,3-s] (x n -y n ) 2 ; The first hash value h = H(salt||R).
[0146] Optionally, verifying the authenticity of the first location information according to the seventh intermediate data, the fifth intermediate data, and the first reference value includes:
[0147] adding the seventh intermediate data and the fifth intermediate data to obtain ninth intermediate data;
[0148] If the product of the ninth intermediate data and the square of the second random number is equal to the first reference value, the authenticity of the first position information is verified.
[0149] The ninth intermediate data z′=∑ m∈[1,s] (x m -y m ) 2 +∑ n∈[1,3-s] (x n -y n ) 2 .
[0150] Then we will compare the intermediate data z ′ The product of the square of the second random number z′·R 2 With the first reference value ∑ i (Rx i -Ry i ) 2 Whether they are equal to each other determines the authenticity of the first position information. If z′·R 2 =∑ i (Rx i -Ry i ) 2 , then the second location information passes the verification and is the real location information.
[0151] The method for calculating the distance between communication devices in an embodiment of the present invention verifies the authenticity of the first location information, thereby avoiding the first communication device sending false location information, which causes the calculated distance between the first communication device and the second communication device to be an incorrect distance, thereby improving the accuracy of the distance calculation between the first communication device and the second communication device.
[0152] Optionally, when the verification is passed, determining the distance between the first communication device and the second communication device according to the first intermediate data includes:
[0153] The distance between the first communication device and the second communication device is equal to the first power of half of the ninth intermediate data.
[0154] In one embodiment of the present invention, if z′·R 2 =∑ i (Rx i -Ry i ) 2 , then the Euclidean distance between the first communication device and the second communication device is
[0155] In one embodiment of the present invention, before calculating the distance between the first communication device and the second communication device using a semi-honest model, the calculation protocol is initialized. The specific steps are as follows:
[0156] Determine the public key pk (for encryption) and private key pk (for decryption) required for the first communication device to maintain confidentiality, and generate a hash function H and a first random number r A (for privacy-preserving computing);
[0157] The second communication device generates a second random number R and a third random number r B , and determine a random salt value salt.
[0158] Next, the coordinates X=(x1, x2, x3) of the first communication device and the coordinates Y=(y1, y2, y3) of the second communication device are input into the calculation model.
[0159] Finally, the Euclidean distance between the first communication device and the second communication device is output.
[0160] With reference to the simulation experiment results, the reliability of the method for calculating the distance between communication devices according to the embodiment of the present invention is confirmed.
[0161] The experiment simulates a three-dimensional space. Taking the orbit analysis of two satellites as an example, it is assumed that A and B are two communication devices (satellites) with similar orbits. The center of the earth is the origin of the three-dimensional coordinate system. The orbit equation of A is:
[0162]
[0163] The running cycle is 24h, and the orbit equation of B is:
[0164]
[0165] The operating cycle is 8 hours. Analyze whether A and B will be too close during operation. Define △ = 700km as the threshold. That is, when the distance between A and B is less than △, it means that the distance between them is too small and it is necessary to adjust the orbit parameters or take interference shielding measures. Since the lowest common multiple of the operating cycles of the two is 24 hours, a number of points are uniformly selected in the range of [0, 24 hours] on the orbits of both A and B. In the experiment, the time interval for selecting coordinates is simulated to be 15 minutes, so 96 points a1, a2, a3, ... a1 are selected on the orbit of A. 96 , select 32 points b1,b2,b3,...b on track B 32 , that is, when A runs to point a 33 When B returns to the initial point b1, the cycle repeats three times. With the solution of the present invention, the Euclidean distance confidentiality calculation is performed at each time point in sequence. The calculation results of the simulation experiment are shown in the following table:
[0166] time The position coordinates of A The position coordinates of B Distance between A and B Whether it exceeds the threshold <![CDATA[t1]]> [1301.0,573.0,445.0] [620.0,1213.0,263.0] 952.1 N <![CDATA[t2]]> [1248.78,540.52,436.07] [558.77,1017.83,116.14] 897.94 N <![CDATA[t 33 ]]> [-1206.45,-691.46,-150] [620.0,1213.0,263.0] 2670.87 N <![CDATA[t 62 ]]> [-176.74,-8.47,2.1] [406.82,189.65,-288.92] 681.53 Y <![CDATA[t 63 ]]> [-82.85,40.06,23.72] [367.1,-165.38,-411.16] 658.62 Y <![CDATA[t 67 ]]> [295.07,230.63,113.42] [498.48,755.47,-36.76] 582.57 Y <![CDATA[t 68 ]]> [388.12,276.38,136.17] [442.83,442.07,-186.29] 366.64 Y <![CDATA[t 69 ]]> [479.79,320.96,158.85] [395.26,96.91,-323.25] 538.3 Y <![CDATA[t 84 ]]> [1450.53,739.23,429.36] [817.58,574.79,587.16] 672.73 Y <![CDATA[t 85 ]]> [1475.56,744.93,439.2] [820.63,869.57,628.12] 692.94 Y <![CDATA[t 96 ]]> [1347.93,603.05,452.55] [340.12,-514.78,-506.99] 1784.92 N
[0167] The simulation calculated the Euclidean distance between 96 three-dimensional vectors, taking a total of 317 milliseconds, consistent with previous experimental analysis of the SEPC scheme's time complexity. The experiment showed that, of the 96 time points tested, the Euclidean distance between the coordinates of seven points fell below the threshold, accounting for 7% of the total. This indicates that the satellites were too close to each other at these seven moments, and measures need to be taken to prevent this.
[0168] like Figure 3 As shown, an embodiment of the present invention provides a communication device distance calculation device 300, which is applied to a first communication device, including:
[0169] An encryption module 301 is configured to send first encrypted data obtained by encrypting the first location information of the first communication device to a second communication device;
[0170] The first receiving module 302 is configured to receive first intermediate data fed back by the second communication device according to the first encrypted data; the first intermediate data includes: encrypted second location information of the second communication device;
[0171] A first verification module 303, configured to verify the authenticity of the second location information based on the first intermediate data;
[0172] The first determining module 304 is configured to determine the distance between the first communication device and the second communication device according to the first intermediate data if the verification is successful.
[0173] The device for calculating the distance between communication devices in an embodiment of the present invention encrypts first location information and sends it to a second communication device, and receives encrypted second location information of the second communication device, and encrypts the transmission between the first communication device and the second communication device to prevent malicious tampering by a third party, thereby improving the security of data transmission between communication devices; verifies the authenticity of the second location information through first intermediate data, thereby avoiding the second communication device sending false location information, which would cause the calculated distance between the first communication device and the second communication device to be an incorrect distance, thereby improving the accuracy of the distance calculation between the first communication device and the second communication device.
[0174] like Figure 4 As shown, an embodiment of the present invention provides a communication device distance calculation device 400, which is applied to a second communication device, including:
[0175] A second receiving module 401 is configured to receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device;
[0176] A second determining module 402 is configured to determine first intermediate data based on the first encrypted data, and send the first intermediate data to the first communication device; the first intermediate data includes: encrypted second location information of the second communication device;
[0177] A second verification module 403 is configured to verify the authenticity of the first location information based on the first intermediate data;
[0178] The third determining module 404 is configured to determine the distance between the first communication device and the second communication device according to the first intermediate data if the verification is successful.
[0179] According to an embodiment of the present invention, a device for calculating the distance between communication devices determines first intermediate data including the encrypted second location information of the second communication device based on first encrypted data received from the first communication device and sends it to the first communication device, and encrypts the transmission between the first communication device and the second communication device to prevent malicious tampering by a third party, thereby improving the security of data transmission between the communication devices; the authenticity of the first location information of the first communication device is verified by the first intermediate data, thereby avoiding the first communication device sending false location information, which causes the calculated distance between the first communication device and the second communication device to be an incorrect distance, thereby improving the accuracy of the distance calculation between the first communication device and the second communication device.
[0180] like Figure 5 As shown, an embodiment of the present invention provides a communication device 500, which is a first communication device and includes a processor 501 and a transceiver 502, wherein:
[0181] The transceiver 502 is configured to send first encrypted data obtained by encrypting the first location information of the first communication device to the second communication device;
[0182] receiving first intermediate data fed back by the second communication device according to the first encrypted data, wherein the first intermediate data includes: encrypted second location information of the second communication device;
[0183] The processor 501 is configured to verify the authenticity of the second location information based on the first intermediate data;
[0184] If the verification is successful, the distance between the first communication device and the second communication device is determined based on the first intermediate data.
[0185] like Figure 6 As shown, an embodiment of the present invention provides a communication device 600, which is a second communication device and includes a processor 601 and a transceiver 602, wherein:
[0186] The transceiver 602 is configured to receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device;
[0187] The processor 601 is configured to determine first intermediate data according to the first encrypted data; the first intermediate data comprising: encrypted second location information of the second communication device;
[0188] The transceiver 602 is further configured to send the first intermediate data to the first communication device;
[0189] verifying the authenticity of the first location information based on the first intermediate data;
[0190] The processor 601 is further configured to determine, if the verification is successful, the distance between the first communication device and the second communication device based on the first intermediate data.
[0191] A communication device according to another embodiment of the present invention, such as Figure 7 As shown, it includes a transceiver 710, a processor 700, a memory 720, and a program or instruction stored in the memory 720 and executable on the processor 700; when the processor 700 executes the program or instruction, the above-mentioned calculation method for the distance of the communication device is implemented.
[0192] The transceiver 710 is configured to receive and send data under the control of the processor 700 .
[0193] Among them, Figure 7 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically various circuits of one or more processors represented by processor 700 and memory represented by memory 720, which are linked together. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not described further herein. The bus interface provides an interface. The transceiver 710 may be a plurality of components, i.e., a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 730 may also be an interface capable of connecting external or internal devices as required, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, etc.
[0194] The processor 700 is responsible for managing the bus architecture and general processing, and the memory 720 can store data used by the processor 700 when performing operations.
[0195] A readable storage medium according to an embodiment of the present invention stores a program or instruction thereon. When the program or instruction is executed by a processor, the steps in the method for calculating the distance of the communication device as described above are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0196] The processor is the processor in the communication device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0197] It should be further noted that the terminals described in this specification include but are not limited to smartphones, tablet computers, etc., and many functional components described are referred to as modules in order to more particularly emphasize the independence of their implementation methods.
[0198] In embodiments of the present invention, modules can be implemented in software so that they can be executed by various types of processors. For example, an identified executable code module can include one or more physical or logical blocks of computer instructions, for example, which can be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different locations, which, when logically combined together, constitute the module and achieve the specified purpose of the module.
[0199] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed in the middle of different programs, and distributed across a plurality of memory devices.Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form.Described operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.
[0200] When a module can be implemented using software, given the current state of hardware technology, those skilled in the art can build corresponding hardware circuits to implement the corresponding functions of the module, regardless of cost. The hardware circuits may include conventional very large scale integration (VLSI) circuits or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules may also be implemented using programmable hardware devices, such as field programmable gate arrays, programmable array logic, or programmable logic devices.
[0201] The above exemplary embodiments are described with reference to the accompanying drawings. Many different forms and embodiments are possible without departing from the spirit and teachings of the present invention. Therefore, the present invention should not be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be complete and perfect and will convey the scope of the invention to those skilled in the art. In the drawings, component sizes and relative sizes may be exaggerated for clarity. The terminology used herein is for purposes of describing specific exemplary embodiments only and is not intended to be limiting. As used herein, the singular forms "a," "an," and "the" are intended to include plural forms, unless the context clearly indicates otherwise. It will be further understood that the terms "comprising" and / or "including," when used in this specification, indicate the presence of stated features, integers, steps, operations, components, and / or elements, but do not preclude the presence or addition of one or more other features, integers, steps, operations, components, elements, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of that range and any subranges therebetween.
[0202] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for calculating the distance of a communication device, applied to a first communication device, characterized in that: include: Sending first encrypted data obtained by encrypting the first location information of the first communication device to the second communication device; receiving first intermediate data fed back by the second communication device according to the first encrypted data; The first intermediate data includes: encrypted second location information of the second communication device; verifying the authenticity of the second location information based on the first intermediate data; If the verification is successful, determining the distance between the first communication device and the second communication device according to the first intermediate data; The verifying the authenticity of the second location information according to the first intermediate data includes: Decrypting the first intermediate data using a private key to obtain second intermediate data; determining a first reference value according to the second intermediate data, and sending the first reference value to the second communication device; receiving third intermediate data and fourth intermediate data fed back by the second communication device according to the first reference value; decrypting and derandomizing at least one data item in the third intermediate data to obtain fifth intermediate data, decrypting and derandomizing at least one data item in the fourth intermediate data to obtain sixth intermediate data, and sending the fifth intermediate data, the sixth intermediate data, and a hash function pre-generated by the first communication device to the second communication device; Receive the random salt value, the second random number, and the first hash value sent by the second communication device, and the seventh intermediate data fed back by the second communication device based on the sixth intermediate data; verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data; The sum of the fifth intermediate data and the sixth intermediate data is 3.
2. The method for calculating the distance of a communication device according to claim 1, wherein: The obtaining, according to the first location information of the first communication device, first encrypted data includes: Encrypting the location coordinates in the first location information to obtain first sub-encrypted data; encrypting the first random number generated by the first communication device to obtain an encrypted first random number; Processing the first sub-encrypted data and the encrypted first random number according to a first encryption algorithm to obtain second sub-encrypted data; The first encrypted data includes the first sub-encrypted data and the second sub-encrypted data.
3. The method for calculating the distance of a communication device according to claim 1, wherein: The verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data includes: Processing the random salt value and the second random number according to a hash function pre-generated by the first communication device to obtain a second hash value; When the second Hash value is equal to the first Hash value, summing the fifth intermediate data and the seventh intermediate data to obtain an eighth intermediate value; If the product of the eighth intermediate data and the square of the second random number is equal to the first reference value, the authenticity of the second position information is verified.
4. The method for calculating the distance of communication equipment according to claim 3, wherein: The determining, if the verification is passed, the distance between the first communication device and the second communication device according to the first intermediate data includes: The distance between the first communication device and the second communication device is equal to the first power of half of the eighth intermediate data.
5. A method for calculating the distance between communication devices, applied to a second communication device, characterized in that: include: receiving first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device; determining first intermediate data according to the first encrypted data, and sending the first intermediate data to the first communication device; The first intermediate data includes: encrypted second location information of the second communication device; verifying the authenticity of the first location information based on the first intermediate data; If the verification is successful, determining the distance between the first communication device and the second communication device according to the first intermediate data; The verifying the authenticity of the first location information according to the first intermediate data includes: receiving a first reference value fed back by the first communication device according to the first intermediate data, and performing encryption calculation on the first reference value; determining third intermediate data and fourth intermediate data according to the first reference value after encryption calculation, and sending the third intermediate data and the fourth intermediate data to the first communication device; receiving fifth intermediate data and sixth intermediate data fed back by the first communication device based on the third intermediate data and the fourth intermediate data, and a hash function pre-generated by the first communication device; performing derandomization processing on the sixth intermediate data to obtain seventh intermediate data; Processing the random salt value and the second random number generated by the second communication device according to the hash function to determine a first hash value, and sending the first intermediate value, the random salt value, the second random number, and the first hash value to the first communication device; The authenticity of the first position information is verified based on the seventh intermediate data, the fifth intermediate data, and the first reference value.
6. The method for calculating the distance of communication equipment according to claim 5, characterized in that: The first encrypted data includes first sub-encrypted data and second sub-encrypted data; encrypting the location coordinates in the second location information to obtain third sub-encrypted data; The determining of first intermediate data according to the first encrypted data includes: The second sub-encrypted data, the third sub-encrypted data, and the second random number generated by the second communication device are processed according to a first encryption algorithm to obtain the first intermediate data.
7. The method for calculating the distance of communication equipment according to claim 5, characterized in that: The verifying the authenticity of the first location information according to the seventh intermediate data, the fifth intermediate data, and the first reference value includes: adding the seventh intermediate data and the fifth intermediate data to obtain ninth intermediate data; If the product of the ninth intermediate data and the square of the second random number is equal to the first reference value, the authenticity of the first position information is verified.
8. The method for calculating the distance of communication equipment according to claim 7, characterized in that: The determining, if the verification is passed, the distance between the first communication device and the second communication device according to the first intermediate data includes: The distance between the first communication device and the second communication device is equal to the first power of half of the ninth intermediate data.
9. A communication device distance calculation device, applied to a first communication device, characterized in that: include: an encryption module, configured to send first encrypted data obtained by encrypting the first location information of the first communication device to a second communication device; a first receiving module, configured to receive first intermediate data fed back by the second communication device according to the first encrypted data; The first intermediate data includes: encrypted second location information of the second communication device; a first verification module, configured to verify the authenticity of the second location information based on the first intermediate data; a first determining module, configured to determine, if the verification is successful, a distance between the first communication device and the second communication device based on the first intermediate data; The first verification module is specifically used to: Decrypting the first intermediate data using a private key to obtain second intermediate data; determining a first reference value according to the second intermediate data, and sending the first reference value to the second communication device; receiving third intermediate data and fourth intermediate data fed back by the second communication device according to the first reference value; decrypting and derandomizing at least one data item in the third intermediate data to obtain fifth intermediate data, decrypting and derandomizing at least one data item in the fourth intermediate data to obtain sixth intermediate data, and sending the fifth intermediate data, the sixth intermediate data, and a hash function pre-generated by the first communication device to the second communication device; Receive the random salt value, the second random number, and the first hash value sent by the second communication device, and the seventh intermediate data fed back by the second communication device based on the sixth intermediate data; verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data; The sum of the fifth intermediate data and the sixth intermediate data is 3.
10. A device for calculating the distance between communication devices, applied to a second communication device, characterized in that: include: a second receiving module, configured to receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device; a second determining module, configured to determine first intermediate data according to the first encrypted data, and send the first intermediate data to the first communication device; The first intermediate data includes: encrypted second location information of the second communication device; a second verification module, configured to verify the authenticity of the first location information based on the first intermediate data; a third determining module, configured to determine, if the verification is passed, a distance between the first communication device and the second communication device based on the first intermediate data; The second verification module is specifically used to: receiving a first reference value fed back by the first communication device according to the first intermediate data, and performing encryption calculation on the first reference value; determining third intermediate data and fourth intermediate data according to the first reference value after encryption calculation, and sending the third intermediate data and the fourth intermediate data to the first communication device; receiving fifth intermediate data and sixth intermediate data fed back by the first communication device based on the third intermediate data and the fourth intermediate data, and a hash function pre-generated by the first communication device; performing derandomization processing on the sixth intermediate data to obtain seventh intermediate data; Processing the random salt value and the second random number generated by the second communication device according to the hash function to determine a first hash value, and sending the first intermediate value, the random salt value, the second random number, and the first hash value to the first communication device; The authenticity of the first position information is verified based on the seventh intermediate data, the fifth intermediate data, and the first reference value.
11. A communication device, wherein the communication device is a first communication device, characterized in that: include: transceivers and processors; The transceiver is used to send first encrypted data obtained by encrypting the first location information of the first communication device to the second communication device; receiving first intermediate data fed back by the second communication device according to the first encrypted data; The first intermediate data includes: encrypted second location information of the second communication device; The processor is configured to verify the authenticity of the second location information based on the first intermediate data; If the verification is successful, determining the distance between the first communication device and the second communication device according to the first intermediate data; The processor is further configured to: Decrypting the first intermediate data using a private key to obtain second intermediate data; determining a first reference value according to the second intermediate data, and sending the first reference value to the second communication device; receiving third intermediate data and fourth intermediate data fed back by the second communication device according to the first reference value; decrypting and derandomizing at least one data item in the third intermediate data to obtain fifth intermediate data, decrypting and derandomizing at least one data item in the fourth intermediate data to obtain sixth intermediate data, and sending the fifth intermediate data, the sixth intermediate data, and a hash function pre-generated by the first communication device to the second communication device; Receive the random salt value, the second random number, and the first hash value sent by the second communication device, and the seventh intermediate data fed back by the second communication device based on the sixth intermediate data; verifying the authenticity of the second location information according to the random salt value, the second random number, the first hash value, the fifth intermediate data, and the seventh intermediate data; The sum of the fifth intermediate data and the sixth intermediate data is 3.
12. A communication device, the communication device being a second communication device, characterized in that: include: transceivers and processors; The transceiver is configured to receive first encrypted data sent by a first communication device, where the first encrypted data includes first location information of the first communication device; The processor is configured to determine first intermediate data based on the first encrypted data; The first intermediate data includes: encrypted second location information of the second communication device; The transceiver is further configured to send the first intermediate data to the first communication device; verifying the authenticity of the first location information based on the first intermediate data; The processor is further configured to, if the verification is successful, determine the distance between the first communication device and the second communication device based on the first intermediate data; The processor is further configured to: receiving a first reference value fed back by the first communication device according to the first intermediate data, and performing encryption calculation on the first reference value; determining third intermediate data and fourth intermediate data according to the first reference value after encryption calculation, and sending the third intermediate data and the fourth intermediate data to the first communication device; receiving fifth intermediate data and sixth intermediate data fed back by the first communication device based on the third intermediate data and the fourth intermediate data, and a hash function pre-generated by the first communication device; performing derandomization processing on the sixth intermediate data to obtain seventh intermediate data; Processing the random salt value and the second random number generated by the second communication device according to the hash function to determine a first hash value, and sending the first intermediate value, the random salt value, the second random number, and the first hash value to the first communication device; The authenticity of the first position information is verified based on the seventh intermediate data, the fifth intermediate data, and the first reference value.
13. A communication device comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; characterized in that, when the communication device is a first communication device, the processor implements the method for calculating the distance of the communication device as described in any one of claims 1 to 4 when executing the program or instruction; and when the communication device is a second communication device, the processor implements the method for calculating the distance of the communication device as described in any one of claims 5 to 8 when executing the program or instruction.
14. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps in the method for calculating the distance of a communication device as described in any one of claims 1 to 4 are implemented, or the steps in the method for calculating the distance of a communication device as described in any one of claims 5 to 8 are implemented.
Citation Information
Patent Citations
Base station location authentication
CN113614572A