Homomorphic encryption string exact match method applied to cloud computing applications
By building a collaborative processing framework in a cloud computing application and using homomorphic encryption algorithms, data is divided into multinomial parallel operations, which solves the problems of high latency and low storage efficiency in existing homomorphic encryption string matching methods, and realizes efficient and secure string matching operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-03-24
AI Technical Summary
Existing homomorphic encryption string matching methods suffer from high computational latency, data transmission bottlenecks, low storage efficiency, and a trade-off between security and efficiency, making it difficult to perform string matching operations efficiently while protecting data privacy.
A collaborative processing framework is constructed, which utilizes SSD storage units and homomorphic encryption algorithms to divide database data into multiple data blocks and map them to data polynomials for encryption. The client constructs a query polynomial and performs coefficient-level parallel operations, and achieves matching through homomorphic addition. The matching result is transmitted and decrypted in an encrypted state.
It significantly reduces memory usage for data storage and transmission, improves processing efficiency, ensures data security, enhances computing performance through parallel operations, optimizes internal data flow and computing logic of the SSD, and achieves efficient string matching.
Smart Images

Figure CN121071196B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and more specifically, to a method for precise matching of homomorphic encrypted strings applied to cloud computing applications. Background Technology
[0002] With the rapid development of cloud computing technology, more and more enterprises and individuals are storing sensitive data in the cloud. This data includes, but is not limited to, DNA sequences, biometric information, medical records, and financial data. In many application scenarios, such as DNA sequence matching, biometric identification, and database queries, precise string matching operations are required on this encrypted data.
[0003] Homomorphic encryption (HE) technology allows computation to be performed directly on encrypted data without decryption, which is of great significance for protecting data privacy. However, existing homomorphic encryption string matching methods have the following technical problems:
[0004] (1) High computational latency: Homomorphic encryption operations are usually several orders of magnitude slower than traditional computation operations, resulting in slow processing speed.
[0005] (2) Data transmission bottleneck: The amount of encrypted data is often much larger than the original data, which increases the time and cost of data transmission.
[0006] (3) Low storage efficiency: Existing encrypted data storage methods do not make full use of the characteristics of storage devices, resulting in low storage efficiency.
[0007] (4) Balancing security and efficiency: How to improve the efficiency of matching operations while ensuring data security is an urgent problem to be solved. Summary of the Invention
[0008] The purpose of this invention is to propose a method for precise matching of homomorphic encrypted strings applied to cloud computing applications, so as to achieve efficient and fast string matching operations while protecting data privacy.
[0009] To achieve the above objectives, this invention proposes a method for precise matching of homomorphic encrypted strings applied to cloud computing applications, comprising:
[0010] A collaborative processing framework is constructed, which includes a client and servers and SSD storage units located in a cloud data center;
[0011] The server divides the original binary string of data from the database into multiple data blocks of a set length, packages them into a data block sequence, maps the data block sequence into a data polynomial, where each data block is the coefficient of a term in the data polynomial, encrypts the data polynomial using a homomorphic encryption algorithm to obtain the data polynomial ciphertext, and writes the data polynomial ciphertext into the SSD storage unit.
[0012] The client inverts each element of the input query string to obtain the inverted query string, fills the coefficients of the polynomial structure with the inverted query string to construct the query polynomial, encrypts the query polynomial using a homomorphic encryption algorithm to obtain the query polynomial ciphertext, and uploads it to the server.
[0013] The server performs homomorphic addition operations on the encrypted coefficients of the data polynomial ciphertext and the query polynomial ciphertext in parallel at the coefficient level. The addition result of each encrypted coefficient is compared with the corresponding coefficient in the predefined and encrypted matching polynomial. If any coefficient matches, the matching position index of the corresponding data block is generated and the matching position index is encrypted and fed back to the client.
[0014] The client uses its private key to decrypt the matching position index.
[0015] Optionally, the data polynomial, the query polynomial, and the matching polynomial have the same structure;
[0016] The length of each data block after the original binary string of the database is 16 bits. The bit width of each coefficient in the data polynomial, the query polynomial and the matching polynomial is 16 bits. The maximum degree of the data polynomial, the query polynomial and the matching polynomial is the same.
[0017] Optionally, the SSD storage unit is configured with a dedicated storage area, and the data polynomial ciphertext is stored in the dedicated storage area;
[0018] The dedicated storage area adopts a bit-line-first vertical layout and a single-cell storage mode.
[0019] Optionally, the homomorphic encryption algorithm is the BFV homomorphic encryption algorithm.
[0020] Optionally, the raw binary string of data from the database is divided into multiple data blocks of a set length, including:
[0021] The binary string is divided into multiple block sequences by a fixed length of 16 bits. When the last data block is less than 16 bits, it is padded with 0s to make it 16 bits.
[0022] Pack multiple data blocks to form a data block sequence:
[0023] ;
[0024] in, A vector representing a sequence of packed data blocks; T (i) This represents the i-th data block, where i is the block index (i=0,1,...,[k / t]−1), k is the original data length, and t is the coefficient bit width, corresponding to the data block length (t=16).
[0025] Optionally, mapping the data block sequence to a data polynomial includes:
[0026] If the block sequence length L is less than or equal to the polynomial degree n, then construct a data polynomial:
[0027]
[0028] in, For the data polynomial, m i x is the i-th element in m(T), corresponding to the i-th encryption coefficient value; i Let i be the variable term of the polynomial, and i be the exponent, 0 ≤ i ≤ n−1;
[0029] If the block sequence length L is greater than the polynomial degree n, then divide into multiple polynomials:
[0030] The expression for the data polynomial is:
[0031] ,
[0032] in, Let be the j-th data polynomial; n is the polynomial degree, n=1024; x is the polynomial encryption coefficient value, corresponding to an element in the block sequence; j is the polynomial index, j=0,1,...,[L / n]−1, L is the block sequence length, L=[k / t]; i Let i be the variable term of the polynomial, i be the exponent, 0 ≤ i ≤ n−1, and t be the bit width of the coefficients, corresponding to the length of the data block.
[0033] Optionally, the negated query string is filled into the coefficients of the polynomial, including:
[0034] When the length of the query string is equal to the width t of the polynomial coefficients, the query string, after being inverted bit by bit, is repeatedly filled into each coefficient of the polynomial structure.
[0035] When the length of the query string is greater than the width t of the polynomial coefficients, the query string after bit-by-bit inversion is divided into multiple 16-bit data blocks, and the multiple data blocks are filled into each coefficient of the polynomial structure in a cyclic filling manner.
[0036] When the length of the query string is less than the bit width of the polynomial coefficients, the end of the query string after bitwise inversion is padded with 0s to 16 bits, and then this string is repeatedly padded to each coefficient of the polynomial structure;
[0037] The expression of the query polynomial is:
[0038] ;
[0039] Where, represents the query polynomial; represents the padding value of the i-th encrypted coefficient; x i is the variable term of the polynomial, 0 ≤ i < n - 1; n is the polynomial degree, n = 1024.
[0040] Optionally, the expression of the matching polynomial is: 1. Employing a memory-efficient polynomial packing method: The binary string is divided into small segments (16 bits each), and these segments are then packed into a polynomial, resulting in encrypted data that is only 4 times larger than the original data. Compared to existing methods, this significantly reduces memory usage and improves data transmission and storage efficiency.
[0051] 2. Use only homomorphic addition: String matching is achieved through homomorphic addition, avoiding complex homomorphic multiplication or rotation operations.
[0052] 3. A mechanism for implementing bit string addition within an SSD storage unit (within a NAND flash memory chip) was designed, utilizing the array-level and bit-level parallelism of flash memory to accelerate the matching process and improve processing efficiency.
[0053] 4. Throughout the matching process, the data remains encrypted, and only the client possesses the decryption private key, ensuring the security of the data during transmission and storage.
[0054] 5. Integrating the matching algorithm into the SSD enables server-side software to efficiently call the matching function within the SSD. By optimizing the data flow and computational logic within the SSD, the system's performance and energy efficiency are improved.
[0055] The system of the present invention has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0056] The above and other objects, features and advantages of the present invention will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.
[0057] Figure 1 A flowchart illustrating the steps of a method for precise matching of homomorphic encrypted strings applied to cloud computing applications according to the present invention is shown. Detailed Implementation
[0058] The invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0059] According to the present invention, a method for precise matching of homomorphic encrypted strings applied to cloud computing applications includes:
[0060] S1: Construct a collaborative processing framework, which includes a client and servers and SSD storage units located in a cloud data center;
[0061] Specifically, the SSD storage unit is configured with a dedicated storage area, the storage layout of the dedicated storage area adopts a bit-line priority vertical layout, and the storage mode of the dedicated storage area adopts a single-layer cell (SLC) mode.
[0062] S2: The server divides the original binary string of data in the database into multiple data blocks of a set length, packages them into a data block sequence, maps the data block sequence into a data polynomial, where each data block is the coefficient of a term in the data polynomial, encrypts the data polynomial using a homomorphic encryption algorithm to obtain the data polynomial ciphertext, and writes the data polynomial ciphertext into the SSD storage unit.
[0063] Specifically, the homomorphic encryption algorithm is the BFV homomorphic encryption algorithm. The ciphertext of the data polynomial is stored in a dedicated storage area. In this embodiment, the length of each data block after the original binary string of the database data is 16 bits, the bit width of each coefficient in the data polynomial, query polynomial, and matching polynomial is 16 bits, and the maximum degree of the data polynomial, query polynomial, and matching polynomial is the same.
[0064] In this step, the raw binary string of data from the database is divided into multiple data blocks of a set length, including:
[0065] The binary string is divided into multiple block sequences by a fixed length of 16 bits. When the last data block is less than 16 bits, it is padded with 0s to make it 16 bits.
[0066] Pack multiple data blocks to form a data block sequence:
[0067] ;
[0068] in, A vector representing a sequence of packed data blocks; T (i) This represents the i-th data block, where i is the block index (i=0,1,...,[k / t]−1), k is the original data length, and t is the coefficient bit width, corresponding to the data block length (t=16).
[0069] Mapping a sequence of data blocks to a data polynomial includes:
[0070] If the block sequence length L is less than or equal to the polynomial degree n, then construct a data polynomial:
[0071]
[0072] in, For the data polynomial, m i x is the i-th element in m(T), corresponding to the i-th encryption coefficient value; i Let i be the variable term of the polynomial, and i be the exponent, 0 ≤ i ≤ n−1;
[0073] If the block sequence length L is greater than the polynomial degree n, then divide into multiple polynomials:
[0074] The expression for the data polynomial is:
[0075] ,
[0076] in, Let be the j-th data polynomial; n is the polynomial degree, n=1024; x is the polynomial encryption coefficient value, corresponding to an element in the block sequence; j is the polynomial index, j=0,1,..., [L / n]−1, L is the block sequence length, L=[k / t]; i Let i be the variable term of the polynomial, i be the exponent, 0 ≤ i ≤ n−1, and t be the bit width of the coefficients, corresponding to the length of the data block.
[0077] S3: The client inverts each bit of the input query string to obtain the inverted query string, fills the coefficients of the polynomial structure with the inverted query string to construct the query polynomial, encrypts the query polynomial using a homomorphic encryption algorithm to obtain the query polynomial ciphertext, and uploads it to the server.
[0078] In this step, the negated query string is filled into the coefficients of the polynomial, including:
[0079] When the length of the query string is equal to the width t of the polynomial coefficients, the query string, after being inverted bit by bit, is repeatedly filled into each coefficient of the polynomial structure.
[0080] When the length of the query string is greater than the width t of the polynomial coefficients, the query string after bit-by-bit inversion is divided into multiple 16-bit data blocks, and the multiple data blocks are filled into each coefficient of the polynomial structure in a cyclic filling manner.
[0081] When the length of the query string is less than the width of the polynomial coefficients, the end of the query string after inverting each bit is padded with 0 to 16 bits, and then the string is repeated to padded each coefficient of the polynomial structure.
[0082] The expression for the query polynomial is:
[0083] ,
[0084] in, Represents the query polynomial; Denote the padding value of the i-th encryption coefficient; x i is the variable term of the polynomial, 0 ≤ i < n - 1; n is the polynomial degree, n = 1024.
[0085] In this embodiment, when using the homomorphic encryption algorithm to encrypt the data polynomial and the query polynomial in steps S2 and S3, the public key provided by the server is used for encryption.
[0086] S4: The server performs a homomorphic addition operation of coefficient-level parallel operation on each encrypted coefficient of the data polynomial ciphertext and the query polynomial ciphertext, compares the addition result of each encrypted coefficient with the corresponding coefficient in the predefined and encrypted matching polynomial. If any coefficient matches, generates the matching position index of the corresponding data block, and encrypts and feeds back the matching position index to the client;
[0087] In this step, the expression of the matching polynomial is:
[0088]
[0089] Where is the matching polynomial; 2t - 1 represents the numerical encoding of the all-1 string; t is the coefficient bit width, t = 16; x i is the variable term of the polynomial; i is the exponent, 0 ≤ i ≤ n - 1, n is the polynomial degree.
[0090] Performing a homomorphic addition operation of coefficient-level parallel operation on each encrypted coefficient of the data polynomial ciphertext and the query polynomial ciphertext, and comparing the addition result of each encrypted coefficient with the corresponding coefficient of the predefined and encrypted matching polynomial includes:
[0091] Execute in the dedicated storage area:
[0092] Add each encrypted coefficient of the data polynomial and the corresponding encrypted coefficient of the query polynomial bit by bit separately, and output the addition result corresponding to each coefficient;
[0093] Compare the addition result of each coefficient with the corresponding coefficient in the matching polynomial. If any coefficient matches, generate the matching position index i of the corresponding data block.
[0094] S5: The client decrypts the matching position index using the private key corresponding to the public key to obtain the matching position of the original data.
[0095] The technical solution of the present invention will be further explained and illustrated through a specific example below.
[0096] This invention provides a method for precise matching of homomorphic encrypted strings applied to cloud computing applications. This method is designed based on the homomorphic encryption (HE) framework, particularly the BFV (Brakerski-Fan-Vercauteren) scheme. The core principle is:
[0097] Data Packaging Optimization: The binary string is split and packed into polynomial coefficients, reducing the memory footprint of the encrypted data. Traditional arithmetic methods pack single bits, resulting in high storage overhead; this method packs multiple bits (e.g., 16 bits) into a polynomial coefficient, significantly reducing memory growth (from 64 times to 4 times).
[0098] Homomorphic addition is used only: String matching is achieved through homomorphic addition, avoiding complex homomorphic multiplication or rotation operations. This is done by negating the lookup (~Q) and adding it to the input data. If a match is found, the result is a string of all 1s, which is then computed in the encrypted domain using homomorphic addition.
[0099] Parallel processing: Through structured polynomial design, it supports SIMD (Single Instruction Multiple Data) parallelism, which can process multiple string matching operations within the same polynomial.
[0100] Overall effect: Reduces computational latency and data movement, improves performance and energy efficiency, and is suitable for privacy-sensitive applications (such as DNA sequence matching and encrypted database search).
[0101] The data processing flow, from raw data input to encrypted matching result output, is as follows: Data preparation (segmentation and packaging) → Polynomial construction → Encryption → Homomorphic addition → Index generation. The following is a detailed step-by-step explanation:
[0102] 1. Memory-efficient data packaging solution
[0103] Step 1: Binary string splitting
[0104] Input: Binary string P=(b0,b1,…,bk−1), length k (bits).
[0105] Processing: The string is split into non-overlapping chunks of size t. The default value for t is 16 bits (based on the HE parameter). If k is not divisible by t, the last chunk is padded with zeros.
[0106] For example, the first block of P: T(0) = (b0, b1, ..., b15).
[0107] The second block: T(1) = (b16, b17, ..., b31), and so on.
[0108] The purpose of this step is to reduce data granularity, making it easier to efficiently pack into polynomial coefficients and avoid the high memory overhead caused by bit-by-bit encryption.
[0109] Effect: Reduces the size of encrypted data, memory usage by 16 times (compared to traditional arithmetic methods), from 64 times to only 4 times (encrypted data size is approximately 4 times the original data).
[0110] Data processing flow: Raw binary string → divided into t-bit blocks → forming a block sequence.
[0111] Step 2: Constructing Packed Messages
[0112] Input: The segmented block sequence T(0), T(1), ..., T(m), where m = ⌊k / t⌋.
[0113] Processing: Construct a packaged message m(T), defined as a block sequence: m(T) = (T(0), T(1), ..., T(⌊tk⌋)).
[0114] m(T) is a vector, where each element is a t-bit block.
[0115] The general purpose is to organize block sequences into a linear structure, making them easier to convert into polynomials.
[0116] Effect: Simplifies subsequent polynomial representation and supports efficient coding.
[0117] Data processing flow: block sequence → combined into vector m(T).
[0118] Step 3: Polynomial Representation
[0119] Input: Packed message m(T), containing L elements (L=⌈k / t⌉).
[0120] Processing: Convert m(T) into one or more plaintext polynomials. The maximum degree of each polynomial is n (default n=1024):
[0121] If L≤n, then construct a single polynomial:
[0122]
[0123] Where mi is the i-th element of m(T) (i.e., a t-bit block).
[0124] If L>n, then divide into multiple polynomials:
[0125]
[0126] Each polynomial It contains n coefficients.
[0127] Purpose of this step: Adapt to the ring structure of HE (R = Zq[X] / (Xn+1)), support parallel encryption and computation.
[0128] Effect: Make full use of the parallelism of polynomial degree n, reduce the number of required polynomials, and thus reduce the encryption latency.
[0129] Data processing flow: Vector m(T) → Map to polynomial coefficients → Generate one or more polynomials .
[0130] Step 4: Encrypt the polynomial
[0131] Input: Plaintext polynomial .
[0132] Processing: Use the public key pk to encrypt each polynomial: After encryption, each ciphertext is a tuple (C0, C1), where each coefficient is q bits in size (default q = 32).
[0133] Purpose of this step: Protect data privacy in the encrypted domain while maintaining computability.
[0134] Effect: The size of the ciphertext is about 4 times that of the plaintext (due to coefficient expansion and tuple structure), significantly better than the 64-fold increase of traditional methods.
[0135] Data processing flow: Plaintext polynomial → BFV encryption → Output ciphertext polynomial.
[0136] 2. Secure string matching algorithm
[0137] Step 1: Query preparation (client)
[0138] Input: Query string Q (y bits in length).
[0139] Processing:
[0140] Invert the query: Generate Q′ = ∼Q (bitwise inversion). The purpose is to construct the matching condition ∼Q + d = 111...1 and transform the matching problem into an addition problem.
[0141] Duplicate the query: If y / t < n, duplicate Q′ to fill the polynomial coefficients, ensuring that each coefficient contains the same query pattern (support parallel matching).
[0142] For example, construct the polynomial , where all are the same.
[0143] Left shift variant: To detect all possible alignment positions and ensure that a match at any position can be detected, multiple left shift query polynomials P1(x), P2(x), ..., Ps(x) are generated (where s is the number of shifts).
[0144] The purpose of this step is to adapt the query to a polynomial structure and process multiple matching positions at once through copying. This maximizes parallel processing capabilities, improves parallelism, reduces the computational overhead of each query, and allows for the checking of 1024 matching positions in a single operation.
[0145] Data processing flow: Original query Q → Invert ~Q → Copy and fill → Construct query polynomial P(Q′) → Generate shift variant.
[0146] Step 2: Encrypted Query
[0147] Input: Query polynomial P(Q′).
[0148] Processing: Encrypt using the same public key (PK): 'u' represents a user (client) query, in encrypted form as follows: .
[0149] The purpose of this step is to protect query privacy within an encrypted domain. It ensures the server cannot decrypt the query while supporting homomorphic operations.
[0150] Data processing flow: Query polynomial → BFV encryption → Output encrypted query.
[0151] Step 3: Homomorphic addition (server)
[0152] Input: Encrypted database data (From data packaging) and encrypted queries .
[0153] Process: Perform a homomorphic addition operation:
[0154]
[0155] in:
[0156] Encrypted database polynomial;
[0157] Encrypted query polynomial;
[0158] Hom-Add is a coefficient-level addition (each coefficient is added independently), and the output is ciphertext.
[0159] When the plaintext value corresponding to a certain coefficient of Cresult is 2t−1 (i.e., a string of all 1s, which is 65535 when t=16), it means that the position matches.
[0160] The purpose of this step is to calculate the sum of ~Q and the data in the database; if they match, the result corresponds to the encrypted value 65535, a string of all ones. This avoids the latency caused by traditional homomorphic multiplication and significantly reduces computational delay.
[0161] Data processing flow: Encrypted database + encrypted query → Homomorphic addition → Output ciphertext result.
[0162] Step 4: Index Generation
[0163] Input: The result of homomorphic addition, Cresult.
[0164] Processing: Compare the result with the "matching polynomial" Pv(x) (the encrypted representation of the string of all 1s).
[0165] Definition of a matching polynomial: .
[0166] If any coefficient matches Pv(x), a matching position index is generated (e.g., an index of polynomial coefficients).
[0167] Indexing is performed in the SSD controller using a comparison algorithm.
[0168] Objective: To identify matching locations and return them to the user. This achieves precise string location and supports privacy protection.
[0169] Data processing flow: Result ciphertext → Compare matching polynomials → Output matching index.
[0170] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A method for precise matching of homomorphic encrypted strings applied to cloud computing applications, characterized in that, include: A collaborative processing framework is constructed, which includes a client and servers and SSD storage units located in a cloud data center; The server divides the original binary string of data from the database into multiple data blocks of a set length, packages them into a data block sequence, maps the data block sequence into a data polynomial, where each data block is the coefficient of a term in the data polynomial, encrypts the data polynomial using a homomorphic encryption algorithm to obtain the data polynomial ciphertext, and writes the data polynomial ciphertext into the SSD storage unit. The SSD storage unit is configured with a dedicated storage area, and the data polynomial ciphertext is stored in the dedicated storage area; the storage layout of the dedicated storage area adopts a bit-line priority vertical layout, and the storage mode of the dedicated storage area adopts a single-level cell (SLC) mode. The client inverts each element of the input query string to obtain the inverted query string, fills the coefficients of the polynomial structure with the inverted query string to construct the query polynomial, encrypts the query polynomial using a homomorphic encryption algorithm to obtain the query polynomial ciphertext, and uploads it to the server. The server performs homomorphic addition operations on the encrypted coefficients of the data polynomial ciphertext and the query polynomial ciphertext in parallel at the coefficient level. The addition result of each encrypted coefficient is compared with the corresponding coefficient in the predefined and encrypted matching polynomial. If any coefficient matches, the matching position index of the corresponding data block is generated and the matching position index is encrypted and fed back to the client. The client uses its private key to decrypt the matching position index; This involves performing homomorphic addition operations—coefficient-level parallel operations—on the encrypted coefficients of both the data polynomial ciphertext and the query polynomial ciphertext. The addition results are then compared with the coefficients of a predefined and encrypted matching polynomial, including: Execute within the dedicated storage area: Add the encryption coefficient of each term of the data polynomial to the encryption coefficient of each term of the query polynomial bit by bit, and output the addition result corresponding to each term coefficient; The addition result of each coefficient is compared with the corresponding coefficient in the matching polynomial. If any coefficient matches, the matching position index of the corresponding data block is generated. The expression for the matching polynomial is: ; in, To match polynomials; 2 t -1 represents the numeric encoding of a string consisting entirely of 1s; t is the coefficient bit width, t=16; x i Let i be the variable term of the polynomial; i is the exponent, 0≤i≤n−1, and n is the degree of the polynomial.
2. The method according to claim 1, characterized in that, The data polynomial, the query polynomial, and the matching polynomial have the same structure; The length of each data block after the original binary string of the database is 16 bits. The bit width of each coefficient in the data polynomial, the query polynomial and the matching polynomial is 16 bits. The maximum degree of the data polynomial, the query polynomial and the matching polynomial is the same.
3. The method according to claim 1, characterized in that, The homomorphic encryption algorithm is the BFV homomorphic encryption algorithm.
4. The method according to claim 1, characterized in that, The raw binary string of data from the database is split into multiple data blocks of a specified length, including: The binary string is divided into multiple block sequences by a fixed length of 16 bits. When the last data block is less than 16 bits, it is padded with 0 bits to make it 16 bits. Pack multiple data blocks to form a data block sequence: ; in, A vector representing a sequence of packed data blocks; T (i) This represents the i-th data block, where i is the block index (i=0,1,...,[k / t]−1), k is the original data length, and t is the coefficient bit width, corresponding to the data block length (t=16).
5. The method according to claim 1, characterized in that, The process of mapping a data block sequence to a data polynomial includes: If the block sequence length L is less than or equal to the polynomial degree n, then construct a data polynomial: ; in, For the data polynomial, m i x is the i-th element in m(T), corresponding to the i-th encryption coefficient value; i Let i be the variable term of the polynomial, and i be the exponent, 0 ≤ i ≤ n−1; If the block sequence length L is greater than the polynomial degree n, then divide into multiple polynomials: The expression for the data polynomial is: , in, Let be the j-th data polynomial; n is the polynomial degree, n=1024; x is the polynomial encryption coefficient value, corresponding to an element in the block sequence; j is the polynomial index, j=0,1,..., [L / n]−1, L is the block sequence length, L=[k / t]; i Let i be the variable term of the polynomial, i be the exponent, 0 ≤ i ≤ n−1, and t be the bit width of the coefficients, corresponding to the length of the data block.
6. The method according to claim 5, characterized in that, Fill the coefficients of the polynomial with the negated query string, including: When the length of the query string is equal to the width t of the polynomial coefficients, the query string, after being inverted bit by bit, is repeatedly filled into each coefficient of the polynomial structure. When the length of the query string is greater than the width t of the polynomial coefficients, the query string after bit-by-bit inversion is divided into multiple 16-bit data blocks, and the multiple data blocks are filled into each coefficient of the polynomial structure in a cyclic filling manner. When the length of the query string is less than the width of the polynomial coefficients, the end of the query string after inverting each bit is padded with 0 to 16 bits, and then the string is repeated to padded each coefficient of the polynomial structure. The expression for the query polynomial is: ; Among them, represents the query polynomial; represents the padding value of the i-th encrypted coefficient; x i is the variable term of the polynomial, 0 ≤ i < n - 1; n is the degree of the polynomial, n = 1024.
7. The method according to claim 1, characterized in that, When using homomorphic encryption algorithms to encrypt data polynomials and query polynomials, the public key provided by the server is used for encryption.
Citation Information
Patent Citations
Database SQL character string operation privacy protection method and system
CN115712910A
Data hiding query method and device, electronic equipment and storage medium
CN118551122A