CN-120433975-B - Position privacy protection method and system based on homomorphic encryption
Abstract
The invention discloses a position privacy protection method and a position privacy protection system based on homomorphic encryption, and belongs to the technical field of data processing; the method comprises the steps that a client encrypts position data homomorphically into ciphertext of a digital matrix, the ciphertext of the digital matrix is transmitted to a server through a streaming, the server matches the obtained ciphertext with the matrix in a database, and the database sends a matching result to the client. According to the method, the data information is combined with homomorphic encryption, the matrix mode is adopted, calculation and matching are directly carried out on the encrypted data without decrypting the data, the comparison can be carried out safely, any information is not revealed, the privacy information of the client side and the server side is fully protected, the privacy data can be invisible, and the server does not need to contact with plaintext data, so that the safety of the privacy data of the user position is greatly improved.
Inventors
- LI XIAODONG
- AN XINGYU
- ZHOU SUYA
- LI HUI
- Zhao Chiye
- JIN XIN
- MA LAN
- ZHANG ZHEYU
- FU ANXU
- CUI YUAN
- YUE HAO
- DOU YIMENG
- ZHAO RUOYUN
- GUAN LI
Assignees
- 北京电子科技学院
Dates
- Publication Date
- 20260508
- Application Date
- 20250423
Claims (4)
- 1. The position privacy protection method based on homomorphic encryption is characterized by comprising the following steps: S1, homomorphic encryption is carried out on position data by a client side to obtain ciphertext of a digital matrix; s2, the client transmits the digital matrix ciphertext to the server through the byte stream; S3, the server matches the obtained ciphertext with a matrix in the database; S4, the database sends the result obtained by matching to the client; In the step S1, a character string is defined as a secret key, a public key and a private key are established based on the character string, the client transmits position data and the public key as parameters to a plaintext-ciphertext interface, homomorphic encryption is carried out by using a homomorphic encryption library to encrypt ciphertext of a digital matrix, and an encryption process comprises: Preprocessing the position data, converting the existing floating point number into an integer, and initializing a random number generator and amplification factor; Initializing a module group pointer, and directly storing a real module component value after confusion processing is carried out on a module group by using a random number and amplification factor; Generating a plaintext matrix corresponding to the position index according to the specific message value, encrypting the plaintext matrix, and storing the result in the ciphertext matrix, wherein the position index is a 4-bit number; In the step S2, the client creates a socket according to the set server address and port, connects the socket to the server, uses serialization operation to the ciphertext object in the ciphertext matrix, stores the result in the byte stream, and transmits the result to the server through the byte stream, and the specific flow includes: creating a character array byte stream for storing the serialized data; Converting pointer types by using forced type conversion on the size, the size value, the magnification level, the precision level, the array size and the number of the size object memory in the cipher text, and storing the pointer types into a byte stream; Completing byte stream transmission through socket, and transmitting ciphertext to a server; in the step S3, after receiving the ciphertext data, the server performs an anti-serialization operation on the data, and restores the original value to generate 4×10 ciphertext matrixes according to the scale of each ciphertext serialization length as a preset byte, the database performs data generation with a preset range (0,10000), and performs an operation of matching and encrypting the matrixes in the database with the received ciphertext matrixes, wherein the operation of matching and encrypting comprises the following steps: the blind multiplication operation is realized by carrying out element-by-element multiplication on the values of the two encrypted texts on the modulus base and taking the result under the modulus, and the obtained result is stored in decryption information; And (3) performing matching and encryption operation, and performing parallel computation by using the GPU.
- 2. The homomorphic encryption-based location privacy protection method of claim 1, further comprising: And S5, the client visually displays the matching result.
- 3. A homomorphic encryption based location privacy protection system, wherein the method for protecting location privacy according to any one of claims 1 to 2 is performed when applied, and comprises a client and a server, wherein: The client is used for homomorphic encryption of the position data into a ciphertext of the digital matrix and transmitting the ciphertext of the digital matrix to the server through the streaming; and the server is used for matching the obtained ciphertext with the matrix in the database and sending a matching result to the client.
- 4. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to implement a homomorphic encryption based location privacy protection method as claimed in any one of claims 1 to 2.
Description
Position privacy protection method and system based on homomorphic encryption Technical Field The invention relates to the technical field of data processing, in particular to a position privacy protection method and system based on homomorphic encryption. Background Currently, with the rapid development of information technology and mobile internet, location-Based Services (LBS) are widely used in daily life, such as map navigation, sharing travel, and peripheral search. However, LBS services require users to provide accurate location information, which, while bringing convenience, also causes serious threats to user location privacy. Once the user position information is maliciously collected, revealed or abused, not only the privacy rights of the user can be infringed, but also illegal actions such as tracking, theft and the like can be used, so that potential safety hazards are caused. The traditional position privacy protection methods such as K-anonymity, confusion processing and differential privacy can reduce the risk of privacy disclosure to a certain extent, but the methods have obvious limitations that K-anonymity has poor effect in sparse areas, the differential privacy can introduce noise to influence data precision, and the confusion processing is easy to be broken by reverse analysis. Therefore, how to effectively protect the position information security of the user on the premise of ensuring the practicability of the data is a problem to be solved in the current technical field. Disclosure of Invention In view of the above, the invention provides a homomorphic encryption-based location privacy protection method and system, which can complete data matching and inquiry without exposing user location information, thereby ensuring user privacy security. In order to achieve the above purpose, the technical scheme adopted by the invention is as follows: in a first aspect, the present invention provides a method for protecting position privacy based on homomorphic encryption, the method comprising the steps of: S1, homomorphic encryption is carried out on position data by a client side to obtain ciphertext of a digital matrix; s2, the client transmits the digital matrix ciphertext to the server through the byte stream; S3, the server matches the obtained ciphertext with a matrix in the database; and S4, the database sends the matched result to the client. Further, the method further comprises: And S5, the client visually displays the matching result. Further, in the step S1, a string is defined as a key, a public key and a private key are created based on the key, the client transmits the position data and the public key as parameters to a plaintext-ciphertext interface, and homomorphic encryption is performed to form ciphertext of a digital matrix by using a homomorphic encryption library, wherein the encryption process includes: Preprocessing the position data, converting the existing floating point number into an integer, and initializing a random number generator and amplification factor; Initializing a module group pointer, and directly storing a real module component value after confusion processing is carried out on a module group by using a random number and amplification factor; And generating a plaintext matrix corresponding to the position index according to the specific message value, encrypting, and storing the result in the ciphertext matrix. Further, in S2, the client creates a socket according to the set server address and port, connects the socket to the server, uses serialization operation to the ciphertext object in the ciphertext matrix, stores the result in the byte stream, and transmits the result to the server through the byte stream, and the specific flow includes: creating a character array byte stream for storing the serialized data; Converting pointer types by using forced type conversion on the size, the size value, the magnification level, the precision level, the array size and the number of the size object memory in the cipher text, and storing the pointer types into a byte stream; And completing byte stream transmission through socket, and transmitting the ciphertext to a server. Further, in the step S3, after receiving the ciphertext data, the server performs an anti-serialization operation on the data, and restores the original value to generate a ciphertext matrix according to the scale of each ciphertext serialization length as a preset byte, the database performs data generation within a preset range, and performs an operation of matching and encrypting the matrix in the database with the received ciphertext matrix, wherein the operation of matching and encrypting comprises: If the first line of data is the first line of data, the result secret is directly stored, otherwise, the ciphertext multiplication operation is executed, the blind multiplication operation is realized by carrying out element-by-element multiplication on the values of the two encrypted text