A homomorphic encryption-based location privacy protection method and system

By encrypting location data into a digital matrix ciphertext using homomorphic encryption technology, and then transmitting it via byte stream and performing ciphertext matching calculations, the limitations of existing technologies in location privacy protection are overcome, enabling secure and efficient location information querying, and improving both user privacy protection and computational efficiency.

CN120433975BActive Publication Date: 2026-05-08BEIJING ELECTRONICS SCI & TECH INST
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ELECTRONICS SCI & TECH INST
Filing Date
2025-04-23
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing technologies for protecting user location privacy have limitations such as poor performance of K-anonymity in sparse areas, noise introduced by differential privacy affecting data accuracy, and the ease with which obfuscation can be reverse-analyzed. These limitations make it difficult to effectively protect the security of user location information while ensuring the usability of the data.

Method used

Homomorphic encryption technology is used to encrypt location data into ciphertext of a digital matrix. This ciphertext is transmitted to the server via a byte stream for matching and calculation. Matrix operations are then performed on the ciphertext, and GPU parallel computing is used to improve efficiency, ensuring that user location information is not exposed.

Benefits of technology

It enables data matching and querying without disclosing user location information, ensuring user privacy and security, improving data security and computing efficiency, avoiding the limitations of traditional methods, and is applicable to various location privacy protection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120433975B_ABST
    Figure CN120433975B_ABST
Patent Text Reader

Abstract

The application discloses a kind of location privacy protection method and system based on homomorphic encryption, belong to data processing technical field;The method in which client carries out homomorphic encryption for location data as digital matrix ciphertext;Digital matrix ciphertext is passed to server by byte stream;The ciphertext obtained by server is matched with matrix in database;The result matched by database is sent to client.The application combines data information with homomorphic encryption, adopts the mode of matrix, directly calculates and matches on encrypted data without decrypting data, can securely compare and does not disclose any information, fully protects the privacy information of client and server, achieves that private data is available and invisible;Server does not need to contact plaintext data, greatly improves the security of user location privacy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically to a location privacy protection method and system based on homomorphic encryption. Background Technology

[0002] Currently, with the rapid development of information technology and the mobile internet, location-based services (LBS) are widely used in daily life, such as map navigation, ride-sharing, and nearby search. However, LBS services require users to provide accurate location information, which, while bringing convenience, also poses a serious threat to user location privacy. Once user location information is maliciously collected, leaked, or misused, it will not only infringe on users' privacy rights but may also be used for illegal activities such as tracking and theft, creating security risks. Traditional location privacy protection methods such as K-anonymity, obfuscation, and differential privacy can reduce the risk of privacy leakage to some extent, but these methods have obvious limitations: K-anonymity is not effective in sparse areas, differential privacy introduces noise that affects data accuracy, and obfuscation is easily cracked by reverse engineering.

[0003] Therefore, how to effectively protect users' location information security while ensuring the usability of the data is an urgent problem to be solved in the current technology field. Summary of the Invention

[0004] In view of this, the present invention provides a location privacy protection method and system based on homomorphic encryption. The present invention can complete data matching and query without exposing user location information, thus ensuring user privacy and security.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention provides a location privacy protection method based on homomorphic encryption, the method comprising the following steps:

[0007] S1. The client homomorphically encrypts the location data into ciphertext of a digital matrix;

[0008] S2. The client transmits the encrypted digital matrix to the server via a byte stream;

[0009] S3. The server matches the obtained ciphertext with the matrix in the database;

[0010] S4. The database sends the matching results to the client.

[0011] Furthermore, the method also includes:

[0012] S5. The client will visualize the matching results.

[0013] Furthermore, in step S1, a string is first defined as the key, and a public and private key are created based on this. The client sends the location data and the public key as parameters to the plaintext-to-ciphertext interface, and uses a homomorphic encryption library to perform homomorphic encryption into ciphertext of a digital matrix. The encryption process includes:

[0014] The location data is preprocessed by converting existing floating-point numbers into integers and initializing the random number generator and magnification.

[0015] Initialize the module base array pointer, and after obfuscating the module base array with random numbers and amplification factor, directly store the actual module component values;

[0016] Based on the specific message value, a plaintext matrix with the corresponding position index is generated and encrypted, and the result is stored in the ciphertext matrix.

[0017] Furthermore, in step S2, the client creates a socket connection to the server based on the set server address and port, serializes the ciphertext objects in the ciphertext matrix, stores the result in a byte stream, and transmits it to the server via the byte stream. The specific process includes:

[0018] Create a character array byte stream to store the serialized data;

[0019] The memory size, sid value, magnification order, precision order, array size, and array value of the sid object in the ciphertext are all converted to pointer types using explicit type casting, and then stored in a byte stream;

[0020] The byte stream is transmitted via socket, and the encrypted text is sent to the server.

[0021] Furthermore, in step S3, after receiving the ciphertext data, the server performs deserialization on the data, restoring the original values ​​to generate a ciphertext matrix according to a preset serialization length for each ciphertext; the database generates data within a preset range, and matches and encrypts the matrix in the database with the received ciphertext matrix; wherein the matching and encryption operation includes:

[0022] If it is the first line of data, it is directly stored in the ciphertext of the result; otherwise, the ciphertext multiplication operation is performed. This is done by multiplying the values ​​of the two encrypted texts element by element in the modulus base and taking the result in the modulus base, thus achieving blind multiplication. The result is then stored in the decrypted information.

[0023] Furthermore, GPUs are used for parallel computing when performing matching and encryption operations.

[0024] Secondly, the present invention also provides a location privacy protection system based on homomorphic encryption, applied to the aforementioned location privacy protection method based on homomorphic encryption. The system includes: a client and a server, wherein:

[0025] The client is used to homomorphically encrypt location data into ciphertext of a digital matrix and transmit the ciphertext of the digital matrix to the server via a byte stream;

[0026] The server is used to match the obtained ciphertext with a matrix in the database and send the matching result to the client.

[0027] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the aforementioned location privacy protection method based on homomorphic encryption.

[0028] As can be seen from the above technical solutions, the present invention provides a location privacy protection method and system based on homomorphic encryption. Compared with the prior art, the present invention has at least the following beneficial effects:

[0029] 1. This invention can complete data matching and querying without exposing user location information, ensuring user privacy and security.

[0030] 2. This invention provides a new solution for location privacy protection; by combining data information with homomorphic encryption and using a matrix approach, calculations and matching are performed directly on the encrypted data without decryption, enabling secure comparisons without leaking any information, fully protecting the privacy of both the client and server, and ensuring that privacy data is usable but not visible; the server does not need to access plaintext data, greatly improving the security of user data.

[0031] 3. In the database blind multiplication operation, this invention performs ciphertext matching operation on all matrices and uses matrix multiplication to ensure the reliability and ease of use of the output results.

[0032] 4. This invention utilizes GPU parallel computing for matrix multiplication and ciphertext operations, enabling the simultaneous processing of large amounts of data and significantly improving efficiency by performing simultaneous operations on multiple matrices or ciphertexts, thereby greatly enhancing server operating efficiency. Furthermore, the combination of efficient retrieval algorithms and ciphertext matching mechanisms facilitates secure and accurate location information query services while maintaining computational efficiency.

[0033] 5. This invention uses a homomorphic encryption scheme to securely calculate location information. It is easy to use and promote, and can be applied to various location privacy protections, with continuous expansion of system functions.

[0034] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0035] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0038] Figure 1 This is a flowchart illustrating a location privacy protection method based on homomorphic encryption, provided as an embodiment of the present invention.

[0039] Figure 2 This is a schematic diagram of the electronic device structure provided in an embodiment of the present invention. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0041] In the description of this invention, it should be noted that some processes described in this application specification and drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may be performed in any order or in parallel. Furthermore, various numbers are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0042] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0043] See Figure 1 As shown, this embodiment of the invention provides a location privacy protection method based on homomorphic encryption, which mainly includes the following steps:

[0044] S1. The client homomorphically encrypts the current location into ciphertext of a digital matrix;

[0045] S2. The client transmits the encrypted digital matrix to the server via a byte stream;

[0046] S3. The server matches the obtained ciphertext with the matrix in the database;

[0047] S4. The database sends the matching results to the client.

[0048] In one specific implementation, the method further includes:

[0049] S5. The client will visualize the matching results.

[0050] Overall, this invention focuses on the privacy of location information. Therefore, it does not describe specific encryption and decryption algorithms, but rather on data security technologies for each step of the matching process between the client and server. Thus, the solution emphasizes matrix matching of the encrypted location information with all stored data to ensure the output of valid information without disclosing the user's location.

[0051] The specific implementation of the method of the present invention will be described in detail below:

[0052] S1. The client homomorphically encrypts the current location into a ciphertext of a digital matrix; specifically including:

[0053] The user predefines a string as a key and creates public and private keys based on it. The client passes the user's input data and the public key as parameters to the ConvertToCipherText (plaintext to ciphertext) interface, which uses a homomorphic encryption library for encryption. Specifically, the input data is first preprocessed by multiplying it by 10^6 to convert any floating-point numbers into integers, facilitating subsequent modulo operations, and the random number generator and amplification factor are initialized. Secondly, the modulo radix pointer is initialized, and the modulo radix array is obfuscated using random numbers and the amplification factor before directly storing the actual modulo values. Finally, based on the specific message value, a plaintext matrix with the corresponding index is generated, encrypted, and the result is stored in cipherMatrix (ciphertext matrix). For example, if the input is 0512, the plaintext matrix corresponding to cipherMatrix is:

[0054]

[0055] S2. The client transmits the encrypted digital matrix to the server via a byte stream; this includes the following steps:

[0056] The client creates a socket interface to connect to the server based on the pre-defined server address and port. It then uses the `serialize` operation on the `Ciphertext` object in the `cipherMatrix` to store the result in a byte stream. `serialize()` is a member function of the `CipherText` class. Specifically, it first creates a character array byte stream to store the serialized data. Then, it uses `reinterpret_cast` to convert the memory size, `sid` value, `order` (magnification factor), `level` (precision level), array size, and array values ​​of the `sid` (timestamp) object in `Ciphertext` to pointer types and stores them in the byte stream. Finally, the socket handles the byte stream transmission. The `socket` function creates a socket, specifies the IPv4 protocol and stream socket, uses the TCP protocol for data transmission, stores the server address information, specifies the host and port number, and attempts to establish a data connection using `connect`.

[0057] S3. The server matches the obtained ciphertext with the matrix in the database; this includes the following steps:

[0058] After receiving the data, the server performs a deserialization operation, restoring the original values ​​according to the 1564-byte serialization length of each Ciphertext, thus generating a 4*10 cipherMatrix. The database generates data in the range (0, 10000) and initializes a timer to evaluate the performance of database retrieval. The data records in the database are then compared with the received cipherMatrix records using a matchAndEncrypt operation. Specifically, if it is the first row of data, due to the special nature of matrix multiplication, it can be directly stored in resultCipher. Otherwise, a BlindMul operation is performed. This is achieved by performing element-wise multiplication of the two encrypted texts on the modulo basis and taking the result modulo. The result obtained from matchAndEncrypt is stored in resultinfo, which is the result to be sent to the client.

[0059] S4. The database sends the matching results to the client:

[0060] Since the obtained resultinfo data is itself a string type, there is no need to perform serialization operations; it can be directly handed over to the socket for forwarding.

[0061] S5. The client displays the matching results visually:

[0062] The client initializes a byte stream to receive data, uses the public key to decrypt the matching results, and then converts the results into a character type for output.

[0063] As described in the above embodiments, those skilled in the art will understand that this invention proposes a location privacy protection method based on homomorphic encryption, aiming to resolve the contradiction between privacy protection and data usability in existing technologies. This invention directly encrypts and calculates location information using fully homomorphic encryption, without relying on virtual user groups, achieving efficient privacy protection even in sparse areas. It avoids the data accuracy degradation problem caused by noise introduction in traditional methods, ensuring data integrity and usability. Simultaneously, by utilizing the irreversibility of fully homomorphic encryption, the possibility of reverse analysis is fundamentally eliminated, enhancing security. Furthermore, by optimizing the encryption and calculation process, this invention balances real-time performance and scalability, meeting the high-efficiency requirements of large-scale application scenarios, and possesses broad applicability and superior performance.

[0064] Furthermore, this embodiment of the invention also provides a location privacy protection system based on homomorphic encryption, applied to the location privacy protection method based on homomorphic encryption described in the above embodiments, for location privacy protection. The system includes: a client and a server, wherein:

[0065] The client is used to homomorphically encrypt location data into ciphertext of a digital matrix and transmit the ciphertext of the digital matrix to the server via a byte stream;

[0066] The server is used to match the obtained ciphertext with a matrix in the database and send the matching result to the client.

[0067] In this system, a 4-digit number is input. The client converts the number into an encrypted matrix using `convertToCipherText`, serializes the encrypted matrix into a byte sequence, and transmits it via TCP using a socket. The server receives the encrypted matrix as a byte stream, deserializes it, performs a blind multiplication matching operation with the database, and sends the result `resultlnfo` to the client. The client receives the result and outputs it.

[0068] The location privacy protection system based on homomorphic encryption provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the aforementioned method embodiment, and will not be repeated here.

[0069] Furthermore, refer to Figure 2 As shown, this embodiment of the invention also provides an electronic device that can execute the above-described methods and systems for location privacy protection. The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10.

[0070] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 and calls data stored in the memory 11 to perform various functions of the electronic device and process data.

[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, devices, or computer program products, etc. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] It should be noted that the word "comprising" does not exclude the presence of components or steps not listed in the claims. The words "a" or "an" preceding a component do not exclude the presence of a plurality of such components. This invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer.

[0073] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0074] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A location privacy protection method based on homomorphic encryption, characterized in that, The method includes the following steps: S1. The client homomorphically encrypts the location data into ciphertext of a digital matrix; S2. The client transmits the encrypted digital matrix to the server via a byte stream; S3. The server matches the obtained ciphertext with the matrix in the database; S4. The database sends the matching results to the client; In step S1, a string is first defined as the key, and a public and private key are created based on this. The client sends the location data and the public key as parameters to the plaintext-to-ciphertext interface, and uses a homomorphic encryption library to perform homomorphic encryption into ciphertext of a digital matrix. The encryption process includes: The location data is preprocessed by converting existing floating-point numbers into integers and initializing the random number generator and magnification. Initialize the module base array pointer, and after obfuscating the module base array with random numbers and amplification factor, directly store the actual module component values; Based on the specific message value, a plaintext matrix with the corresponding position index is generated and encrypted, and the result is stored in the ciphertext matrix; the position index is a 4-digit number. In step S2, the client creates a socket connection to the server based on the set server address and port, serializes the ciphertext objects in the ciphertext matrix, stores the result in a byte stream, and transmits it to the server via the byte stream. The specific process includes: Create a character array byte stream to store the serialized data; The memory size, sid value, magnification order, precision order, array size, and array value of the sid object in the ciphertext are all converted to pointer types using explicit type casting, and then stored in a byte stream; Transmit byte streams via sockets to send encrypted data to the server. In step S3, after receiving the ciphertext data, the server performs deserialization on the data, restoring the original value to generate a 4*10 ciphertext matrix according to a preset serialization length of each ciphertext; the database generates data within a preset range of (0, 10000), and matches and encrypts the matrix in the database with the received ciphertext matrix; the matching and encryption operation includes: Blind multiplication is achieved by performing element-wise multiplication of the values ​​of two encrypted texts on the modulus basis and taking the result under the modulus. The result is then stored in the decrypted information. When performing matching and encryption operations, GPUs are used for parallel computing.

2. The location privacy protection method based on homomorphic encryption according to claim 1, characterized in that, The method also includes: S5. The client will visualize the matching results.

3. A location privacy protection system based on homomorphic encryption, characterized in that, When applied, a location privacy protection method based on homomorphic encryption as described in any one of claims 1 to 2 is executed. The system comprises: a client and a server, wherein: The client is used to homomorphically encrypt location data into ciphertext of a digital matrix and transmit the ciphertext of the digital matrix to the server via a byte stream; The server is used to match the obtained ciphertext with a matrix in the database and send the matching result to the client.

4. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement a location privacy protection method based on homomorphic encryption as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Fully homomorphic encryption method supporting floating-point number operation in cloud computing environment

    CN115801224A

  • Location data protection method and system based on searchable encryption

    CN118643538A

  • Encrypted data query processing method and electronic device

    CN119759953A