Ciphertext processing method and system

CN122601385APending Publication Date: 2026-08-18SHENZHEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611073364.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0008]本申请的主要目的在于提供一种密文处理方法及系统,旨在解决现有方案通信开销大、计算损耗高以及隐私防护弱的技术问题

Benefits of technology

[0022] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the ciphertext processing method described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601385A_ABST
    Figure CN122601385A_ABST
Patent Text Reader

Abstract

This application discloses a ciphertext processing method and system, relating to the field of encrypted privacy computing technology. The method includes: a client quantizing the vector to be matched, directly encoding the coefficients, and encrypting and uploading the query ciphertext; a server constructing a self-isomorphic base ciphertext and recombining it to obtain a dimension-wise query ciphertext, which is then subjected to homomorphic multiplication and addition inner product operations with the template ciphertext to obtain an encrypted score block; a returned ciphertext block is obtained by superimposing a channel-aligned random mask, and the masked score share is obtained through decryption by the authentication / decision side; a security threshold comparison is performed by combining complementary shares, and the result is output. In this scheme, the client only uploads a single ciphertext, and the server performs dimensional splitting, eliminating the need for multi-packet transmission and significantly reducing communication overhead; homomorphic inner product matching is achieved through ciphertext computation links, reducing redundant computations and effectively reducing homomorphic computation losses; and the leakage of plaintext similarity information is shielded through random mask encryption and collaborative verification of dual-end score shares, enhancing privacy protection capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of encrypted privacy computing technology, and in particular to ciphertext processing methods and systems. Background Technology

[0002] In one-to-many encrypted vector matching and encrypted biometric authentication scenarios, the client outputs a query probe vector, while the server stores a large-scale encrypted template library. To protect the privacy of vector data and matching scores, existing technologies often employ homomorphic encryption, secure two-party computation, secret sharing, or combinations thereof.

[0003] In a fully homomorphic encryption scheme, the client encrypts and uploads the query vector, and the server completes the ciphertext similarity calculation and outputs the matching result without decryption. The system performance is mainly constrained by communication overhead, ciphertext calculation volume, privacy risks, and template update costs.

[0004] Currently, mainstream encrypted matching technologies fall into four typical categories, each with significant drawbacks: SIMD rotation aggregation enables single-ciphertext upload, but suffers from high matching computational overhead and low ciphertext utilization; vertical packing reduces the computational burden of matching, but the upload communication volume increases dramatically with the vector dimension; direct coefficient encoding simplifies upload, but results in high ciphertext redundancy and high return overhead; dedicated biometric template encoding offers high recognition efficiency, but lacks versatility, and template registration and update costs are high. Meanwhile, traditional encrypted query extension technologies adapted for database retrieval suffer from significant noise loss, computational time consumption, and excessive decryption margin consumption when directly applied to biometric authentication, making it difficult to meet the requirements of high-precision and high-privacy authentication.

[0005] Existing encrypted matching technologies struggle to achieve end-to-end collaborative optimization, resulting in significant application limitations. Current technologies fail to balance communication transmission efficiency with encrypted matching performance. Using a single encrypted extension method introduces substantial noise during computation, directly reducing matching accuracy. Employing a multi-encrypted parallel matching mode requires clients to upload multiple encrypted sets in batches, leading to large data volumes and high communication overhead. Traditional encrypted matching processes heavily rely on complex underlying operations such as self-isomorphism and polynomial rotation, resulting in cumbersome steps, high overall computational overhead, and rapid noise consumption, making it unsuitable for high-frequency concurrent queries with millions of template libraries. Conventional query expansion mechanisms continuously accumulate computational noise, limiting the system's privacy protection capabilities. Furthermore, traditional solutions exhibit high encrypted redundancy and low effective feature information density, placing immense pressure on communication capacity in large-scale commercial scenarios. The complete similarity score and nearest neighbor matching information are prone to leakage during matching, posing a permanent privacy risk for non-resettable biometric features. Most existing technologies focus solely on optimizing online recognition processes, resulting in poor overall performance and failing to meet the deployment requirements of large-scale authentication scenarios.

[0006] Therefore, there is an urgent need for a ciphertext processing method that aims to solve the technical problem of the difficulty in coordinating and optimizing the various stages of existing one-to-many ciphertext vector matching and ciphertext biometric authentication schemes, and to improve the problems of high communication overhead, high computational loss and weak privacy protection in existing schemes.

[0007] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0008] The main purpose of this application is to provide a method and system for ciphertext processing, which aims to solve the technical problems of high communication overhead, high computational loss and weak privacy protection in existing solutions.

[0009] To achieve the above objectives, this application proposes a method for ciphertext processing, which is applied to a client and includes: Collect the vector to be matched, and quantize and directly encode the vector to generate encrypted query ciphertext; The encrypted query ciphertext is uploaded to the server so that the server can construct an automorphic base ciphertext based on the encrypted query ciphertext and perform shift and recombination operations to generate a dimension-wise query ciphertext. Based on the dimension-wise query ciphertext and the pre-stored template ciphertext, the server performs a homomorphic multiplication and addition inner product operation and superimposes a channel-aligned random mask to generate a masked return ciphertext block to complete the security threshold comparison and output the matching result.

[0010] In one embodiment, the step of quantizing and directly encoding the vector to be matched to generate encrypted query ciphertext includes: The vector to be matched is normalized, and the normalized vector to be matched is quantized using a preset quantization factor to obtain the quantized value corresponding to the vector to be matched. Based on the query expansion size, the modular inverse parameter corresponding to the multiplication factor is calculated to obtain the modular inverse parameter corresponding to the vector to be matched. Based on the quantization value and the modulus inverse parameter, construct the probe plaintext polynomial; The probe plaintext polynomial is encrypted using a preset public key to obtain the encrypted query ciphertext.

[0011] In one embodiment, before the step of acquiring the vector to be matched, quantizing and directly encoding the vector to be matched, and generating encrypted query ciphertext, the method includes: In response to the dynamic identity registration request, the system receives the original template vector of the identity to be registered and performs vectorization processing to determine the extension parameters and extension factor inverses corresponding to the registration. Construct the registration plaintext polynomial based on the expansion parameters and the inverse of the expansion factor; The plaintext registration is encrypted using a polynomial to obtain ciphertext registration, which is then uploaded to the server for identity uniqueness verification and partial update of the template ciphertext.

[0012] Furthermore, to achieve the above objectives, this application also proposes a method for ciphertext processing, which is applied to a server and includes: The client receives encrypted query ciphertext uploaded by the client. The encrypted query ciphertext is obtained by quantizing and directly coefficient encoding the feature vector to be matched by the client and then encrypting it. Based on the encrypted query ciphertext, an automorphic base ciphertext is constructed, and a shift and recombination operation is performed on the automorphic base ciphertext to output the dimension-by-dimensional query ciphertext. Based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext, a homomorphic multiplication-addition inner product operation is performed to obtain an encrypted fractional block; The encrypted fractional block is masked by channel-aligned random masking to generate a masked return ciphertext block. The returned ciphertext block is decrypted by the authentication / decision side to obtain the masked fraction. A security threshold comparison is then performed based on the masked fraction share and the locally retained mask complementary share, and the comparison result is output.

[0013] In one embodiment, the step of constructing an automorphic base ciphertext based on the encrypted query ciphertext, performing a shift and recombination operation on the automorphic base ciphertext, and outputting a dimension-by-dimensional query ciphertext includes: Multi-level automorphism indices are generated based on preset extended level parameters, and composite automorphism indices are calculated by combining extended indexes. The automorphic base ciphertext is constructed based on the encrypted query ciphertext and the composite automorphic index; The self-isomorphic basis ciphertext is transformed to the coefficient domain, and a suffix-aware shift butterfly recombination operation is performed hierarchically to obtain the recombined ciphertext of each leaf node. The recombined leaf node ciphertext is subjected to local normalized displacement processing to generate the dimension-by-dimensional query ciphertext.

[0014] In one embodiment, the step of performing a homomorphic multiply-add inner product operation based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext to obtain an encrypted fractional block includes: Perform homomorphic multiplication operations on the ciphertext of each dimension query and the pre-stored template ciphertext to obtain the ciphertext product of each feature dimension. Homomorphic accumulation inner product operation is performed on the ciphertext product results corresponding to all dimensions to obtain encrypted score blocks, wherein the encrypted score blocks carry encrypted similarity scores of multiple registered identities in parallel in different polynomial coefficient positions and different CRT channels; Before performing homomorphic multiplication operations on the ciphertext for each dimension and the pre-stored template ciphertext to obtain the ciphertext product corresponding to each feature dimension, the process includes: Collect and quantify the original feature vectors of each registered identity to obtain identity template vectors, which serve as the matching benchmark data for each registered identity; The identity template vectors of multiple registered identities are densely bound to each other in a layout so that the template values ​​of multiple registered identities are bound to different CRT channels of the same plaintext coefficient. For template values ​​of multiple registered identities corresponding to different CRT channels at the same polynomial coefficient position, channel synthesis is performed to generate the corresponding plaintext coefficients; Based on the plaintext coefficients, a template plaintext polynomial is constructed, and the template plaintext polynomial is encrypted to obtain the template ciphertext.

[0015] In one embodiment, the step of performing mask overlay processing on the encrypted fractional block using a channel-aligned random mask to generate a mask-protected return ciphertext block includes: The channel-aligned random mask on different CRT channels with the same polynomial coefficient position is synthesized to form a mask plaintext polynomial. Based on the mask plaintext polynomial and the encrypted fractional block, the masked returned ciphertext block is obtained.

[0016] In one embodiment, the step of performing a security threshold comparison based on the masked fractional share and the locally retained masked complementary share, and outputting the comparison result, includes: Based on the masked score share and the locally retained masked complementary share, the share restoration, score comparison and security threshold judgment are performed in the secure computing protocol, and the registered identity index or matching rejection flag that meets the security threshold is output.

[0017] Perform a security threshold comparison and verification on the true similarity score, and output the registration identity index or matching rejection flag that meets the security threshold.

[0018] In one embodiment, prior to the step of receiving the encrypted query ciphertext uploaded by the client, the following steps are included: Receive the registration ciphertext uploaded by the client, perform multi-way expansion processing on the registration ciphertext, and obtain the uniqueness check ciphertext and the template update ciphertext respectively; The uniqueness check is used to perform a private deduplication verification between the encrypted text and the pre-stored template encrypted text; If duplicate registrations are found during verification, the candidate binding location is released and registration is terminated. If no duplicate registration is found, confirm and submit the candidate binding location; After identity verification, the template update ciphertext is subjected to local coefficient shifting, and the shifted template update ciphertext is locally superimposed onto the corresponding template ciphertext in a homomorphic addition manner to achieve local update of the template ciphertext.

[0019] In addition, to achieve the above objectives, this application also proposes a ciphertext processing system, which includes a client and a server. The client includes: The acquisition module is used to acquire the vector to be matched, and to quantize and directly encode the vector to be matched to generate encrypted query ciphertext; The upload module is used to upload the encrypted query ciphertext to the server, so that the server can construct an automorphic base ciphertext based on the encrypted query ciphertext and perform a shift and recombination operation to generate a dimension-wise query ciphertext. Based on the dimension-wise query ciphertext and the pre-stored template ciphertext, the server performs a homomorphic multiplication and addition inner product operation and superimposes a channel-aligned random mask to generate a masked return ciphertext block, so as to complete the security threshold comparison and output the matching result. The server includes: The receiving module is used to receive encrypted query ciphertext uploaded by the client. The encrypted query ciphertext is obtained by the client quantizing and directly encoding the feature vector to be matched and then encrypting it. An extended recombination module is used to construct an automorphic base ciphertext based on the encrypted query ciphertext, and perform a shift recombination operation on the automorphic base ciphertext to output a dimension-by-dimensional query ciphertext. The inner product calculation module is used to perform homomorphic multiplication and addition inner product operations based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext to obtain encrypted fractional blocks; The masking module is used to perform masking overlay processing on the encrypted fractional block using a channel-aligned random mask to generate a mask-protected return ciphertext block. The security comparison module is used to decrypt the returned ciphertext block through the authentication / decision side to obtain the masked fraction, and perform a security threshold comparison based on the masked fraction share and the locally retained mask complementary share, and output the comparison result.

[0020] In addition, to achieve the above objectives, this application also proposes a ciphertext processing apparatus, the apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the ciphertext processing method as described above.

[0021] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the ciphertext processing method described above.

[0022] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the ciphertext processing method described above.

[0023] This application proposes a method and system for ciphertext processing. The method includes: a client acquiring a vector to be matched, performing quantization and direct coefficient encoding, generating encrypted query ciphertext, and uploading it to a server; the server constructing an automorphic base ciphertext based on the encrypted query ciphertext, performing a shift and recombination operation on the automorphic base ciphertext, and outputting a dimension-wise query ciphertext; performing a homomorphic multiplication-addition inner product operation on the dimension-wise query ciphertext and a pre-stored template ciphertext to obtain an encrypted fractional block; performing mask superposition processing on the encrypted fractional block using a channel-aligned random mask to generate a masked return ciphertext block; decrypting the return ciphertext block through an authentication / decision side to obtain a masked fractional share, and performing a security threshold comparison based on the masked fractional share and a locally stored mask complementary share, and outputting the comparison result. In this solution, the client only outputs a single encrypted query ciphertext to the server. The server then uses self-similar basis construction and shift-recombination operations to split the query ciphertext into various dimensions, eliminating the need for the client to upload multiple packets across different dimensions. This effectively reduces the amount of data transmitted and solves the problem of high communication overhead in existing solutions. Homomorphic inner product operations are performed by combining the query ciphertext with pre-stored template ciphertext, reducing the overall homomorphic computation loss. The returned ciphertext block is generated by superimposing channel-aligned random masks, and threshold comparison is performed in conjunction with locally retained complementary mask shares to avoid direct leakage of plaintext similarity, effectively enhancing privacy protection capabilities. Attached Figure Description

[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0025] 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, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart illustrating an embodiment of the encrypted text processing method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the encrypted text processing method of this application; Figure 3 This is a flowchart illustrating Embodiment 3 of the encrypted text processing method of this application; Figure 4This is a schematic diagram of query-side decoupling extension and suffix-aware shift butterfly recombination provided in Embodiment 3 of this application; Figure 5 This is a flowchart illustrating Embodiment 4 of the encrypted text processing method of this application; Figure 6 This is a schematic diagram of the template-side CRT channel priority dense binding and encrypted result return provided in Embodiment 4 of this application; Figure 7 This is a flowchart illustrating Embodiment 5 of the encrypted text processing method of this application; Figure 8 This is a schematic diagram of the module structure of the encrypted text processing system according to an embodiment of this application; Figure 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the encrypted text processing method in the embodiments of this application.

[0027] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0028] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0029] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0030] The main solution of this application embodiment is as follows: The client collects the vector to be matched, performs quantization and direct coefficient encoding, generates encrypted query ciphertext, and uploads it to the server; the server constructs an automorphic base ciphertext based on the encrypted query ciphertext, performs shift and recombination operation on the automorphic base ciphertext, and outputs a dimension-wise query ciphertext; the server performs a homomorphic multiplication and addition inner product operation on the dimension-wise query ciphertext and the pre-stored template ciphertext to obtain an encrypted fractional block; the encrypted fractional block is masked using a channel-aligned random mask to generate a masked return ciphertext block; the return ciphertext block is decrypted to obtain the masked fractional share, and a security threshold comparison is performed based on the masked fractional share and the locally stored mask complementary share, and the comparison result is output.

[0031] In this embodiment, for ease of description, the encrypted text processing system will be used as the execution subject in the following description.

[0032] Because existing one-to-many encrypted vector matching and encrypted biometric authentication technologies operate in a fragmented manner, it is difficult to achieve end-to-end collaborative optimization, resulting in significant limitations in overall application. Existing technologies struggle to balance communication transmission efficiency with encrypted matching performance. Using a single-encrypted extension method introduces substantial noise during computation, directly reducing matching accuracy. Employing a multi-encrypted parallel matching mode requires the client to upload multiple sets of encrypted text in batches, leading to large data transmission volumes and high communication overhead. Traditional encrypted matching processes heavily rely on complex underlying operations such as self-isomorphism and polynomial rotation, resulting in cumbersome steps, high overall computational overhead, and rapid noise consumption, making it unsuitable for high-frequency concurrent query scenarios with millions of template libraries. Conventional query expansion mechanisms continuously accumulate computational noise, significantly depleting decryption margins and further weakening the system's privacy protection ceiling. Simultaneously, traditional solutions exhibit high encrypted text redundancy and low effective feature information density, placing immense pressure on communication capacity in large-scale commercial scenarios. Furthermore, the complete similarity score and nearest neighbor matching information are prone to leakage during matching, posing a permanent privacy risk for non-resettable biometric features. In addition, existing template addition and update operations require the reconstruction of all template ciphertext, resulting in high computational overhead for registration and updates, and high costs for subsequent dynamic maintenance. Most existing related technologies only focus on optimizing the online recognition process, neglecting the performance shortcomings of identity registration and incremental template updates, and cannot simultaneously balance recognition and matching performance with long-term maintenance costs, making it difficult to meet the deployment needs of large-scale authentication scenarios.

[0033] This application provides a solution that obtains dimension-wise matching ciphertext through client-side single-ciphertext encoding and uploading combined with server-side query expansion parsing, significantly reducing query communication overhead. A decoupled query expansion architecture separates the automorphic base generation and suffix-aware shift butterfly recombination processes, centrally handling automorphic operations and reducing redundant domain transformation operations, effectively reducing computational losses in the expansion stage. Simultaneously, pre-multiplying the expansion factor modular inverse during the client-side encoding stage avoids secondary recovery operations on the server, suppressing noise accumulation and preserving sufficient decryption margin. After a single query expansion is completed, the matching loop does not need to repeatedly execute automorphic and rotation operations; similarity matching is completed only through ciphertext multiplication and addition operations, significantly improving the efficiency of high-frequency queries. This invention applies ciphertext channel layout to template score binding, achieving multi-identity template value channel-based dense storage without modifying the ciphertext algorithm itself, effectively increasing ciphertext information density. Furthermore, this invention introduces a channel-aligned random mask mechanism, using score dual-share collaborative verification to output only the thresholded decision result without exposing the original matching score, fundamentally avoiding the risk of biometric privacy leakage. Furthermore, this invention reuses a unified extended interface to achieve lightweight dynamic registration. It completes identity deduplication and local template incremental updates by registering encrypted text with dual payloads. Template insertion can be completed by performing shift homomorphic addition only at the target position, without the need to reconstruct the overall encrypted template library. This significantly reduces the cost of dynamic registration and operation and maintenance, and achieves coordinated optimization of communication efficiency, computing performance, decryption margin, privacy security and operation and maintenance costs throughout the encrypted authentication process. It is suitable for large-scale, high-frequency encrypted biometric authentication deployment scenarios.

[0034] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions. The following description uses a personal computer as an example to illustrate this embodiment and the subsequent embodiments.

[0035] Based on this, embodiments of this application provide a method for ciphertext processing, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the encrypted text processing method of this application.

[0036] The method in this embodiment is applied to a client, and the ciphertext processing method includes steps S10~S20: Step S10: Collect the vector to be matched, and quantize and directly encode the vector to be matched to generate encrypted query ciphertext; It should be noted that the vector to be matched refers to a high-dimensional real-valued feature vector used for identity matching and feature retrieval, specifically including biometric feature vectors, image retrieval feature vectors, text semantic feature vectors, and other feature vectors suitable for one-to-many encrypted similarity matching. The encrypted query ciphertext is a fully homomorphic encrypted query ciphertext based on the polynomial ring remainder system and supporting CRT multi-channel parallel computation, using the BGV (Brakerski-Gentry-Vaikuntanathan) architecture.

[0037] Optionally, step S10 may include steps S11 to S14: Step S11: Normalize the vector to be matched, and quantize the normalized vector to be matched using a preset quantization factor to obtain the quantized value corresponding to the vector to be matched. In this embodiment, the client first obtains the real-valued vector to be matched or the extracted feature vector. This vector can originate from biometric authentication, encrypted vector retrieval, similar item retrieval, or other application scenarios requiring one-to-many matching. If the input is a real-valued vector, the client can first normalize it to eliminate the interference of vector amplitude differences on matching accuracy, and then use a preset public quantization factor k to perform integer quantization, converting continuous real-valued features into discrete integers to obtain quantized values ​​for each dimension. ,in, (·) is the rounding function, used to map continuous real values ​​to integers. Let be the real-valued feature component of the i-th dimension of the vector to be matched after normalization.

[0038] Step S12: Solve the modular inverse parameter corresponding to the multiplication factor based on the query expansion size to obtain the modular inverse parameter corresponding to the vector to be matched; It should be noted that the multiplication factor for solving the query expansion size refers to the preset query expansion size in the query ciphertext dimension expansion operation. The multiplication factor is uniformly set in the recognition scenario of this invention. =d, meaning the multiplication factor is equal to the dimension d of the vector to be matched.

[0039] The modular inverse parameter is the modular inverse of the multiplication factor d under the BGV plaintext modulus P. ,satisfy This is used to offset the fixed multiplication bias introduced by subsequent ciphertext expansion operations, eliminating the need for additional server-side correction calculations.

[0040] In this embodiment, the plaintext modulus P is represented by a multi-word-length integer. It can achieve the equivalent storage and computation of ultra-large plaintext moduli of 120 to 128 bits through concatenation of two 64-bit words, breaking through the limitation of traditional small plaintext moduli on the number of CRT channels. This fully utilizes the decryption margin of ciphertext computation on the query side, improving template storage density and parallel matching capabilities. In this embodiment, the plaintext modulus P satisfies the core constraint: P consists of several pairwise coprime odd-numbered CRT channel moduli, denoted as […]. And satisfy It can fully accommodate multi-channel bound data, preventing data overflow and channel value mixing. Simultaneously, the vector dimension d is set to a power of 2, and the dimension parameter d is strictly coprime with the large plaintext modulus P, allowing for a unique and stable solution of the modulus inverse parameter. This modulus inverse parameter, adapted to the large modulus, is used as the core parameter for client-side encoding correction, subsequently used in the construction of the probe plaintext polynomial, precisely offsetting the fixed multiplication bias caused by ciphertext expansion from the encoding source.

[0041] Step S13: Construct the probe plaintext polynomial based on the quantization value and the modulus inverse parameter; In this embodiment, the quantized values ​​of each dimension are... Taking the modulus of the plaintext modulus P yields the modulus-constrained quantization value. Then, the modulus constraint quantization value and the modulus inverse parameter are combined. Multiplying dimension by dimension, using the results of the multiplication as the coefficients of each order of the polynomial, the probe plaintext polynomial is finally constructed. ,in, For each polynomial basis term of degree i in the BGV polynomial ring, it is used to carry the vector quantization information of the corresponding dimension, realize the one-to-one mapping between the vector dimension and the polynomial coefficients, and fully realize the lossless mapping from high-dimensional vectors to polynomials.

[0042] Step S14: Encrypt the probe plaintext polynomial using a preset public key to obtain the encrypted query ciphertext.

[0043] In this embodiment, the client invokes a preset BGV global public key to encrypt the constructed complete probe plaintext polynomial, generating a unique encrypted query ciphertext. It eliminates the need to split and encrypt each dimension of the vector, generating only a single ciphertext as query data, greatly reducing the communication overhead of client data upload.

[0044] Through the above steps, the preprocessing of the real-valued feature vectors to be matched, including normalization, quantization, bias correction, and polynomial encoding, is completed. Based on the encoding method of pre-multiplication of modular inverse parameters, the correction operation of ciphertext expansion is moved to the plaintext stage on the client side, avoiding the noise accumulation problem caused by homomorphic multiplication on the server side. At the same time, the slotless packing direct coefficient encoding method is adopted, which is compatible with the batch matching architecture of CRT multi-channel template binding. Only a single encrypted ciphertext needs to be uploaded to complete the one-to-many ciphertext similarity query. While ensuring the accuracy and security of fully homomorphic matching calculation, it effectively reduces the client's computing cost and transmission bandwidth pressure, and is suitable for efficient encrypted retrieval scenarios of large-scale template libraries.

[0045] Step S20: Upload the encrypted query ciphertext to the server so that the server can construct an automorphic base ciphertext based on the encrypted query ciphertext and perform shift and recombination operations to generate a dimension-wise query ciphertext. Then, based on the dimension-wise query ciphertext and the pre-stored template ciphertext, perform a homomorphic multiplication and addition inner product operation and superimpose a channel-aligned random mask to generate a masked return ciphertext block to complete the security threshold comparison and output the matching result.

[0046] In this embodiment, after the client completes the generation of the encrypted query ciphertext, it will send a unique single encrypted query ciphertext. The entire data is uploaded to the backend server without the need to upload plaintext feature data, intermediate parameters, or dimensional split ciphertext. Feature data is transmitted in ciphertext form throughout the process, ensuring the security of the transmission of query feature information.

[0047] After receiving the encrypted query ciphertext, the server performs basis transformation and shift / recombination processing on it based on the BGV polynomial ring automorphism operation characteristics, splitting it into dimension-wise query ciphertexts corresponding to each dimension, achieving lossless parsing from single ciphertext to multi-dimensional independent query ciphertexts. Subsequently, the server retrieves pre-encrypted ciphertexts of each identity template from the template library, performing homomorphic multiplication and cumulative addition operations on each block of the dimension-wise query ciphertext and template ciphertext, batch calculating the ciphertext inner product similarity score between each identity template and the query vector. To avoid plaintext score leakage and resist ciphertext analysis attacks, the server combines multi-channel alignment rules to overlay random masks of the corresponding channels on the batch similarity ciphertext scores, generating masked encrypted score ciphertext blocks, eliminating the risk of exposing the true score plaintext information. Finally, the server performs relinearization and rerandomization processing on the masked returned ciphertext blocks, completing ciphertext noise refresh and format regularization, and performing ciphertext domain security threshold comparison based on a preset security threshold, ultimately outputting either a valid matching identity result or a rejected matching result.

[0048] Through the methods described above, the client collects the vector to be matched, quantizes and encodes it using direct coefficients to generate encrypted query ciphertext. This encrypted query ciphertext is then uploaded to the server, which constructs an automorphic base ciphertext based on it and performs shift and recombination operations to generate a dimensional query ciphertext. The server then performs homomorphic multiplication-addition inner product operations on the dimensional query ciphertext and a pre-stored template ciphertext, and superimposes a channel-aligned random mask to generate a masked return ciphertext block. This completes the security threshold comparison and outputs the matching result. This method enables one-to-many similarity matching of high-dimensional feature vectors in a fully ciphertext domain, without disclosing the user's original plaintext feature data. Data privacy and security are guaranteed throughout the entire chain, from transmission and encoding to matching calculation. Furthermore, this solution abandons the traditional slot packing encoding method, adopting polynomial direct coefficient encoding combined with a client-side pre-multiplication modular inverse parameter correction strategy. This effectively avoids the noise accumulation problem of server-side homomorphic operations and improves the stability and computational accuracy of multi-layer homomorphic operations. In addition, the client only needs to encrypt once and upload a single ciphertext, which greatly reduces data transmission overhead and local computing load. It is suitable for batch retrieval scenarios of large-scale identity template libraries based on multi-channel binding. While ensuring matching accuracy and encryption security, it significantly improves the overall efficiency of ciphertext matching and retrieval, taking into account privacy, accuracy and practicality for engineering implementation.

[0049] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Before step S10, the ciphertext processing method further includes steps S01 to S03: Step S01: In response to the identity dynamic registration request, receive the original template vector of the identity to be registered and complete the vectorization process, and determine the extension parameters and extension factor inverses corresponding to the registration. In this embodiment, the client receives the original template vector of the registered identity, performs feature preprocessing and normalization vectorization, and obtains a template vector of dimension d to be registered. Subsequently, the registration scenario settings expand the size. And based on the plaintext modulus P, calculate the registration extension factor inverse. Simultaneously, the client receives candidate registration locations pre-allocated and temporarily locked by the server. ,in, Bind a block index to the target identity to be registered, which is used to locate the encrypted storage block in the template library; This is a polynomial coefficient location index, used to locate the storage location of polynomial coefficients within a single block; This is a CRT (Chinese Remainder Theorem) multi-channel index used to locate independent encrypted storage channels under a single coefficient. The client uses this candidate binding position to determine the target CRT channel corresponding to this registration, providing precise positional constraints for subsequent local channel update encoding.

[0050] Step S02: Construct the registration plaintext polynomial based on the extended parameters and the inverse of the extended factor; In this embodiment, the registered plaintext polynomial is divided into two payload segments: the first segment (d-dimensional) is used for uniqueness verification, and the second segment (d-dimensional) is used for template updating. This applies to candidate channels. Construct local update values Only candidate CRT channels retain valid values, while the remaining channels are set to zero. The concatenated polynomial yields the registered plaintext polynomial:

[0051] In the formula, For the modular inverse parameter corresponding to the registration expansion factor; Let be the integer quantization value of the i-th dimension of the template vector to be registered; for The value obtained by taking the modulus P of the plaintext; For the i-th dimension, the target candidate CRT channel The corresponding local update value; These are low-basic polynomial terms that carry uniqueness verification data. It is a high-order base term of the polynomial, carrying template update data.

[0052] Step S03: Encrypt the plaintext registration using a polynomial to obtain ciphertext registration, and upload the ciphertext registration to the server so that the server can complete the identity uniqueness verification and partial update of the template ciphertext.

[0053] In this embodiment, the plaintext registration is polynomial-wise encrypted to obtain a single ciphertext registration. The encrypted registration text is then uploaded to the server.

[0054] Through the methods described above, the client uses 2D dual-load encoding to carry registration deduplication and template update data in a single encrypted manner. Dynamic registration preprocessing can be completed with only a single encryption and a single upload, without the need to transmit plaintext data. This achieves a lightweight and highly secure dynamic encrypted registration function for the client.

[0055] Based on this, the embodiments of this application provide another encrypted text processing method, referring to... Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the encrypted text processing method of this application.

[0056] The method in this embodiment is applied to a server, which includes a computing server and an authentication / decision server. The ciphertext processing method includes steps S30-S70: Step S30: Receive the encrypted query ciphertext uploaded by the client. The encrypted query ciphertext is obtained by the client quantizing and directly encoding the feature vector to be matched and then encrypting it. Step S40: Construct an automorphic base ciphertext based on the encrypted query ciphertext, and perform a shift and recombination operation on the automorphic base ciphertext to output the dimension-by-dimensional query ciphertext; Please refer to Figure 4 , Figure 4 This diagram illustrates the query-side decoupling extension and suffix-aware shift butterfly reassembly. As shown in the diagram, this diagram corresponds to the suffix-aware shift butterfly reassembly decoupling architecture of the query ciphertext. The overall architecture adopts a multi-level iterative butterfly network, matching the pre-defined λ-layer hierarchical operation logic of this scheme. The architecture input is a single encrypted query ciphertext obtained by the client through direct coefficient encoding and pre-multiplication of the extension factor inverse. After the ciphertext input, self-isomorphic bases are generated in batches, and shared key switching preprocessing resources are used. Then, the representation domain is uniformly transformed and transferred to the coefficient domain at once. Subsequently, it is sent to a multi-layer butterfly reassembly network to calculate the suffix compensation shift amount layer by layer. Through cyclic shift and addition / subtraction branch operations, the target coefficients are aligned layer by layer, and vector components of different index categories are filtered. Finally, each leaf node of the butterfly network outputs a set of dimension-wise query ciphertexts.

[0057] Optionally, step S40 may include steps S41 to S44: Step S41: Generate multi-level automorphism indices based on preset extended level parameters, and calculate composite automorphism indices by combining extended indexes; In this embodiment, the computing server receives the query ciphertext. Then, the first stage of query expansion, namely the automorphic basis generation stage, is executed. Suppose the polynomial degree of the BGV polynomial ring satisfies... The query expansion size satisfies For each butterfly level Define the automorphic generation index In the formula, N is the polynomial ring degree, and v is the power parameter corresponding to the polynomial degree. This represents the total number of levels in the butterfly-shaped recombination. Let be the basic automorphic generation index of the h-th level. Since Since it is an even number, therefore If the number is odd, it can induce a valid negative cyclic ring automorphism.

[0058] Further expand the index Decomposed into binary form The composite automorphism index is obtained by iterative calculation based on the basic automorphism indices at each level: In the formula, For extended index The h-th bit value after binary decomposition This is the final composite automorphic index corresponding to the extended index.

[0059] Step S42: Construct the automorphic base ciphertext based on the encrypted query ciphertext and the composite automorphic index; In this embodiment, the composite automorphism index corresponding to each index obtained by the solution is used. The encrypted query ciphertext uploaded by the client is processed using a polynomial automorphism mapping to generate the corresponding automorphic view. Integrating all view ciphertexts yields a complete set of automorphic basis ciphertexts; where, (·) is a ciphertext automorphism operation used to inversely map a plaintext polynomial to x. This step performs ciphertext basis transformation preprocessing. It is preferable to execute this step in batches within the representation domain that adapts to automorphic operations and key switching, uniformly sharing preprocessing resources such as source ciphertext decomposition and RNS expansion, avoiding redundant key switching and preprocessing operations, and effectively reducing the system overhead of homomorphic computation.

[0060] Step S43: The automorphic basis ciphertext is converted to the coefficient domain, and a suffix-aware shift butterfly recombination operation is performed layer by layer to obtain the recombined leaf node ciphertext. In this embodiment, the batch-generated automorphic base ciphertexts are uniformly converted to the coefficient domain and subjected to a suffix-aware shift butterfly recombination operation. The purpose of this operation is to decouple and isolate the query classifications of each dimension from a single encrypted query ciphertext, achieving single-coefficient, single-dimensional semantic mapping. The recombination operation is set to... A butterfly-shaped hierarchy. In the h-th level, set the hierarchy window parameters. Combined with the current processing block index The local index j within the block and the composite automorphic suffix corresponding to the unprocessed level. The hierarchical compensation shift amount is obtained by solving. In the formula, The polynomial degree of the BGV polynomial ring is usually taken as a power of 2; The suffix-aware compensation shift amount is used to compensate for the automorphic suffix deviation that was not fully resolved, thereby aligning the positions of coefficients of the same type.

[0061] For each layer of paired sibling ciphertext states Perform update .in, This indicates multiplication at the level of plaintext polynomials. The negative cyclic coefficient shifting operation. Through multi-level iterative butterfly operations, the query coefficients of different indexes are filtered and classified layer by layer, and finally the separation and decoupling of all dimensional coefficients are completed at each node of the network.

[0062] Step S44: Perform local normalization shift processing on the recombined leaf node ciphertext to generate the dimension-by-dimensional query ciphertext.

[0063] In this embodiment, after the butterfly reassembly is completed, a local normalization displacement process is performed on the decoupled ciphertext corresponding to each leaf node. The dimensional coefficients carried in each leaf node are uniformly migrated to the position of the ciphertext constant coefficients, thus completing the ciphertext format regularization and obtaining standardized dimensional query ciphertext. Because the modular inverse parameter has been pre-multiplied during the client-side encoding stage. The fixed deterministic factor generated during the query expansion process can be completely canceled out by the client's pre-multiplication inverse, so that each set of dimension-wise query ciphertexts generated at the end precisely corresponds to the quantized value of a single dimension of the query vector in terms of plaintext semantics. No additional post-recovery multiplication operation is required, and it can be directly used for subsequent homomorphic inner product matching calculation of ciphertexts.

[0064] Through the above steps, this embodiment sequentially completes the automorphic exponent calculation, batch generation of automorphic bases, butterfly recombination of coefficient domains, and normalization shift processing. Relying on a suffix-aware compensation shift mechanism, it accurately offsets automorphic suffix deviations, achieving lossless dimensional decoupling of single-ciphertext direct coefficient encoding. This scheme significantly reduces ciphertext expansion overhead through batch preprocessing resource sharing, and, in conjunction with a client-side pre-correction encoding mechanism, eliminates post-compensation calculations. All dimensional decoupling operations are completed entirely within the ciphertext domain, with no plaintext feature leakage. It balances computational accuracy and operational efficiency, and can efficiently adapt to large-scale, high-dimensional feature-based ciphertext matching and retrieval scenarios.

[0065] Step S50: Perform a homomorphic multiplication-addition inner product operation based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext to obtain an encrypted fractional block; Understandably, since the dimensional query ciphertext has already undergone dimensional decoupling and format regularization in the pre-expansion stage, a single dimensional query ciphertext corresponds to only a single query dimension feature. Therefore, the matching stage does not need to perform complex transformation operations such as rotation, automorphism, and coefficient rearrangement. Thus, step S50 is executed, which simplifies the ciphertext matching calculation process and avoids the overhead of repeated ciphertext domain rearrangement and basis transformation, thereby achieving low-overhead, high-parallelism ciphertext similarity matching operation.

[0066] Optionally, step S50 may include steps S51 to S52: Step S51: Perform homomorphic multiplication operation between the ciphertext of each dimension and the pre-stored template ciphertext to obtain the ciphertext product of each feature dimension. In this embodiment, after completing the query ciphertext expansion process, the computing server obtains the dimension-by-dimensional query ciphertext. = Simultaneously, retrieve the pre-encrypted template ciphertexts of each dimension stored locally. For each binding block b, homomorphic multiplication is performed dimension-wise on the corresponding dimensional query ciphertext and template ciphertext to complete the ciphertext product mapping of the single-dimensional feature components. The semantics of the dimensional query ciphertext are that it carries the corresponding dimensional query quantization value only in the polynomial constant term. , and template polynomial After multiplication, at each coefficient position and the encrypted multiplicative integral formed in each CRT channel s* , where j represents the single registration identity template number stored within the binding block.

[0067] Step S52: Perform homomorphic cumulative inner product operation on the ciphertext product results corresponding to all dimensions to obtain an encrypted score block. The encrypted score block carries the encrypted similarity scores of multiple registered identities in parallel in different polynomial coefficient positions and different CRT channels.

[0068] In this embodiment, after completing d homomorphic multiplication operations, d-1 homomorphic cumulative addition operations are performed on the ciphertext products of all dimensions to complete the global inner product aggregation and obtain the ciphertext inner product result corresponding to the current bound block. This result corresponds to the similarity score of identity j. In the formula, Query vector number Integer quantized values ​​for each dimension, For the first The identity template vector of the th ... Integer quantized values ​​for each dimension.

[0069] After traversing all bound blocks within the system, the final number calculated by the server is: Each encrypted fractional block carries a maximum of [number] encrypted fractional blocks. Each encrypted fractional block carries a maximum of [number] encrypted fractional blocks at the coefficient and CRT channel levels. The encrypted similarity score of each registered identity is used to achieve parallel packaging, storage and output of multiple identity matching scores.

[0070] Through the above steps, based on the decoupling results of the pre-encrypted dimension, high-dimensional feature inner product matching calculations can be completed using only homomorphic multiplication and homomorphic addition. This avoids the complex ciphertext rearrangement and automorphic operations in the matching stage, significantly reducing the computational latency and resource overhead of batch identity matching. Simultaneously, by utilizing polynomial coefficients and the multi-channel parallel capability of CRT, parallel encrypted calculation and packaged storage of massive identity similarity scores are achieved. The entire process is based on ciphertext domain operations, with no plaintext score leakage. While ensuring matching security, this significantly improves the ciphertext retrieval and matching efficiency of large-scale identity template libraries.

[0071] Step S60: Use channel-aligned random mask to perform mask superposition processing on the encrypted fractional block to generate a mask-protected return ciphertext block; Understandably, to avoid the authentication / decision server directly obtaining the raw scores, this embodiment introduces a channel-aligned random mask before returning the score block. The purpose of this process is not to propose a new two-party secure computation protocol, but to convert the CRT (Chinese Remainder Theorem)-bound score block generated in the homomorphic matching phase into an addition-shared score interface that can be directly consumed by existing secure decision protocols.

[0072] Optionally, step S60 may include steps S61 to S62: Step S61: Combine the channel-aligned random masks of the same polynomial coefficient positions on different CRT channels to form a mask plaintext polynomial. In this embodiment, for each registered identity j in the template library, its storage location in the binding block is located. ,in, For block indexes, For the position of the coefficient, For the CRT channel index, determine the native modulus of the CRT channel corresponding to identity j. ,in, Let s be the modulus of the s-th native CRT channel. The computing server randomly samples within the corresponding modulus space. This serves as the channel-aligned random mask corresponding to identity j. For each bound block b, the channel-aligned random masks corresponding to different CRT sub-channels at the same polynomial coefficient position within the block are processed by CRT synthesis to obtain the mask plaintext polynomial. .

[0073] Step S62: Based on the mask plaintext polynomial and the encrypted fractional block, obtain the masked return ciphertext block.

[0074] In this embodiment, the computing server performs homomorphic addition on the generated plaintext polynomials of each bound block mask and the corresponding encrypted fractional blocks to achieve mask superposition processing, thereby obtaining the mask-protected encrypted fractional blocks. In the formula, For the first Each encrypted score block contains ciphertext similarity scores of multiple identities within that bound block. For the first The plaintext polynomial of the channel alignment mask for each bound block.

[0075] After masking, the plaintext semantics of identity j within the CRT channel are updated to... ,in, To query the integer similarity score between the vector and the template vector of identity j, This is the random mask corresponding to identity j. Let j be the native modulus of the CRT channel corresponding to identity j. Further relinearization and rerandomization are performed on the masked ciphertext. Ciphertext structural features are eliminated by superimposing fresh zero ciphertext or using equivalent circuit decryption, resulting in a return ciphertext block conforming to the standard ciphertext format.

[0076] Through the above steps, privacy desensitization of the original scores is achieved by introducing a channel-aligned random mask, preventing the authentication decision server from obtaining plaintext score information. At the same time, the CRT-bound ciphertext score block is standardized and converted into an additive sharing interface format that is compatible with existing security decision protocols. This eliminates the need to reconstruct the upper-layer security decision system and achieves seamless compatibility between the homomorphic ciphertext matching process and existing security decision protocols while ensuring data privacy and security.

[0077] Step S70: Decrypt the returned ciphertext block through the authentication / decision side to obtain the masked fraction, and perform a security threshold comparison based on the masked fraction share and the locally retained mask complementary share, and output the comparison result.

[0078] It should be noted that the security threshold can be a preset identity matching similarity judgment threshold. It is used to quantify the effectiveness of the match between the query vector and the registered identity template, and is the core criterion for determining whether identity authentication is successful.

[0079] Optionally, step S70 may include step S71: Step S71: Based on the masked score share and the locally retained mask complementary share, perform share restoration, score comparison and security threshold judgment in the secure computing protocol, and output the registered identity index or matching rejection flag that meets the security threshold.

[0080] In this embodiment, the masked ciphertext block returned by the computing server is decrypted by the authentication / decision server to obtain the masked score share corresponding to each registered identity j. Meanwhile, the compute server locally retains the complementary share corresponding to the random mask. The two parties form a similarity score addition-shared dual-share structure. The result can be obtained through dual-share superposition and reconstruction calculation. The system restores the true similarity score corresponding to each registered identity. A separate authentication / decision server can only obtain the score share after masking, and cannot obtain the true score; a separate calculation server does not have decrypted score data, thus eliminating the risk of one party stealing the plaintext matching score.

[0081] Next, the additive shared shares held by both parties will be used. As input, a two-party secure computation protocol is invoked to complete the privacy determination, specifically including security score comparison, maximum value filtering, and threshold judgment calculation. Due to the CRT channel modulus... It can fully cover the effective score range, and the score residuals corresponding to each identity can be uniquely mapped to standard signed integer similarity scores through a center-boosting method. The overall judgment process does not disclose the complete score vector, the maximum matching score value, or the neighbor identity information under conditions where the threshold is not met. If the highest true similarity score obtained after screening is greater than or equal to the safety threshold... If the highest score is lower than the target registered identity, then output the index number of the corresponding target registered identity; if the highest score is lower than the target registered identity, then output the index number of the target registered identity. Then the output will match the rejection symbol. To complete the identity authentication decision that ensures privacy and security.

[0082] Through the above steps, the privacy isolation and secure restoration of matching scores are achieved based on the addition score sharing mechanism. Threshold decisions are completed by relying on existing mature and secure computing protocols without the need for new security protocol architectures. On the basis of accurately completing identity matching verification, core privacy data such as matching scores and neighbor identities are protected throughout the process, avoiding the risk of plaintext score leakage, and taking into account the accuracy, security and feasibility of identity authentication.

[0083] Through the methods described above, the server constructs an automorphic base ciphertext based on the encrypted query ciphertext uploaded by the client, performs a shift and recombination operation on the automorphic base ciphertext, and outputs a dimension-wise query ciphertext. Based on the dimension-wise query ciphertext and the pre-stored template ciphertext, a homomorphic multiplication-addition inner product operation is performed to obtain an encrypted score block. The encrypted score block is then masked using a channel-aligned random mask to generate a masked return ciphertext block. The return ciphertext block is decrypted by the authentication / decision side to obtain the masked score, and a security threshold comparison is performed based on the masked score share and the locally stored mask complementary share, outputting the comparison result. This method achieves lossless dimensional decoupling and highly parallel ciphertext similarity matching of a single encrypted query ciphertext under the premise of full-process ciphertext domain operation and no plaintext features or score leakage. It significantly reduces homomorphic computation overhead by relying on shared preprocessing resources and lightweight butterfly iterative operations. Simultaneously, by constructing a two-party addition score sharing mechanism through a channel-aligned random mask, it effectively avoids the security risk of one party stealing the true matching score. Furthermore, this solution can be seamlessly adapted to existing security decision protocols without reconstructing the upper-layer judgment architecture. It only outputs the identity index or rejection flag, concealing all matching privacy data. While ensuring the accuracy and computational efficiency of high-dimensional feature identity authentication, it greatly improves the privacy security and engineering feasibility of the encrypted matching authentication process.

[0084] Based on the third embodiment of this application, in the fourth embodiment of this application, the content that is the same as or similar to that in the third embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 5 Before step S51, the ciphertext processing method further includes steps S510 to S513: Step S510: Collect and quantize the original feature vectors of each registered identity to obtain the identity template vector, which serves as the matching benchmark data for each registered identity. In this embodiment, raw biometric or behavioral feature data is collected, and the raw features are standardized and preprocessed. The normalization rules and integer quantization factors that are completely consistent with the client query vector and dynamic registration vector are used to complete the quantization conversion, unify the numerical range and dimensional specifications of all identity features, and obtain the quantization template vector of each identity.

[0085] Step S511: Perform dense binding layout processing on the identity template vectors of multiple registered identities to bind the template values ​​of multiple registered identities to different CRT channels of the same plaintext coefficient; In this embodiment, a channel-priority CRT dense binding layout is adopted to allocate storage locations for registered identity j, using triples. Unique identification, among which, Indicates binding block index, Indicates the position of polynomial coefficients. This represents the CRT channel index. The specific position allocation formula is: In the formula, To bind the range of values ​​for the block, The range of values ​​for the coefficients of the polynomial. This defines the value range for the CRT channel. For empty positions within the template library layout that are not filled with valid identities, zero values ​​are used to pad them, ensuring the integrity and regularity of the overall template layout. This layout method allows different independent CRT channels at the same polynomial coefficient position to carry template features of different identities within the same dimension, achieving dense binding and storage of multiple identity features.

[0086] Step S512: Perform channel synthesis on the template values ​​of multiple registered identities corresponding to different CRT channels under the same polynomial coefficient position to generate the corresponding plaintext coefficients; In this embodiment, after completing the identity location binding layout, for each binding block Each vector dimension Position of each coefficient Each CRT channel ,definition For the corresponding identity in the first The template value for the dimension; if there is no valid identity at that position, it is set to 0. Then, for the same coefficient position... On Each channel value is synthesized using CRT to obtain the plaintext coefficient. ;in, ... The coprime modulus corresponding to each CRT channel ensures that the data from each channel are independent and do not interfere with each other. The synthesized plaintext coefficients can simultaneously encapsulate the same-dimensional template features of multiple identities, achieving high-density packaging and integration of template data.

[0087] Step S513: Construct a template plaintext polynomial based on the plaintext coefficients, and encrypt the template plaintext polynomial to obtain template ciphertext.

[0088] In this embodiment, based on the integrated plaintext coefficients obtained by CRT synthesis at each location, a standardized template plaintext polynomial is constructed dimension-by-dimensional and block-by-block. In the formula, It is the r-th degree monomial basis term of the BGV polynomial ring. After the polynomial construction is completed, all template plaintext polynomials are encrypted using the system-preset BGV homomorphic encryption public key to generate the solidified encrypted template ciphertext. This completes the construction of the encrypted template library. Therefore, a single coefficient of a single template ciphertext can simultaneously carry the same-dimensional template features of t identities, and a single binding block can be stored in parallel at most... A encrypted template for a registered identity.

[0089] Further, please refer to Figure 6 , Figure 6 This is a schematic diagram illustrating the priority dense binding and encrypted result return of the CRT channel on the template side. Figure 6 As can be seen, this embodiment adopts a two-dimensional dense binding architecture of "polynomial coefficient position + CRT multi-channel". Using the binding block as the basic storage unit, it utilizes multiple independent CRT native channels to carry the same-dimensional template features of different registered identities in parallel under a single polynomial coefficient dimension, completely abandoning the inefficient storage mode of traditional single-identity single-ciphertext. The overall architecture has a clear hierarchy. First, it completes the regularization, quantization, and unique position allocation of batch identity features. Then, it achieves dense packaging of multiple identity features through CRT channel synthesis. Next, it constructs a template polynomial and encrypts it to generate standardized template ciphertext, ultimately forming a structured encrypted template library. This layout has strict positional uniqueness; each registered identity corresponds to a unique binding block, polynomial coefficient position, and CRT channel triplet index. The similarity score generated by subsequent matching is independently stored in a dedicated CRT channel, with no channel crosstalk or data aliasing. It can accurately extract single-identity matching results without cross-channel reconstruction operations, perfectly adapting to the front-end ciphertext dimension decoupled matching process, greatly improving the storage density of large-scale identity templates and the efficiency of one-to-many parallel matching.

[0090] The methods described above achieve high-density, tightly bound storage on the template side by leveraging the multi-channel isolation feature of CRT. This eliminates the need for independently configuring ciphertext resources for individual identities and dimensions, significantly reducing the storage overhead and key scheduling overhead of the encrypted template library. Simultaneously, the unique triplet position marking mechanism ensures that each identity template data and subsequent matching scores are independent, preventing channel crosstalk and data aliasing. It eliminates the need for complex cross-channel parsing operations, precisely adapts to the query-side ciphertext dimension decoupling extension mechanism, and ensures end-to-end ciphertext processing with no plaintext template leakage. This effectively improves the storage efficiency, parallel matching performance, and overall privacy security of large-scale identity ciphertext authentication systems.

[0091] Based on the third embodiment of this application, in the fifth embodiment of this application, the content that is the same as or similar to that in the third embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 7 Before step S30, the ciphertext processing method further includes steps S031 to S035: Step S031: Receive the registration ciphertext uploaded by the client, perform multi-way expansion processing on the registration ciphertext, and obtain the uniqueness check ciphertext and the template update ciphertext respectively; In this example, before the registration process begins, the computing server pre-allocates globally unused candidate binding positions for the currently registered identity. ,in, Bind a block index to the target of the identity to be registered; This is the index for the position of the polynomial coefficients; For CRT multi-channel indexing.

[0092] The server receives the encrypted registration text uploaded by the client. Then, based on the expansion size corresponding to the registration scenario. A 2D-way unified query extension process is performed on the registration ciphertext. Through the ciphertext butterfly decoupling extension interface, a single registration ciphertext is losslessly decomposed into a first d-way extended ciphertext and a last d-way extended ciphertext. The first d-way extended ciphertext serves as the uniqueness check ciphertext, used to implement deduplication of the ciphertext domain's private identity; the last d-way extended ciphertext serves as the template update ciphertext, used to implement subsequent partial incremental updates of the encrypted template library.

[0093] Step S032: Perform a private deduplication check by comparing the uniqueness check ciphertext with the pre-stored template ciphertext. In this example, the ciphertext for the first d-dimensional uniqueness check is called, and a ciphertext-domain homomorphic inner product matching operation is performed with all template ciphertexts in the server-pre-stored encrypted template library. The resulting encrypted score block is then input into the security decision layer, which invokes a mature two-party security comparison and threshold judgment protocol. Without disclosing the complete score vector or the maximum matching score, the system discreetly determines whether the identity to be registered is duplicated with an existing identity in the template library, achieving completely private registration uniqueness verification.

[0094] Step S033: If the verification shows that there is a duplicate registered identity, release the candidate binding position and terminate the registration; In this example, if the security decision layer outputs a matching identity, it determines that the currently registered identity is a duplicate registration object, and the registration verification fails. At this point, the server immediately unbinds the candidate location. The locked state releases the unused location resource, allowing it to participate in the subsequent new user registration location allocation. At the same time, it directly terminates the current dynamic registration process, refuses to add new templates, avoids duplicate identity entry, and ensures the uniqueness of identities in the template library.

[0095] Step S034: If no duplicate registration identity is found, confirm and submit the candidate binding location; In this embodiment, if the security decision layer outputs a rejection symbol The uniqueness check passed because no duplicate identity matching the currently registered identity was found in the template library. The server then formally submits and solidifies the currently pre-assigned candidate binding position. This location is marked as an occupied and valid registration location, which is used to carry the template data for the identity to be registered this time, thus completing the legal confirmation of the registration location.

[0096] Step S035: After identity deduplication verification, perform local coefficient shifting on the template update ciphertext, and then locally superimpose the shifted template update ciphertext onto the corresponding template ciphertext using homomorphic addition to achieve local update of the template ciphertext.

[0097] In this example, after passing the uniqueness check, the computing server uses it. An extended ciphertext update template library. For each dimension ,implement Because the plaintext semantics of the updated ciphertext only apply to candidate channels. The template value is carried within the specified block, and all other channels are zero. Therefore, this update only affects the template value in the specified block, the specified coefficient position, and the specified CRT channel, and does not affect the identity corresponding to other channels within the same coefficient. This registration method only requires local shifting and homomorphic addition, and does not require rebuilding the entire encrypted template library.

[0098] The methods described above, based on a unified ciphertext extension interface, achieve an integrated dynamic registration function that combines identity privacy deduplication and partial template updates. The entire process involves ciphertext domain operations with no plaintext feature leakage. A pre-locked, failure-release position management mechanism ensures the orderly and secure allocation of registration positions. Furthermore, it eliminates the need for reconstruction and re-encryption of the entire encrypted template library; inserting new identity templates is achieved solely through local shifting and homomorphic addition. This significantly reduces the computational overhead and system latency of dynamic registration, making it suitable for scenarios involving dynamic expansion and incremental updates of large-scale template libraries.

[0099] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the encrypted processing method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0100] This application also provides a encrypted text processing system; please refer to [link / reference]. Figure 8 The encrypted text processing system includes a client and a server. The client includes: The acquisition module 10 is used to acquire the vector to be matched, and to quantize and directly encode the vector to be matched to generate encrypted query ciphertext. The upload module 20 is used to upload the encrypted query ciphertext to the server, so that the server can construct an automorphic base ciphertext based on the encrypted query ciphertext and perform a shift and recombination operation to generate a dimension-wise query ciphertext. Based on the dimension-wise query ciphertext and the pre-stored template ciphertext, the server performs a homomorphic multiplication and addition inner product operation and superimposes a channel-aligned random mask to generate a masked return ciphertext block, so as to complete the security threshold comparison and output the matching result. The server includes: The receiving module 30 is used to receive the encrypted query ciphertext uploaded by the client. The encrypted query ciphertext is obtained by the client quantizing and directly encoding the feature vector to be matched and then encrypting it. The extended recombination module 40 is used to construct an automorphic base ciphertext based on the encrypted query ciphertext, and perform a shift recombination operation on the automorphic base ciphertext to output the dimension-by-dimensional query ciphertext. The inner product calculation module 50 is used to perform homomorphic multiplication and addition inner product operations based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext to obtain encrypted fractional blocks; The mask processing module 60 is used to perform mask superposition processing on the encrypted fractional block using a channel-aligned random mask to generate a mask-protected return ciphertext block; The security comparison module 70 is used to decrypt the returned ciphertext block through the authentication / decision side to obtain the masked fraction, and perform a security threshold comparison based on the masked fraction share and the locally retained mask complementary share, and output the comparison result.

[0101] The ciphertext processing system provided in this application, employing the ciphertext processing method in the above embodiments, can solve the technical problems of high communication overhead, high computational loss, and weak privacy protection in existing solutions. Compared with the prior art, the beneficial effects of the ciphertext processing system provided in this application are the same as those of the ciphertext processing method provided in the above embodiments, and other technical features of the ciphertext processing system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0102] This application provides a ciphertext processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the ciphertext processing method in Embodiment 1 above.

[0103] The following is for reference. Figure 9 The diagram illustrates a structural schematic of a ciphertext processing device suitable for implementing embodiments of this application. The ciphertext processing device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 9 The encrypted processing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0104] like Figure 9As shown, the encrypted text processing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the encrypted text processing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the encrypted processing device to communicate wirelessly or wiredly with other devices to exchange data. Although encrypted processing devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0105] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0106] The encrypted text processing device provided in this application, employing the encrypted text processing method in the above embodiments, can solve the technical problems of high communication overhead, high computational loss, and weak privacy protection in existing solutions. Compared with the prior art, the beneficial effects of the encrypted text processing device provided in this application are the same as those of the encrypted text processing method provided in the above embodiments, and other technical features in this encrypted text processing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0107] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0108] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0109] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the encrypted processing method in the above embodiments.

[0110] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0111] The aforementioned computer-readable storage medium may be included in the encrypted processing device; or it may exist independently and not be assembled into the encrypted processing device.

[0112] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the ciphertext processing device, the ciphertext processing device performs the following actions: The client collects the vector to be matched, performs quantization and direct coefficient encoding, generates encrypted query ciphertext, and uploads it to the server; The server constructs an automorphic base ciphertext based on the encrypted query ciphertext, performs a shift and recombination operation on the automorphic base ciphertext, and outputs a dimension-wise query ciphertext; The server performs a homomorphic multiplication and addition inner product operation on the dimension-wise query ciphertext and a pre-stored template ciphertext to obtain an encrypted fractional block; The server performs mask superposition processing on the encrypted fractional block using a channel-aligned random mask to generate a masked return ciphertext block; The server decrypts the return ciphertext block to obtain the masked fractional share, performs a security threshold comparison based on the masked fractional share and the locally stored mask complementary share, and outputs the comparison result.

[0113] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0115] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0116] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described ciphertext processing method. This solves the technical problems of high communication overhead, high computational cost, and weak privacy protection in existing solutions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the ciphertext processing method provided in the above embodiments, and will not be repeated here.

[0117] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the ciphertext processing method described above.

[0118] The computer program product provided in this application can solve the technical problems of high communication overhead, high computational cost, and weak privacy protection in existing solutions. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the encrypted text processing method provided in the above embodiments, and will not be repeated here.

[0119] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for processing encrypted text, characterized in that, The ciphertext processing method is applied to the client, and the method includes: Collect the vector to be matched, and quantize and directly encode the vector to generate encrypted query ciphertext; The encrypted query ciphertext is uploaded to the server so that the server can construct an automorphic base ciphertext based on the encrypted query ciphertext and perform shift and recombination operations to generate a dimension-wise query ciphertext. Based on the dimension-wise query ciphertext and the pre-stored template ciphertext, the server performs a homomorphic multiplication and addition inner product operation and superimposes a channel-aligned random mask to generate a masked return ciphertext block to complete the security threshold comparison and output the matching result.

2. The encrypted text processing method as described in claim 1, characterized in that, The step of quantizing and directly encoding the vector to be matched to generate encrypted query ciphertext includes: The vector to be matched is normalized, and the normalized vector to be matched is quantized using a preset quantization factor to obtain the quantized value corresponding to the vector to be matched. Based on the query expansion size, the modular inverse parameter corresponding to the multiplication factor is calculated to obtain the modular inverse parameter corresponding to the vector to be matched. Based on the quantization value and the modulus inverse parameter, construct the probe plaintext polynomial; The probe plaintext polynomial is encrypted using a preset public key to obtain the encrypted query ciphertext.

3. The encrypted text processing method as described in claim 1, characterized in that, Before the step of acquiring the vector to be matched, quantizing and directly encoding the vector to be matched, and generating encrypted query ciphertext, the following steps are included: In response to the dynamic identity registration request, the system receives the original template vector of the identity to be registered and performs vectorization processing to determine the extension parameters and extension factor inverses corresponding to the registration. Construct the registration plaintext polynomial based on the expansion parameters and the inverse of the expansion factor; The plaintext registration is encrypted using a polynomial to obtain ciphertext registration, which is then uploaded to the server for identity uniqueness verification and partial update of the template ciphertext.

4. A method for processing encrypted text, characterized in that, The encrypted processing method is applied to the server side, and the method includes: The client receives encrypted query ciphertext uploaded by the client. The encrypted query ciphertext is obtained by quantizing and directly coefficient encoding the feature vector to be matched by the client and then encrypting it. Based on the encrypted query ciphertext, an automorphic base ciphertext is constructed, and a shift and recombination operation is performed on the automorphic base ciphertext to output the dimension-by-dimensional query ciphertext. Based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext, a homomorphic multiplication-addition inner product operation is performed to obtain an encrypted fractional block; The encrypted fractional block is masked by channel-aligned random masking to generate a masked return ciphertext block. The returned ciphertext block is decrypted by the authentication / decision side to obtain the masked fraction. A security threshold comparison is then performed based on the masked fraction share and the locally retained mask complementary share, and the comparison result is output.

5. The encrypted text processing method as described in claim 4, characterized in that, The steps of constructing an automorphic base ciphertext based on the encrypted query ciphertext, performing a shift and recombination operation on the automorphic base ciphertext, and outputting the dimension-by-dimensional query ciphertext include: Multi-level automorphism indices are generated based on preset extended level parameters, and composite automorphism indices are calculated by combining extended indexes. The automorphic base ciphertext is constructed based on the encrypted query ciphertext and the composite automorphic index; The self-isomorphic basis ciphertext is transformed to the coefficient domain, and a suffix-aware shift butterfly recombination operation is performed hierarchically to obtain the recombined ciphertext of each leaf node. The recombined leaf node ciphertext is subjected to local normalized displacement processing to generate the dimension-by-dimensional query ciphertext.

6. The encrypted text processing method as described in claim 4, characterized in that, The step of performing a homomorphic multiplication-addition inner product operation based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext to obtain the encrypted fractional block includes: Perform homomorphic multiplication operations on the ciphertext of each dimension query and the pre-stored template ciphertext to obtain the ciphertext product of each feature dimension. Homomorphic accumulation inner product operation is performed on the ciphertext product results corresponding to all dimensions to obtain encrypted score blocks, wherein the encrypted score blocks carry encrypted similarity scores of multiple registered identities in parallel in different polynomial coefficient positions and different CRT channels; Before performing homomorphic multiplication operations on the ciphertext for each dimension and the pre-stored template ciphertext to obtain the ciphertext product corresponding to each feature dimension, the process includes: Collect and quantify the original feature vectors of each registered identity to obtain identity template vectors, which serve as the matching benchmark data for each registered identity; The identity template vectors of multiple registered identities are densely bound to each other in a layout so that the template values ​​of multiple registered identities are bound to different CRT channels of the same plaintext coefficient. For template values ​​of multiple registered identities corresponding to different CRT channels at the same polynomial coefficient position, channel synthesis is performed to generate the corresponding plaintext coefficients; Based on the plaintext coefficients, a template plaintext polynomial is constructed, and the template plaintext polynomial is encrypted to obtain the template ciphertext.

7. The encrypted text processing method as described in claim 6, characterized in that, The step of performing masking and superimposing on the encrypted fractional block using a channel-aligned random mask to generate a masked return ciphertext block includes: The channel-aligned random mask on different CRT channels with the same polynomial coefficient position is synthesized to form a mask plaintext polynomial. Based on the mask plaintext polynomial and the encrypted fractional block, the masked returned ciphertext block is obtained.

8. The encrypted text processing method as described in claim 7, characterized in that, The step of performing a security threshold comparison based on the masked fraction share and the locally retained masked complementary share, and outputting the comparison result, includes: Based on the masked score share and the locally retained masked complementary share, the share restoration, score comparison and security threshold judgment are performed in the secure computing protocol, and the registered identity index or matching rejection flag that meets the security threshold is output.

9. The encrypted text processing method as described in claim 4, characterized in that, Before the step of receiving the encrypted query ciphertext uploaded by the client, the following steps are included: Receive the registration ciphertext uploaded by the client, perform multi-way expansion processing on the registration ciphertext, and obtain the uniqueness check ciphertext and the template update ciphertext respectively; The uniqueness check is used to perform a private deduplication verification between the encrypted text and the pre-stored template encrypted text; If duplicate registrations are found during verification, the candidate binding location is released and registration is terminated. If no duplicate registration is found, confirm and submit the candidate binding location; After identity verification, the template update ciphertext is subjected to local coefficient shifting, and the shifted template update ciphertext is locally superimposed onto the corresponding template ciphertext in a homomorphic addition manner to achieve local update of the template ciphertext.

10. A encrypted text processing system, characterized in that, The encrypted text processing system includes a client and a server; The client includes: The acquisition module is used to acquire the vector to be matched, and to quantize and directly encode the vector to be matched to generate encrypted query ciphertext; The upload module is used to upload the encrypted query ciphertext to the server, so that the server can construct an automorphic base ciphertext based on the encrypted query ciphertext and perform a shift and recombination operation to generate a dimension-wise query ciphertext. Based on the dimension-wise query ciphertext and the pre-stored template ciphertext, the server performs a homomorphic multiplication and addition inner product operation and superimposes a channel-aligned random mask to generate a masked return ciphertext block, so as to complete the security threshold comparison and output the matching result. The server includes: The receiving module is used to receive encrypted query ciphertext uploaded by the client. The encrypted query ciphertext is obtained by the client quantizing and directly encoding the feature vector to be matched and then encrypting it. An extended recombination module is used to construct an automorphic base ciphertext based on the encrypted query ciphertext, and perform a shift recombination operation on the automorphic base ciphertext to output a dimension-by-dimensional query ciphertext. The inner product calculation module is used to perform homomorphic multiplication and addition inner product operations based on the dimension-by-dimensional query ciphertext and the pre-stored template ciphertext to obtain encrypted fractional blocks; The masking module is used to perform masking overlay processing on the encrypted fractional block using a channel-aligned random mask to generate a mask-protected return ciphertext block. The security comparison module is used to decrypt the returned ciphertext block through the authentication / decision side to obtain the masked fraction, and perform a security threshold comparison based on the masked fraction share and the locally retained mask complementary share, and output the comparison result.