Industrial plants increasingly send their sensor streams to an outside party, such as an equipment vendor or a cloud monitoring service, that owns the anomaly model. The plant does not want that party to see its raw operating data. Homomorphic encryption, a way of doing arithmetic directly on encrypted numbers, looks like the natural fix. In practice it breaks exactly where monitoring is hardest: when the plant switches pumps, opens valves, or changes setpoints. During these routine transitions the sensor signals swing violently, and detectors trained on steady operation raise false alarms. The detectors that handle these swings best are deep, recurrent, or spectral models. Their operations (softmax, Fourier transforms, sigmoid gates, long hidden-state memory) cannot run under encryption, either at all or without enormous cost. Detectors that do run under encryption keep a running internal state, and that state overflows the encrypted number space within seconds. The known fix is to periodically reset that state, which injects artificial jumps that look like faults.
This note proposes a way around the dilemma. It is aimed at the setting where the plant keeps the decryption key and the monitoring server is honest but curious. Most of what makes a transient look like a fault is that the detector does not know the plant was commanded to change. A detector that predicts each sensor from a short, fixed window of past measurements and the plant's own actuator commands has no running state to overflow and no reset to cause spikes. Its circuit is shallow enough to evaluate under CKKS (an encryption scheme for approximate real-number arithmetic) with no bootstrapping. We will test on real water-plant testbeds whether this "command-aware" linear detector closes most of the false-alarm gap to deep plaintext models, and whether conclusions drawn in simulation about encrypted monitoring survive contact with real data.
Core Claim
The trade-off between encryption and handling transients is mostly an artifact of two things: recursive detector designs, and ignoring the actuator signals the plant already records. We claim that a finite-window, command-conditioned residual detector achieves the following on SWaT and WADI:
- Its false-alarm rate inside transition windows is close to that of the best plaintext deep detector.
- It runs under CKKS at fixed multiplicative depth three, indefinitely, with no resets.
- It shows the reset-induced false alarms of recursive encrypted monitors to be far worse on real telemetry than simulation suggests.
The detector predicts measurement vector $y_t$ as
$$\hat y_t = \sum_{k=1}^{p} A_k\, y_{t-k} + \sum_{k=0}^{q} B_k\, u_{t-k} + \sum_{k=1}^{p}\sum_{i} C_{k,i}\, u^{(i)}_{t}\, y_{t-k},$$
where the terms are defined as follows:
- $u_t$ is the vector of recorded actuator states (pump on/off, valve positions).
- $u^{(i)}_t$ is its $i$-th entry.
- $A_k, B_k, C_{k,i}$ are the vendor's plaintext weight matrices.
The last term lets the plant's dynamics change when an actuator flips. This captures, crudely, the regime-dependent coupling (such as pressure–flow interactions) that a single linear model misses.
The anomaly score over a window of length $W$ is
$$s_t = \sum_{j=0}^{W-1} \big\| \Sigma^{-1/2}(y_{t-j} - \hat y_{t-j}) \big\|^2,$$
where $\Sigma$ is the residual covariance estimated on normal data. Because every prediction uses measured rather than predicted past values, nothing accumulates across windows. The depth budget is:
- one ciphertext–ciphertext product for the actuator-switching terms;
- one plaintext-weight product;
- one squaring for the score.
The plant decrypts only the scalar $s_t$ and compares it to its own threshold.
Relation to Prior Work
Two papers motivate the gap and one constrains the design.
Secure and Private Implementation of Dynamic Controllers Using Semi-Homomorphic Encryption runs a linear dynamic controller under Paillier encryption. It shows that without intervention the controller overflows in 1.2 seconds at a 10 ms sampling period, and it fixes this with periodic state resets. It evaluates only on a simulated batch reactor and never asks what the reset jumps do to an anomaly detector. We remove the recursive state instead of resetting it, and we measure the reset penalty directly.
A time–frequency contrastive learning model for anomaly detection in multivariate time series (TFCL) shows that pure temporal reconstruction residuals confuse coordinated multi-sensor transients with anomalies. It fixes this with Transformer and FFT encoders and learned gating, which are operators encryption cannot carry. We ask how much of TFCL's advantage survives when the transient information comes from actuator commands rather than from deep spectral features.
Securing Approximate Homomorphic Encryption Using Differential Privacy constrains the design. It proves that CKKS leaks key information through decrypted outputs unless calibrated Gaussian noise is added at decryption. Decrypting a single scalar score per window, rather than a residual vector, is our response. We will quantify the noise-induced false alarms rather than assume they are negligible.
Three further papers supply method or context:
- Security of Cyber-Physical Systems in the Presence of Transient Sensor Faults supports a window-bounded view of transients through its sliding-window fault model and pairwise sensor-inconsistency checks. It is plaintext and centralized, and it concedes that attackers who stay inside the error envelope escape detection.
- SAFENet: A Secure, Accurate and Fast Neural Network Inference supplies the standard route for making deep networks encryption-friendly: replacing activations channel by channel with low-degree polynomials. It was validated only on static images.
- Privacy-Preserving Distributed Optimal Power Flow with Partially Homomorphic Encryption and Helen: Maliciously Secure Coopetitive Learning for Linear Models show that restricting to linear or ADMM-structured computation is what makes encrypted pipelines practical. Neither touches time-series transients.
Finally, A Change Detection Reality Check supplies the methodological stance. That paper found that apparent gains of complex models vanished against a carefully tuned simple baseline once benchmark flaws were removed. We apply the same discipline to encrypted monitoring.
Research Program
We will build the command-aware detector in plaintext first. We fit $A_k, B_k, C_{k,i}$ by ridge regression on the normal-operation portion of SWaT (51 features) and WADI (127 dimensions), choosing $p$, $q$, and $W$ by validation. We then port it to CKKS with packed slots. We will fix parameters so that depth three fits without bootstrapping, and record latency per window against the 10-second sampling used for SWaT in Graph Attention Network and Informer for Multivariate Time Series Anomaly Detection. Latency matters because ML Confidential: Machine Learning on Encrypted Data reports a slowdown of 6–7 orders of magnitude for encrypted operations. Whether a shallow circuit stays within real-time budgets is therefore an empirical question, not a given.
Next we define transition windows from the data itself: intervals starting at any recorded actuator state change and lasting until the affected sensors settle. We report every metric separately inside and outside these windows. This split is the core measurement the literature lacks: aggregate F1 hides whether a detector's errors concentrate at transitions.
We will then run two stress studies:
- Decryption noise. We add Gaussian noise to the decrypted score at the magnitudes the IND-CPAD analysis requires and measure the false-alarm increase inside versus outside transition windows.
- Simulation versus reality. We run a reset-based recursive encrypted monitor, built as a Paillier Luenberger-style observer with resets in the manner of Murguia et al., on both their chemical batch reactor simulation and on SWaT. We compare the false-alarm cost of resets in each setting.
The threat model is explicit and limited. The server is semi-honest: it follows the protocol and learns only ciphertexts. The plant holds the key. Physical attacks arrive through the sensor stream, as in SWaT's attack scenarios. A server that returns falsified scores is out of scope. We will state this plainly rather than claim malicious security, since Helen shows what such verification costs even for static linear models.
Baselines
Do nothing. The reference point is a steady-state residual detector with a static threshold: the same finite-window linear model with the actuator terms removed. It shows how badly transitions hurt a naive monitor. It is run under encryption with identical data splits and threshold selection.
Classical engineering fix. The second reference is masking, meaning suppression of alarms for a fixed period after every actuator change, applied to the same naive detector. It is the obvious way to use the command signals without modeling them. Beating it means equal or better transition-window false alarms without masking's blind spot. We will measure that blind spot as the fraction of SWaT attacks whose onset falls inside a masked interval and which are missed or delayed.
Strongest plaintext competitors. These are TFCL, which reports F1 of 92.50% on SWaT and 92.44% on WADI with a WADI false-negative rate of about 9.6% (TFCL), and the LSTM detector with F-measure 0.802 on SWaT (Anomaly Detection for a Water Treatment System Using Unsupervised Machine Learning). TFCL is the strongest because it was designed precisely to stop transient multi-sensor coordination from dominating scores. We will re-run TFCL and our detector on identical splits and the same event-level scoring rule, with comparable hyperparameter search budgets. We do not simply quote reported numbers, because scoring conventions on SWaT differ across papers.
Our encrypted detector does not need to beat TFCL overall. Success is defined as follows:
- in-transition false-alarm rate within a small margin of TFCL's;
- overall F1 at or above the LSTM figure;
- all of this while encrypted.
No reported result was found on Lacuna for any encrypted anomaly detector on SWaT or WADI, so there is no published encrypted number to beat.
Strongest encrypted competitors. The first is the reset-based recursive monitor described above, which is the only encryption-native design for stateful monitoring in the file. It runs with the same encryption library and hardware. The second is a SAFENet-style polynomialized version of a compact recurrent or convolutional detector, given an equal latency budget. Its only reported numbers are on CIFAR (for example, a 61% latency reduction versus Delphi at 85.1% accuracy for CNN-7), so its behavior on transients is untested.
Ablations. The key ablation removes $B_k$ and $C_{k,i}$, the command terms, while keeping everything else fixed. If transition-window false alarms do not fall substantially when these terms are restored, the central claim fails. A second ablation removes only the switching products $C_{k,i}$. This tests whether the extra multiplicative depth pays for itself.
Why not just…?
Why not just run the detector in plaintext at the plant and send only alarms? When the plant owns the model, this is simply better, and we concede it. The proposal targets the case where the model is the vendor's intellectual property or is pooled across sites, and the plant cannot host it. Our design keeps the weights in plaintext on the server and only the data encrypted, which is the cheaper direction. Scoping the claim to this setting is deliberate.
Why not just mask alarms during known switching events? Masking uses the same command signals but discards the monitoring they could enable, leaving assets unwatched when stress is highest. The masking baseline measures this directly. If masking matches our detector on missed attacks near transitions, the modeling adds nothing and we will report that. We expect it to lose because several SWaT attacks manipulate actuators themselves, so attack onsets coincide with command changes.
Why not just add differential privacy noise to telemetry and use any plaintext detector? The power-flow comparison in Privacy-Preserving Distributed Optimal Power Flow with Partially Homomorphic Encryption found that DP needed 79–576 iterations against 35 for encryption and degraded solution quality. Noise on raw telemetry also raises the residual floor exactly where transients already crowd the threshold. We will include a local-DP-on-inputs run at the noise levels matching our decryption-noise study, so the two privacy mechanisms are compared on the same false-alarm axis.
Why not just polynomialize a deep detector like TFCL? This is a real threat if low-degree approximations hold up on these signals. The concern is that wide input swings during transients push inputs outside the range the polynomials were fit on, where they diverge. The SAFENet-style baseline settles this: if it matches TFCL at acceptable latency, our shallow design is unnecessary. We will specifically report its false alarms inside transition windows, where divergence would appear.
Proposed Experiments
The decisive experiment is the transition-window breakdown on SWaT and WADI. It compares the encrypted command-aware detector, its no-command ablation, masking, the reset-based monitor, the polynomialized network, TFCL, and the LSTM. The metrics are:
- false alarms per hour inside and outside transition windows;
- event-level precision, recall, and F1;
- detection delay;
- encrypted latency per window and total multiplicative depth.
The central claim is supported if two things hold:
- The command terms cut in-transition false alarms by a large fraction while overall F1 stays at or above the LSTM figure.
- The encrypted run stays numerically indistinguishable from plaintext over the full multi-day recordings.
The second experiment sweeps decryption-noise magnitude and plots how the in-transition false-alarm increase compares with the steady-state increase. This makes the security–accuracy cost from the IND-CPAD result concrete for monitoring.
The third experiment tests the simulation-to-reality question. We compute the ratio of reset-induced false alarms on real SWaT data to the ratio in the batch reactor simulation. A ratio well above one would show that simulation-only evaluation of encrypted controllers and monitors, as in the reset paper, understates their operational cost.
Two outcomes would falsify the approach:
- the command terms fail to help;
- the polynomialized deep model dominates at equal latency.
References
- Secure and Private Implementation of Dynamic Controllers Using\n Semi-Homomorphic Encryption
- A time–frequency contrastive learning model for anomaly detection in multivariate time series
- Securing Approximate Homomorphic Encryption Using Differential Privacy
- Security of Cyber-Physical Systems in the Presence of Transient Sensor Faults
- SAFENet: A Secure, Accurate and Fast Neural Network Inference
- Privacy-Preserving Distributed Optimal Power Flow With Partially Homomorphic Encryption
- Helen: Maliciously Secure Coopetitive Learning for Linear Models
- A Change Detection Reality Check
- Graph Attention Network and Informer for Multivariate Time Series Anomaly Detection
- ML Confidential: Machine Learning on Encrypted Data
- Anomaly Detection for a Water Treatment System Using Unsupervised Machine Learning