When the Noise Envelope Reached the Threshold: Tracing a Drift in Encrypted 1-to-N Face Search

The symptom was a slow rise in near-threshold mismatches on an encrypted 1-to-N facial search. The embedding model, the gallery quality and the decision threshold had not changed. Every component still passed its own tests. The fault sat between them: a CKKS pipeline whose approximation error had grown until it was the same size as the score margin the matcher depended on.

The trigger was a sensible change

The gallery outgrew a single ciphertext packing, so the pipeline gained extra rotation-and-sum depth for a wider slot layout and an encrypted top-k step built on a polynomial approximation of the comparison function. Moving to a larger ring dimension would have cost latency the service could not absorb, so the extra multiplicative depth had to fit inside the existing modulus chain, and the encoding scale was cut to 30 bits. Each change was reviewed, each was correct on its own terms, and the precision check run afterwards on random unit vectors came back clean. That sequence is the trigger. It tells you when the behaviour changed, but not why the system was unable to absorb the change, and a blameless review has to keep those two questions apart.

The assumption that stopped holding

The original design rested on an unwritten contract: decrypted cosine scores could be treated as exact, because CKKS error was negligible next to the decision margin. When the system was built that was true. The circuit was shallow, one inner product between L2-normalised 512-dimensional embeddings followed by decryption, and it ran at a generous scale. CKKS error is neither fixed nor uniform, though. It compounds with depth and grows as the scale shrinks. On top of that, the sign polynomial used for encrypted comparison is least accurate near zero, which is exactly where genuine and impostor score distributions overlap. Random-vector tests sample the bulk of the distribution, where nothing is at stake, so they reported health while the error envelope at the threshold grew by roughly an order of magnitude (an estimate from post-incident replay). No single person broke the contract. It was never written down, so no change process existed that would have checked it.

What kept the system honest

The drift showed up as rising referral volume and not as wrong identifications, thanks to a design choice made for unrelated reasons: scores falling inside an abstention band around the threshold were never auto-decided, and instead went to a second encrypted comparison running in a separate, shallow, wide-scale context with its own keys.

The rule to write down, and the cost it carries

The decision rule that follows is simple to state and easy to audit. The half-width of the abstention band must exceed the worst-case error envelope measured on pairs sampled near the threshold, and that measurement must be repeated whenever depth, scale, packing or the approximation polynomial changes. When the rule fails, there are two options: widen the band, which costs referral volume and latency, or restore precision with a larger ring or bootstrapping, which costs compute. The biometric template protection and performance-testing standards from the ISO/IEC SC 37 family define irreversibility, unlinkability and match error rates, but they say nothing about arithmetic error inside the matcher. That error budget therefore has to sit in the test report alongside FMR and FNMR as a first-class result. The fallback path that saved this system also carries a cost. It doubles the key material that must be rotated in lockstep. It also becomes the next single point of failure if gallery growth keeps pushing more traffic into the band, so the next decision is whether to fund bootstrapping in the primary path or cap gallery size per ciphertext shard and keep the circuit shallow.

Why not decrypt the scores server side and compare them in plaintext, which removes the approximation error entirely?

Because the score vector is itself sensitive. Exposing similarity values across a 1-to-N gallery gives a server, or an attacker on it, the oracle it needs for template reconstruction and cross-database linkage, and that undoes the non-leakage property that justifies homomorphic matching in the first place. The decryption key belongs with the relying party, and the server should only ever learn the minimal decision, which is why precision has to be managed inside the encrypted domain and not worked around.

Back to FHEID · Domains

← Back to FHEID
Engineering & Architecture Brief

When the Noise Envelope Reached the Threshold: Tracing a Drift in Encrypted 1-to-N Face Search

The symptom was a slow rise in near-threshold mismatches on an encrypted 1-to-N facial search. The embedding model, the gallery quality and the decision threshold had not changed. Every component still passed its own tests. The fault sat between them: a CKKS pipeline whose approximation error had grown until it was the same size as the score margin the matcher depended on.

The trigger was a sensible change

The gallery outgrew a single ciphertext packing, so the pipeline gained extra rotation-and-sum depth for a wider slot layout and an encrypted top-k step built on a polynomial approximation of the comparison function. Moving to a larger ring dimension would have cost latency the service could not absorb, so the extra multiplicative depth had to fit inside the existing modulus chain, and the encoding scale was cut to 30 bits. Each change was reviewed, each was correct on its own terms, and the precision check run afterwards on random unit vectors came back clean. That sequence is the trigger. It tells you when the behaviour changed, but not why the system was unable to absorb the change, and a blameless review has to keep those two questions apart.

The assumption that stopped holding

The original design rested on an unwritten contract: decrypted cosine scores could be treated as exact, because CKKS error was negligible next to the decision margin. When the system was built that was true. The circuit was shallow, one inner product between L2-normalised 512-dimensional embeddings followed by decryption, and it ran at a generous scale. CKKS error is neither fixed nor uniform, though. It compounds with depth and grows as the scale shrinks. On top of that, the sign polynomial used for encrypted comparison is least accurate near zero, which is exactly where genuine and impostor score distributions overlap. Random-vector tests sample the bulk of the distribution, where nothing is at stake, so they reported health while the error envelope at the threshold grew by roughly an order of magnitude (an estimate from post-incident replay). No single person broke the contract. It was never written down, so no change process existed that would have checked it.

What kept the system honest

The drift showed up as rising referral volume and not as wrong identifications, thanks to a design choice made for unrelated reasons: scores falling inside an abstention band around the threshold were never auto-decided, and instead went to a second encrypted comparison running in a separate, shallow, wide-scale context with its own keys.

The rule to write down, and the cost it carries

The decision rule that follows is simple to state and easy to audit. The half-width of the abstention band must exceed the worst-case error envelope measured on pairs sampled near the threshold, and that measurement must be repeated whenever depth, scale, packing or the approximation polynomial changes. When the rule fails, there are two options: widen the band, which costs referral volume and latency, or restore precision with a larger ring or bootstrapping, which costs compute. The biometric template protection and performance-testing standards from the ISO/IEC SC 37 family define irreversibility, unlinkability and match error rates, but they say nothing about arithmetic error inside the matcher. That error budget therefore has to sit in the test report alongside FMR and FNMR as a first-class result. The fallback path that saved this system also carries a cost. It doubles the key material that must be rotated in lockstep. It also becomes the next single point of failure if gallery growth keeps pushing more traffic into the band, so the next decision is whether to fund bootstrapping in the primary path or cap gallery size per ciphertext shard and keep the circuit shallow.

Technical FAQ: Why not decrypt the scores server side and compare them in plaintext, which removes the approximation error entirely?

Because the score vector is itself sensitive. Exposing similarity values across a 1-to-N gallery gives a server, or an attacker on it, the oracle it needs for template reconstruction and cross-database linkage, and that undoes the non-leakage property that justifies homomorphic matching in the first place. The decryption key belongs with the relying party, and the server should only ever learn the minimal decision, which is why precision has to be managed inside the encrypted domain and not worked around.

Related Architecture Specifications (PQCECOSYSTEM): pqcsmartaccount.com · wcbdcvault.com · cancryptography.com

More Technical Articles on fheid.com

Benchmarking Modern FHE Libraries: OpenFHE, Microsoft SEAL, and Zama Concrete for Identity →Homomorphic Biometrics in International Border Control and Smart Airport Infrastructure →The Hub Template: How an Unchecked Norm Broke Encrypted 1-to-N Face Search →