In federated learning, clients train a shared model on data that never leaves their devices and send back only model updates. Those updates still leak: an attacker who sees one can often solve for the training images that produced it. Homomorphic encryption, which lets a server add encrypted numbers without decrypting them, closes this leak. The cost is steep, because encrypting a full update inflates it roughly 100 to 1,000 times. Selective encryption lowers that cost by encrypting only a small fraction of update coordinates, chosen for being most revealing. Current selection rules were designed and tested on a single gradient step over identically distributed data. Real deployments look different. Clients take many local steps on skewed data, so their models drift apart, and their updates split into two parts: a shared part that points roughly where every client is heading, and a client-specific part that records this client's data.
This proposal argues that the client-specific part is where the leakage lives. It is also the part that existing selection rules spend the least of their encryption budget on. The server learns the aggregate update after every round anyway, so encrypting coordinates where a client simply agrees with everyone else protects almost nothing. We propose to rank coordinates for encryption by how far a client's update departs from a public estimate of the consensus direction, such as the previous aggregate or a drift-correction control variate. We will test whether this rule reaches a target protection level with far fewer encrypted coordinates than magnitude-based selection, and whether that advantage grows with data skew and with the number of local steps.
Core Claim
Let $\Delta_i$ be client $i$'s multi-step update in a round, and let $\bar\Delta$ be a reference direction every party already knows. Candidates for $\bar\Delta$ are last round's decrypted aggregate or SCAFFOLD's global control variate $c$. The residual is
$$r_i = \Delta_i - \bar\Delta .$$
We encrypt the $s$ coordinates with the largest $|r_i|$ and send the rest in plaintext. The claim is that under non-IID data with several local steps, this rule reaches a fixed reconstruction-resistance target, measured by the perceptual similarity (LPIPS) between reconstructed and true images, at a markedly smaller encrypted fraction $s/d$ than the gradient-magnitude rule. The argument rests on what the attacker already knows. A curious server subtracts the known consensus from any plaintext coordinate, so information about a client's data enters mainly through $r_i$. Magnitude ranking instead favors coordinates that are large because all clients move there together.
The closest work is Evaluating Selective Encryption Against Gradient Inversion Attacks. It compares four masks (gradient magnitude, parameter magnitude, their product, and a Hessian sensitivity score) and finds that the gradient-magnitude mask meets LPIPS ≥ 0.3 with 10% to 40% of elements encrypted at zero selection overhead. All of its evaluations use a single step at batch size 1 with no client heterogeneity. That paper supplies our method template and our strongest baseline. We change the ranking signal and the regime. SHE-LoRA takes a different route: clients negotiate one global set of columns to encrypt, and the paper shows that encrypting 0.03% of parameters defeats exact analytical inversion. A shared mask is exactly what non-IID drift should break, because each client's most revealing coordinates differ. We treat that mask as a baseline, not as the method.
Mechanism and Threat Model
The adversary is an honest-but-curious server. It follows the protocol, sees the plaintext coordinates of each client update and every decrypted aggregate, and runs passive reconstruction. Active attacks are out of scope as a primary target, and we state why. One active attack uses a "fishing model": the server edits batch-normalization parameters so that it can recover labels from securely aggregated sums (Breaking Secure Aggregation). That attack operates on the aggregate itself, which no per-client masking can hide. It was also derived for single-step training only. We will report whether it survives multi-step drift, but only as a side measurement.
Aggregation works with per-client masks under additive homomorphic encryption. For each coordinate, the server encrypts any plaintext contributions under the public key and adds them to the ciphertext contributions. Ciphertexts therefore arise only on the union of client masks, while each client uploads only its own $s$ ciphertexts.
Per-client masks open a new side channel: which coordinates a client chose to encrypt. Under label skew, that index pattern may reveal the client's class mix. We treat this as a first-class risk, not a footnote. The research program measures it directly and tests one mitigation. The mitigation selects masks at the granularity of blocks, such as whole output rows or filters, and pads each mask with randomly chosen decoy blocks until it reaches a fixed budget. The decoys cost extra encrypted coordinates, and we will measure exactly how many.
Drift correction adds a second payload to protect. In SCAFFOLD, clients also transmit control-variate updates $\Delta c_i$ (SCAFFOLD). Under SCAFFOLD's standard update rule, $\Delta c_i$ is an affine function of $\Delta_i$. It therefore leaks the same information and can reuse the same mask at no extra selection cost. No prior work evaluates this auxiliary channel as a reconstruction target. BadSFL shows that control variates carry exploitable trajectory information, but it studies backdoor injection, not privacy.
Research Program
We will build a simulator that combines three existing pieces:
- Local training. Multi-step local training under FedAvg, SCAFFOLD, and FedDC, a method that tracks an explicit local drift variable.
- Encryption. Selective additive encryption with Paillier or CKKS, reporting real ciphertext sizes and encryption times.
- Attack. The update-matching reconstruction attack from Gradient Inversion Attacks Beyond SGD. It matches simulated optimizer updates to received updates and remains partially effective up to 8 local steps and batch size 16. That makes it the right attacker for the multi-step regime; the original single-step attack would understate leakage there.
The attacker sees plaintext coordinates, sees ciphertext positions as missing, and knows $\bar\Delta$. We will give it the strongest masked variant we can build: it may use the aggregate to impute the encrypted coordinates, and it may optimize only on the visible ones.
The analysis has three parts.
- Protection per encrypted byte. We map the encrypted fraction needed to reach LPIPS ≥ 0.3 across a grid of Dirichlet skew levels, local-step counts, and batch sizes, for each mask rule.
- Choice of reference. We compare three choices of $\bar\Delta$: the previous aggregate, SCAFFOLD's $c$, and a zero vector. The zero-vector case recovers pure magnitude ranking and serves as the internal ablation. This asks whether the drift-correction machinery supplies a better reference than a stale aggregate.
- Mask-pattern leakage. We train a classifier that predicts each client's label histogram from its sequence of mask patterns across rounds. We report its accuracy with and without decoy padding, and the extra encrypted fraction the decoys cost.
Baselines
Naive reference points. The first is plaintext FedAvg, SCAFFOLD, and FedDC with nothing encrypted. This sets the leakage ceiling and the accuracy ceiling. The second is full encryption of every coordinate. This sets the protection ceiling and the cost ceiling, which the selective-encryption literature places at roughly 100 times plaintext size. The accuracy ceiling can be checked against published numbers. On a 100-client non-IID CIFAR-10 setup, FedDC reports 84.32% accuracy against 79.14% for FedAvg and 82.96% for SCAFFOLD (FedDC). We will reproduce this setup so that our unencrypted runs are anchored to that number.
Strongest existing method. The main competitor is the gradient-magnitude mask from Evaluating Selective Encryption Against Gradient Inversion Attacks, applied to the full multi-step update. It is the strongest competitor because it already protects against optimization attacks at 10% to 40% encryption with no selection overhead. Our rule must beat it on its own terms. Its reported figure is that it meets LPIPS ≥ 0.3 at 10% to 40% encryption on single-step, batch-size-1 updates. For fairness, both rules receive the same encryption budgets, the same models, partitions, attacker, and attack iteration budget. Attacker hyperparameters are tuned separately against each mask with equal budgets. Beating this baseline means reaching LPIPS ≥ 0.3 at a smaller encrypted fraction, meaning at least a factor of two fewer coordinates, at matched model accuracy, in the skewed, many-local-step settings. In the single-step IID cell we expect roughly a tie, and a tie there is the predicted outcome, not a failure.
Shared-mask competitor. A SHE-LoRA-style globally negotiated mask, built from averaged importance scores and applied to all clients, isolates whether per-client adaptivity matters (SHE-LoRA). It has no mask-pattern side channel, so our method must beat it even after paying for decoy padding.
Compression-plus-encryption reference. EdgeDetect binarizes gradients and aggregates them under Paillier encryption. It reports lowering inversion PSNR from 31.7 dB for undefended FedAvg to 15.1 dB (EdgeDetect). It is a relevant reference for PSNR, but it was reported on intrusion-detection data, so we will rerun it on our image benchmarks, not compare against its published figure.
Key ablation. Setting $\bar\Delta = 0$ turns our rule back into magnitude ranking. This isolates the single ingredient we claim matters: subtracting the known consensus before ranking.
Why not just…?
Why not just keep using the gradient-magnitude mask? This is the real threat. It may be that, even under drift, large coordinates are exactly the client-specific ones, in which case the residual rule adds nothing. No reported result on Lacuna covers the multi-step, non-IID regime, so the file cannot settle this question in either direction. The experimental grid settles it. If the encrypted-fraction curves for magnitude and residual ranking coincide at high skew and 8 local steps, the core claim is false, and we would report that magnitude masking transfers to realistic federated training.
Why not just add differential-privacy noise to the updates? Adding calibrated noise gives a formal bound, but at a utility cost. Two findings in the file make it a weak fit here. Noise is amplified through LoRA's matrix products (SHE-LoRA). Added noise also increases the dissimilarity between client updates, which SCAFFOLD's analysis ties to slower FedAvg convergence (SCAFFOLD). We will still include a noise-only arm tuned to the same LPIPS target and report the accuracy it gives up. That comparison, not an argument, decides the question.
Why not just let drift correction shrink the residual so leakage disappears on its own? If SCAFFOLD makes client updates nearly identical, there may be little private signal left to protect. The update-matching attack stays partially effective at 8 local steps (Gradient Inversion Attacks Beyond SGD), and SCAFFOLD adds an unprotected channel, $\Delta c_i$. We will measure plaintext reconstruction quality under SCAFFOLD and FedDC against FedAvg. If drift correction alone brings LPIPS above 0.3, selective encryption is unnecessary in that regime, and we would say so.
Why not just use secure aggregation or full encryption? Both hide individual updates entirely. Full encryption pays the roughly 100× size penalty that selective schemes exist to avoid. Selective encryption at small budgets plus decoy padding exists precisely for clients that cannot afford that penalty. We report both cost and protection against the full-encryption ceiling, so a reader can see what the savings buy.
Proposed Experiments and Decisive Checks
Main benchmark. CIFAR-10 and CIFAR-100, split across 20 to 100 clients by Dirichlet label skew with β ∈ {0.1, 0.5, 100}. Local steps K ∈ {1, 2, 4, 8}, batch sizes B ∈ {1, 4, 16}, using a small CNN and a ResNet-18. For each cell we attack a randomly chosen client in rounds early, middle, and late in training.
Metrics.
- Protection: PSNR, LPIPS, and label-recovery accuracy.
- Cost: encrypted fraction and real ciphertext bytes per round.
- Utility: final test accuracy and rounds to target accuracy.
- Side channel: mask-pattern label-inference accuracy.
Secondary text benchmark. BERT fine-tuned on SST-2 under label skew, attacked with the optimization-based text attack (LAMP) and the analytical text attack (DAGER) used in Evaluating Selective Encryption Against Gradient Inversion Attacks. This tests whether the residual rule also handles analytical attacks, where parameter-magnitude masks were previously needed.
Decisive check 1: advantage should grow with drift. The ratio of encrypted fractions, magnitude rule over residual rule, needed to reach LPIPS ≥ 0.3 should be near 1 at β = 100, K = 1 and should rise monotonically as β falls and K grows. A flat ratio falsifies the claim.
Decisive check 2: the side channel must not eat the savings. With decoy padding, mask-pattern label inference should fall to near chance. The total encrypted fraction, including decoys, must stay below both the magnitude rule and the shared mask at equal protection. If it does not, per-client masking is not worth its leakage, and the recommendation reverts to a shared residual mask computed from the public reference alone.
Decisive check 3: no accuracy cost. Selective encryption changes only what is hidden, not the arithmetic of aggregation. Final accuracy under every mask should therefore match the corresponding plaintext run to within seed variance. Any gap would indicate an implementation error in the mixed plaintext and ciphertext aggregation, not a property of the method.
References
- Evaluating Selective Encryption Against Gradient Inversion Attacks
- SHE-LoRA: Selective Homomorphic Encryption for Federated Tuning with Heterogeneous LoRA
- Breaking Secure Aggregation: Label Leakage from Aggregated Gradients in Federated Learning
- SCAFFOLD: Stochastic Controlled Averaging for Federated Learning
- BadSFL: Backdoor Attack against Scaffold Federated Learning
- FedDC: Federated Learning with Non-IID Data via Local Drift Decoupling and Correction
- Gradient Inversion Attacks Beyond SGD
- EdgeDetect: Importance-Aware Gradient Compression with Homomorphic Aggregation for Federated Intrusion Detection