Privacy protection decision tree coding method based on CKKS homomorphic encryption
By reconstructing the mapping between integer input and ciphertext polynomial through full-space encoding in the integer domain, the mapping distortion problem of CKKS homomorphic encryption in privacy-preserving decision tree encoding is solved, the data encoding capacity and computing efficiency are improved, and efficient homomorphic operation of CKKS is realized.
Patent Information
- Application Number
- CN202510783070.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-16
AI Technical Summary
The existing privacy-preserving decision tree encoding method based on CKKS homomorphic encryption has a distorted mapping between integer input and polynomial degree, which makes it impossible to fully utilize the efficient homomorphic computing capabilities of CKKS, and the bottleneck of computing efficiency has not been effectively broken.
By reconstructing the mapping mechanism between integer input and ciphertext polynomial, adopting integer domain full-space encoding, establishing an accurate coefficient mapping model, and improving the utilization of plaintext space, the integrity of the CKKS homomorphic operation framework is ensured.
It achieves a 1:1 correspondence between the number of plaintext slots and the polynomial dimension, increases the data encoding capacity by 100%, solves the problem of functional adaptation while maintaining the speed advantage of homomorphic computing, and improves computing efficiency.
Smart Images

Figure CN120658368A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of cryptography, and in particular relates to a privacy-preserving decision tree encoding method based on CKKS homomorphic encryption. Background Art
[0002] In recent years, machine learning (ML) technology has rapidly developed and is widely used in finance, healthcare, the Internet of Things, and other fields. It has particularly demonstrated significant advantages in local deployment on mobile devices (such as reduced latency and enhanced privacy protection). However, with the surge in demand for data-driven model training, privacy leakage issues have become increasingly serious. Decision trees, as a classic machine learning algorithm, have become a mainstream application in many scenarios, such as credit assessment and medical diagnosis, due to their high efficiency and strong interpretability. To address the growing demand for privacy protection, privacy-preserving decision trees have emerged. They aim to achieve the goal of "data available but invisible" through cryptographic techniques, thereby ensuring both model performance and privacy.
[0003] Privacy-Preserving Decision Tree Evaluation (PDTE) schemes can be categorized as interactive or non-interactive based on the implementation of their core component, the privacy comparison algorithm. As the core of PDTE, the privacy comparison algorithm possesses nonlinear and atomic computational properties, enabling protocol participants to securely compare numerical values without leaking private data. PDTE schemes can be categorized into two major technical approaches: interactive and non-interactive. Interactive schemes are based on technologies such as secure multi-party computation (SMPC), secret sharing, and garbled circuits. Their multi-round communication mechanism places high demands on network bandwidth and requires both communicating parties to be online in real time. Non-interactive schemes rely on homomorphic encryption and can be categorized into leveled homomorphic encryption (LHE) and fully homomorphic encryption (FHE) based on their encryption capabilities. While their single-round communication feature reduces real-time requirements, they suffer from the multiplication depth constraints of LHE and the high computational overhead of FHE.
[0004] In the development of non-interactive privacy comparison protocols, the first-generation scheme, XCMP, was built on the second-generation BGV homomorphic encryption algorithm, but it only supported non-negative integer inputs of 13 bits or less. Subsequent improvements focused on improving computational efficiency and expanding the input domain. Yu et al. optimized the encoding mechanism to expand the two-input comparison domain to arbitrary precision. The SortingHat scheme, implemented using the third-generation TFHE algorithm, improved computational efficiency but limited the bit width to 16 bits. These improvements demonstrate that computational efficiency remains a core technical bottleneck for current non-interactive privacy comparison protocols.
[0005] While existing XCMP schemes are all based on BGV / BFV, it's worth noting that among second-generation homomorphic encryption algorithms based on the RLWE problem, the CKKS scheme achieves a linear increase in the bit length of the ciphertext modulus through rescaling. Its FFT-accelerated complex-domain encoding mechanism improves the efficiency of ciphertext addition and multiplication by 2-3 orders of magnitude compared to traditional schemes, making it a benchmark for second-generation FHE algorithms. However, when building the privacy comparison protocol XCMP based on CKKS, due to its FFT-based complex-domain encoding mechanism, its IFFT preprocessing process results in distortion in the mapping between integer inputs and polynomial degrees, severely limiting the protocol's ability to utilize CKKS's efficient homomorphic computing capabilities.
[0006] Patent CN119544284A discloses a data encryption method and related equipment for ensuring low latency, high throughput, and security for devices with high data traffic. The method includes: encrypting the login information of a first terminal device using the Ascon encryption algorithm to obtain the encrypted login information and an authentication tag, and sending the encrypted login information and authentication tag to a server, so that the server authenticates the encrypted login information based on the encrypted login information and authentication tag; upon determining that the server authenticates the encrypted login information, using the login information to log in to the first terminal device; upon receiving a target message from a user, encrypting the target message using the CKKS encryption algorithm to obtain an encrypted target message; and sending the encrypted target message to the server, so that the server forwards the encrypted target message to a second terminal device, so that the second terminal device decrypts the encrypted target message using the CKKS decryption algorithm to obtain the target message. Summary of the Invention
[0007] Among second-generation homomorphic encryption algorithms based on the RLWE problem, the CKKS scheme achieves linear growth in the bit length of the ciphertext modulus through rescaling. Its FFT-accelerated complex-domain encoding mechanism improves the efficiency of ciphertext addition and multiplication by 2-3 orders of magnitude compared to traditional schemes, setting a benchmark for performance in second-generation FHE algorithms. However, when building the privacy comparison protocol XCMP based on CKKS, the IFFT preprocessing process, due to CKKS's FFT-based complex-domain encoding mechanism, results in distorted mapping between integer inputs and polynomial degrees, severely limiting the protocol's ability to utilize CKKS's efficient homomorphic computing capabilities.
[0008] In order to solve the above technical problems, the present invention provides a technical solution: a privacy-preserving decision tree encoding method based on CKKS homomorphic encryption, including an encoding method and a decoding method; the encoding method includes the following steps: S1: Determine the data type of the encoding object; S2: When the encoding object a is an integer vector, perform integer domain full-space encoding, and after retaining the precision of the integer vector a by the scaling factor Δ, map the integer vector a to the polynomial π(a), and finally return the plaintext polynomial m(x); S3: When the encoding object a is a rational number, the data of the negative domain space of the rational number a is converted to the non-negative domain to obtain a′, and the integer part a′ of a′ is converted to h and the decimal part a l After the integer domain full space encoding in S2, the mapping from integer domain to polynomial is completed.
[0009] Specifically, the decoding method includes the following steps: Step 1: By inverse mapping π -1 Extract primitive integers from polynomial coefficients or exponent positions; Step 2: Use the inverse of the scaling factor Δ -1 Restore original data accuracy; Step 3: Output integer vector z.
[0010] Specifically, in S2 of the encoding method, the original integer vector a is multiplied by a preset scaling factor Δ to retain data accuracy, thereby obtaining a′.
[0011] Specifically, after obtaining a′ by using the scaling factor Δ to retain data accuracy in S2 of the encoding method, the imaginary and real number spaces of the plaintext space of the CKKS algorithm are merged, and the corresponding positions in the plaintext space are assigned 1 according to the numerical value of a′, and the remaining positions are 0, completing the mapping of the integer a′ to the plaintext polynomial m(x).
[0012] Specifically, after completing the mapping from integer a′ to plaintext polynomial m(x) in S2 of the encoding method, the Chinese remainder theorem is used to convert the polynomial X belonging to the integer coefficient cyclotomic polynomial ring R intoa′ Decompose into multiple subcircular rings based on congruence small coefficients.
[0013] Specifically, when the plaintext polynomial is returned in S2 of the encoding method, the NTT technology is used to convert the polynomial in coefficient representation into point value representation, and finally the plaintext polynomial m(x) is returned.
[0014] Specifically, when extracting the original integer in the decoding method, according to the distribution of the CKKS plaintext space, the integer a′ is decoded according to the subscript value assigned to 1, completing the mapping from polynomial to integer.
[0015] Specifically, in the decoding method, after completing the mapping from the polynomial to the integer to obtain the integer a′, the integer a′ is divided by the expansion factor Δ to restore the original accuracy to obtain the final data a, thereby completing the decoding.
[0016] Specifically, in the encoding method S3, a is added to half of the plaintext space range threshold to convert the data in the negative domain space into non-negative data. Specifically, in the encoding method S3, the integer part a of the non-negative number a′ is obtained by floor operation and modulo operation. h and the decimal part a l ; The integer a h and a l The mapping from integer field to polynomial is completed by encoding the full space of integer field in S2.
[0017] The beneficial effects of the present invention are as follows: by reconstructing the mapping mechanism between integer input and ciphertext polynomial, an accurate coefficient mapping model is established under the premise of maintaining the integrity of the CKKS homomorphic operation framework, effectively solving the functional adaptation problem of the XCMP protocol. At the same time, the plaintext space of the CKKS complex domain encoding is fully utilized, and the real / imaginary part separation mode of the traditional complex domain encoding is improved to the integer domain full space encoding, so that the number of plaintext slots and the polynomial dimension n are 1:1 corresponding, and the data coding capacity is increased by 100% compared with the original scheme. Based on the reconstruction coding, the parallel comparison protocol CKKS_RCC is developed, which fully utilizes the homomorphic operation speed advantage of CKKS while maintaining the n-order data encoding capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart of the encoding method of the present invention. DETAILED DESCRIPTION
[0019] The present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0020] Example 1: A privacy-preserving decision tree encoding method based on CKKS homomorphic encryption, including an encoding method and a decoding method; the encoding method includes the following steps: S1: Determine the data type of the encoding object; S2: When the encoding object a is an integer vector, perform integer domain full-space encoding, and after retaining the precision of the integer vector a by the scaling factor Δ, map the integer vector a to the polynomial π(a), and finally return the plaintext polynomial m(x); S3: When the encoding object a is a rational number, the data of the negative domain space of the rational number a is converted to the non-negative domain to obtain a′, and the integer part a′ of a′ is converted to h and the decimal part a l After the integer domain full space encoding in S2, the mapping from integer domain to polynomial is completed.
[0021] The decoding method includes the following steps: Step 1: By inverse mapping π -1 Extract primitive integers from polynomial coefficients or exponent positions; Step 2: Use the inverse of the scaling factor Δ -1 Restore original data accuracy; Step 3: Output integer vector z.
[0022] In recent years, machine learning (ML) technology has developed rapidly and is widely used in fields such as finance, healthcare, and the Internet of Things. It has demonstrated significant advantages in local deployment on mobile devices, such as reduced latency and enhanced privacy protection. However, with the surge in demand for data-driven model training, privacy leakage issues are becoming increasingly serious. On the one hand, large-scale data collection may directly expose sensitive personal information (such as identity and health data); on the other hand, the strong memory capacity of complex models may lead to indirect privacy leakage, such as when attackers use reverse reasoning to infer training data details from model outputs. These challenges have made privacy protection a core issue in the implementation of machine learning technology.
[0023] As a classic machine learning algorithm, decision trees, with their high efficiency and strong interpretability, have become a mainstream technology in numerous scenarios, including credit assessment and medical diagnosis. In response to the growing demand for privacy protection, privacy-preserving decision trees have emerged. They utilize cryptographic techniques to achieve the goal of "data available but invisible," thereby ensuring both model performance and privacy. In the privacy-preserving decision tree service paradigm, the client simply uploads encrypted data to the server. After the server completes inference, the client only receives the ciphertext of the inference results, without access to the server's model structure or other sensitive information. Similarly, the server cannot trace back to the user's original private data, other than the original ciphertext data. This paradigm protects the user's personal information while safeguarding the server's interests. This approach allows us to achieve a balance between privacy protection and data utilization without sacrificing data value.
[0024] Privacy-Preserving Decision Tree Evaluation (PDTE) schemes can be categorized as interactive or non-interactive based on the implementation of their core component, the privacy comparison algorithm. As the core of PDTE, the privacy comparison algorithm possesses nonlinear and atomic computational properties, enabling protocol participants to securely compare numerical values without leaking private data. PDTE schemes can be categorized into two major technical approaches: interactive and non-interactive. Interactive schemes are based on technologies such as secure multi-party computation (SMPC), secret sharing, and garbled circuits. Their multi-round communication mechanism places high demands on network bandwidth and requires both communicating parties to be online in real time. Non-interactive schemes rely on homomorphic encryption and can be categorized into leveled homomorphic encryption (LHE) and fully homomorphic encryption (FHE) based on their encryption capabilities. While their single-round communication feature reduces real-time requirements, they suffer from the multiplication depth constraints of LHE and the high computational overhead of FHE.
[0025] In the development of non-interactive privacy comparison protocols, the first-generation scheme, XCMP, was built on the second-generation BGV homomorphic encryption algorithm, but it only supported non-negative integer inputs of 13 bits or less. Subsequent improvements focused on improving computational efficiency and expanding the input domain. Yu et al. optimized the encoding mechanism to expand the two-input comparison domain to arbitrary precision. The SortingHat scheme, implemented using the third-generation TFHE algorithm, improved computational efficiency but limited the bit width to 16 bits. These improvements demonstrate that computational efficiency remains a core technical bottleneck for current non-interactive privacy comparison protocols.
[0026] Although existing XCMP schemes are all built based on BGV / BFV, it is worth noting that in the second-generation homomorphic encryption algorithm based on the RLWE problem, the CKKS scheme achieves linear growth in the bit length of the ciphertext modulus through rescaling technology. Its FFT-accelerated complex domain encoding mechanism improves the efficiency of ciphertext addition / multiplication operations by 2-3 orders of magnitude compared to traditional schemes, becoming a performance benchmark for the second-generation FHE algorithm.
[0027] Among fully homomorphic encryption algorithms based on the Ring Learning Enigma (RLWE) problem, the CKKS scheme is the first to support approximate computation on both real and complex numbers. Its key idea is to treat noise in the ciphertext as an error component in the approximate computation. In the CKKS scheme, due to the presence of a rescaling step, the bit size of the ciphertext modulus increases linearly with the computational circuit depth, rather than requiring an exponentially large modulus or expensive computations such as bootstrapping or bit extraction.
[0028] To support complex and floating-point inputs, the CKKS algorithm incorporates FFT operations in the encoding and decoding stages. The IFFT in the encoding stage successfully transforms complex numbers into polynomials with integer coefficients over a ring. However, the IFFT prevents the XCMP protocol from accurately mapping integer inputs to their corresponding polynomial degrees when using the original CKKS encoding directly. Consequently, the XCMP protocol cannot fully utilize the efficient homomorphic computation capabilities of the CKKS algorithm.
[0029] The plaintext space of the CKKS algorithm is a ring of polynomials with integer coefficients. The core goal of the reconstruction code of this invention is to accurately map the original data to the coefficient positions of the polynomial. To this end, a single injection π:Z is defined. N →R, that is, mapping the integer vector a to the polynomial π(a).
[0030] The present invention first reconstructs the mapping mechanism between integer input and ciphertext polynomial, establishes an accurate coefficient mapping model while maintaining the integrity of the CKKS homomorphic operation framework, and effectively solves the functional adaptation problem of the privacy-preserving decision tree XCMP_PDTE.
[0031] Secondly, the plaintext space of CKKS complex domain encoding is fully utilized, and the real / imaginary part separation mode of traditional complex domain encoding is improved to integer domain full-space encoding, so that the number of plaintext slots and the polynomial dimension n are 1:1 corresponding, which increases the data coding capacity by 100% compared with the original scheme.
[0032] Specifically, in S2 of the encoding method, the original integer vector a is multiplied by a preset scaling factor Δ>>1 to retain data accuracy, thereby obtaining a′.
[0033] In S2 of the encoding method, after obtaining a′ by using the scaling factor Δ>>1 to retain the data accuracy, the imaginary and real number spaces of the plaintext space of the CKKS algorithm are merged, and the corresponding positions in the plaintext space are assigned 1 according to the numerical value of a′, and the remaining positions are 0, completing the mapping of the integer a′ to the plaintext polynomial m(x).
[0034] After completing the mapping from integer a′ to plaintext polynomial m(x) in S2 of the encoding method, the Chinese remainder theorem is used to convert the polynomial X belonging to the integer coefficient cyclotomic polynomial ring R intoa′ Decompose into multiple subcircular rings based on congruence small coefficients.
[0035] When returning the plaintext polynomial in S2 of the encoding method, the NTT technology is used to convert the polynomial in coefficient representation into point value representation, and finally the plaintext polynomial m(x) is returned.
[0036] When extracting the original integer in the decoding method, according to the distribution of the CKKS plaintext space, the integer a′ is decoded according to the subscript value assigned to 1, completing the mapping from polynomial to integer.
[0037] In the decoding method, after the polynomial is mapped to an integer to obtain the integer a′, the integer a′ is divided by the expansion factor Δ>>1 to restore the original accuracy and obtain the final data a, thus completing the decoding.
[0038] In the encoding method S3, the data in the negative domain space is converted into the non-negative domain. The integer part a of the non-negative number a′ is obtained by floor operation and modulus operation. h and the decimal part a l ; The integer a h and a l The mapping from integer field to polynomial is completed by encoding the full space of integer field in S2.
[0039] Compared with the traditional solution, this embodiment has the following improvements: 1. Mapping compatibility reconstruction: The encoding and decoding process is redesigned to establish a precise mapping relationship between integer input and polynomial coefficients while retaining the CKKS homomorphic operation framework, ensuring the functional integrity of the XCMP protocol; 2. Optimized space utilization: The original scheme splits the plaintext space of complex-domain encoding into real and imaginary parts, improving it to a full-space encoding scheme in the integer domain. When the polynomial dimension is n, the number of plaintext slots is increased to n, achieving a 100% improvement in data encoding capacity compared to the original scheme. 3. Enhanced computing efficiency: The privacy protocol CKKS_RCC, built based on integer domain full-space encoding, fully leverages the homomorphic computing speed advantage of CKKS while maintaining the ability to encode n-level data.
[0040] Example 2: A privacy-preserving decision tree integer domain full-space encoding method based on CKKS homomorphic encryption, including an encoding method and a decoding method; the encoding method includes the following steps: S1: Determine the data type of the encoding object; S2: When the encoding object a is an integer vector, perform integer domain full-space encoding, scale the integer vector a by a factor Δ>>1 to preserve the precision, map a to a polynomial a, and finally return the plaintext polynomial m(x); S3: The encoding object a is a rational number a∈Q 2When a is converted from the negative domain of a to the non-negative domain, a′ is obtained, and the integer part of a′ is converted from a′ to a′. h and the decimal part a l After the integer domain full space encoding in S2, the mapping from integer domain to polynomial is completed.
[0041] The decoding method includes the following steps: Step 1: By inverse mapping π -1 Extract primitive integers from polynomial coefficients or exponent positions; Step 2: Use the inverse of the scaling factor Δ -1 Restore original data accuracy; Step 3: Output vector z.
[0042] This embodiment first reconstructs the mapping mechanism between integer input and ciphertext polynomial, and establishes an accurate coefficient mapping model while maintaining the integrity of the CKKS homomorphic operation framework, effectively solving the functional adaptation problem of the privacy-preserving decision tree XCMP_PDTE.
[0043] Secondly, the plaintext space of CKKS complex domain encoding is fully utilized, and the real / imaginary part separation mode of traditional complex domain encoding is improved to integer domain full-space encoding, so that the number of plaintext slots and the polynomial dimension n are 1:1 corresponding, which increases the data coding capacity by 100% compared with the original scheme.
[0044] In the development of non-interactive privacy comparison protocols, the first-generation scheme, XCMP, was built on the second-generation BGV homomorphic encryption algorithm, but it only supported non-negative integer inputs of 13 bits or less. Subsequent improvements focused on improving computational efficiency and expanding the input domain. Yu et al. optimized the encoding mechanism to expand the two-input comparison domain to arbitrary precision. The SortingHat scheme, implemented using the third-generation TFHE algorithm, improved computational efficiency but limited the bit width to 16 bits. These improvements demonstrate that computational efficiency remains a core technical bottleneck for current non-interactive privacy comparison protocols.
[0045] Although existing XCMP schemes are all built based on BGV / BFV, it is worth noting that in the second-generation homomorphic encryption algorithm based on the RLWE problem, the CKKS scheme achieves linear growth in the bit length of the ciphertext modulus through rescaling technology. Its FFT-accelerated complex domain encoding mechanism improves the efficiency of ciphertext addition / multiplication operations by 2-3 orders of magnitude compared to traditional schemes, becoming a performance benchmark for the second-generation FHE algorithm.
[0046] Among fully homomorphic encryption algorithms based on the Ring Learning Enigma (RLWE) problem, the CKKS scheme is the first to support approximate computation on both real and complex numbers. Its key idea is to treat noise in the ciphertext as an error component in the approximate computation. In the CKKS scheme, due to the presence of a rescaling step, the bit size of the ciphertext modulus increases linearly with the computational circuit depth, rather than requiring an exponentially large modulus or expensive computations such as bootstrapping or bit extraction.
[0047] To support complex and floating-point inputs, the CKKS algorithm incorporates FFT operations in the encoding and decoding stages. The IFFT in the encoding stage successfully transforms complex numbers into polynomials with integer coefficients over a ring. However, the IFFT prevents the XCMP protocol from accurately mapping integer inputs to their corresponding polynomial degrees when using the original CKKS encoding directly. Consequently, the XCMP protocol cannot fully utilize the efficient homomorphic computation capabilities of the CKKS algorithm.
[0048] The plaintext space of the CKKS algorithm is a ring of integer coefficient polynomials R. The core goal of the reconstruction code of the present invention is to accurately map the original data to the coefficient positions of the polynomial. To this end, a single injection π is defined: Z N →R, that is, mapping the integer vector a to the polynomial π(a).
[0049] To prevent loss of precision in significant digits, a scaling factor Δ>>1 is introduced during encoding to preprocess the original floating-point data. This preserves the significant digits and suppresses the erosion of precision by noise in subsequent homomorphic operations. The theoretical summary is as follows: Ecd(a, Δ): For an integer a∈(-N / 2, N / 2) (CKKS supports N / 2 slots), the encoding process first maps it to the exponential position of the plaintext polynomial, generating the polynomial basis via π(a). This is then multiplied by the scaling factor Δ>>1 to preserve precision. This ultimately returns the plaintext polynomial m(x).
[0050] Dcd(m(x), Δ): For the input plaintext polynomial m(x)∈R, the decoding process is performed by inverse mapping π -1 Extract the original integer from the polynomial coefficient or exponent position and multiply it by the inverse of the scaling factor Δ -1 Restore the original data accuracy and finally output vector z.
[0051] For the original integer a∈(-N / 2, N / 2), the encoding steps are: Step 1: The original integer is multiplied by a preset scaling factor Δ>>1 to preserve data accuracy. In order to adapt to the characteristics of the privacy-preserving decision tree XCMP_PDTE scheme, the present invention presets Δ=1; Step 2: Make full use of the plaintext space set by the CKKS algorithm to support complex numbers, merge the imaginary and real number spaces, assign 1 to the corresponding position in the plaintext space according to the value of a′, and set the remaining positions to 0, completing the mapping from integer a′ to polynomial m(x); Step 3: Using the Chinese remainder theorem, we can transform the polynomial X belonging to the integer polynomial ring R into a′ Decomposition into multiple sub-circular rings based on congruent small coefficients. This operation can convert a large integer polynomial ring into a set of small integer rings, reducing computational overhead; Step 4: Use NTT technology to convert the polynomial in coefficient representation to point value representation for subsequent fast ciphertext multiplication operations.
[0052] For the plaintext polynomial m(x), the decoding steps are: Step 1: Based on the distribution of the CKKS plaintext space, the integer a′ is obtained by decoding the subscript value assigned to 1, completing the mapping from polynomial to integer; Step 2: Divide the integer a′ by the expansion factor Δ>>1 to restore the original accuracy and obtain the final data α to complete the decoding.
[0053] In the above process, the imaginary and real parts of the plaintext space of the CKKS algorithm are merged. While the N / 2 slots in the standard CKKS code result from the separation of the complex components, the N slots in the reconstructed code of the present invention correspond to the direct filling of the polynomial coefficients. Therefore, when the polynomial dimension is N, the number of supported slots is also N. Therefore, XCMP, built on integer domain full-space coding, can encode twice the capacity of previous BGV / BFV-based codes, thus supporting larger inputs under the same conditions.
[0054] Based on the above integer domain full-space encoding method, the XCMP protocol and the privacy-preserving decision tree XCMP_PDTE scheme can be successfully constructed based on the CKKS algorithm, completing the comparison of two numerical values in the encrypted state and reasoning about the decision scheme. In order to adapt to the widespread rational numbers in reality and enable the XCMP protocol constructed based on the CKKS algorithm to support rational number input, the present invention designs an encoding method for the CKKS_XCMP protocol that supports rational number input. The specific steps are as follows: Step 1: For a rational number α∈Q 2 , convert the data of the negative domain space into the non-negative domain and obtain α′; Step 2: Obtain the integer part α of the non-negative number a′ by floor operation and modulo operation h and the fractional part α l ; Step 3: Convert integer a h and a lBy encoding the entire space of the integer domain, the mapping from the integer domain to the polynomial is completed, preparing for the subsequent ciphertext comparison.
[0055] Compared with the traditional solution, this embodiment has the following improvements: 1. Mapping compatibility reconstruction: The encoding and decoding process is redesigned to establish a precise mapping relationship between integer input and polynomial coefficients while retaining the CKKS homomorphic operation framework, ensuring the functional integrity of the XCMP protocol; 2. Optimized space utilization: The original scheme splits the plaintext space of complex-domain encoding into real and imaginary parts, improving it to a full-space encoding scheme in the integer domain. When the polynomial dimension is n, the number of plaintext slots is increased to n, achieving a 100% improvement in data encoding capacity compared to the original scheme. 3. Enhanced computing efficiency: The privacy protocol CKKS_RCC, built based on integer domain full-space encoding, fully leverages the homomorphic computing speed advantage of CKKS while maintaining the ability to encode n-level data.
[0056] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A privacy-preserving decision tree encoding method based on CKKS homomorphic encryption, characterized in that: The invention comprises an encoding method and a decoding method; the encoding method comprises the following steps: S1: Determine the data type of the encoding object; S2: When the encoding object a is an integer vector, perform integer domain full-space encoding, and after retaining the precision of the integer vector a by the scaling factor Δ, map the integer vector a to the polynomial π(a), and finally return the plaintext polynomial m(x); S3: When the encoding object a is a rational number, the data of the negative domain space of the rational number a is converted to the non-negative domain to obtain a′, and the integer part a′ of a′ is converted to h and the decimal part a l After the integer domain full space encoding in S2, the mapping from integer domain to polynomial is completed.
2. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 1 is characterized in that: The decoding method includes the following steps: Step 1: By inverse mapping π -1 Extract primitive integers from polynomial coefficients or exponent positions; Step 2: Use the inverse of the scaling factor Δ -1 Restore original data accuracy; Step 3: Output integer vector z.
3. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 1 is characterized in that: In S2 of the encoding method, the original integer vector α is multiplied by a preset scaling factor Δ to retain data accuracy, thereby obtaining a′.
4. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 3 is characterized in that: In S2 of the encoding method, after obtaining a′ by using the scaling factor Δ to retain the data accuracy, the imaginary and real number spaces of the plaintext space of the CKKS algorithm are merged. According to the numerical value of α′, the corresponding position in the plaintext space is assigned to 1, and the remaining positions are assigned to 0, completing the mapping of the integer α′ to the plaintext polynomial m(x).
5. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 4 is characterized in that: After completing the mapping from integer α′ to plaintext polynomial m(x) in S2 of the encoding method, the Chinese remainder theorem is used to convert the polynomial X belonging to the integer coefficient cyclotomic polynomial ring R into α′ Decompose into multiple subcircular rings based on congruence small coefficients.
6. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 5, characterized in that: When returning the plaintext polynomial in S2 of the encoding method, the NTT technique is used to convert the polynomial in coefficient representation into point value representation, and finally the plaintext polynomial m is returned.
7. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 2, characterized in that: When extracting the original integer in the decoding method, according to the distribution of the CKKS plaintext space, the integer a′ is decoded according to the subscript value assigned to 1, completing the mapping from polynomial to integer.
8. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 7, characterized in that: In the decoding method, after the polynomial is mapped to an integer to obtain the integer a′, the integer a′ is divided by the expansion factor Δ to restore the original accuracy and obtain the final data a, thus completing the decoding.
9. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 1, characterized in that: In encoding method S3, a is added to half of the plaintext space range threshold to convert the data in the negative domain space into the non-negative domain.
10. The privacy-preserving decision tree encoding method based on CKKS homomorphic encryption according to claim 1 or 9, characterized in that: In the encoding method S3, the integer part a of the non-negative number a′ is obtained by floor operation and modulo operation. h and the decimal part a l ; The integer a h and a l The mapping from integer field to polynomial is completed by encoding the full space of integer field in S2.
Citation Information
Patent Citations
Data encryption method and related equipment
CN119544284A