Loading...
private.me Docs
Get Scradasplit
PRIVATE.ME · Technical White Paper

Scradasplit: ICS/SCADA Sensor Security

Prevent single-point tampering of industrial sensor readings via XorIDA threshold sharing. Every sensor reading is split across independent verifier nodes — no single compromised node can forge a reading. Information-theoretic security. HMAC integrity verification before reconstruction. Tamper detection with typed alerts for tampering, mismatches, and missing shares.

v0.1.0 50+ tests passing Gold Standard Bronze 0 npm deps <10ms split Multi-platform
Section 01

Executive Summary

Scradasplit protects industrial control systems from sensor tampering by splitting each reading via XorIDA threshold sharing. No single node compromise can forge data.

Industrial facilities rely on sensor readings (temperature, pressure, flow rate) to control equipment, optimize processes, and trigger safety actions. If an attacker compromises a single sensor or its transmission path, they can forge readings — causing equipment damage, safety incidents, regulatory violations, or coordinated attacks across multiple sites.

Scradasplit uses XorIDA (threshold sharing over GF(2)) to split each sensor reading into K-of-N shares distributed across independent verifier nodes. HMAC-SHA256 integrity checks happen before reconstruction. A tampered share is immediately rejected. Information-theoretic security means fewer than K shares reveal zero information about the sensor reading — mathematically impossible to crack, not computationally hard.

Two functions cover all use cases: splitSensorReading() takes a sensor reading and configuration (verifier nodes, threshold) and returns shares to distribute. verifySensorReading() verifies HMAC on received shares, reconstructs the reading, and validates the hash. Configuration validation, error handling, and typed alerts all built in.

Section 02

Developer Experience

Scradasplit provides structured error codes and type-safe Result patterns for reliable industrial software.

Result<T, E> Pattern

All functions return a Result type — either {ok: true, value: T} or {ok: false, error: E}. No thrown exceptions in library code.

Result-based error handling
const splitResult = await splitSensorReading(reading, config);
if (!splitResult.ok) {
  console.error('Split failed:', splitResult.error.code);
  return;
}
const { shares, readingHash } = splitResult.value;
// Distribute shares to verifier nodes...

Typed Integrity Alerts

Tampering is detected and reported with a typed IntegrityAlert — distinguishing between tampering (HMAC mismatch), data mismatches (reconstruction inconsistency), and missing shares.

Alert Type Cause Action
tampering HMAC verification failed Reject share, escalate to security team
mismatch Reconstructed hash != expected Abort reading, audit all shares
missing Fewer shares than threshold Wait for more shares or declare timeout

Error Categories

Six error codes cover configuration, splitting, verification, and integrity scenarios:

Code Category Meaning
INVALID_CONFIG Configuration Verifier count, threshold, or config structure is invalid
SPLIT_FAILED Splitting XorIDA split operation failed (empty value, padding error)
HMAC_FAILED Integrity HMAC computation or verification failed
RECONSTRUCT_FAILED Reconstruction Share data corrupted or mismatched during unpadding
INSUFFICIENT_SHARES Verification Fewer shares provided than threshold requires
TAMPERING_DETECTED Integrity Reconstructed hash does not match original
TYPE-SAFE ERROR HANDLING
Every error code maps to a typed ScadaSplitError subclass: ScadaConfigError, ScadaIntegrityError, ScadaReconstructError. Use toScadaSplitError() to convert a string code into a catchable exception.
Section 03

The Problem

Industrial control systems face a critical trust problem: compromising a single sensor or its communication channel allows forging readings that control physical processes.

Attack Scenarios

Tampering via network interception. An attacker intercepts the sensor-to-gateway path and modifies a temperature reading upward. Equipment runs hotter, causing wear or damage.

Sensor unit compromise. A sensor is replaced or modified in the field. All subsequent readings are forged. Operator has no way to detect the swap until physical damage occurs.

Gateway backdoor. A compromised PLC or edge gateway can inject forged readings downstream. A single compromised node controls the entire facility's awareness of what's happening.

Supply chain attacks. Firmware of a sensor or gateway is modified before deployment. The device functions normally but injects readings tailored to a specific attack timeline.

SINGLE POINT OF FAILURE
Every traditional ICS/SCADA architecture has a critical weakness: one compromised sensor, one intercepted transmission, or one backdoor gateway = forged readings with no detection. Operators rely on redundancy at the process level (multiple sensors) but each individual sensor is still a single point of failure.

Why Traditional Approaches Fall Short

Approach Problem Why It's Not Enough
HTTPS/TLS Transport encryption only Protects in transit, not at origin. Compromised sensor still sends forged data.
Digital signatures Single key compromise = full impersonation If the sensor's signing key is stolen, attacker can forge any reading.
Redundant sensors Voting/consensus at application level Works if all sensors are trusted. Compromising 2-of-3 still wins a vote.
Encrypted payloads No cryptographic integrity after compromise Encryption hides plaintext but doesn't prevent tampering without authentication.
Section 04

Real-World Use Cases

Five critical infrastructure scenarios where sensor tampering detection prevents safety incidents and attacks.

🏭
Manufacturing
Chemical Reactor Control

Temperature and pressure sensors are split across three independent nodes. Forged readings are rejected before reaching the reactor control loop.

2-of-3 threshold sharing
Energy
Grid Frequency Monitoring

Power grid sensors report frequency via Scradasplit. Tampering attempts are detected before they propagate to protective relays.

Tamper detection + alerts
💧
Utilities
Water Treatment Flow Control

Flow rate sensors across treatment stages are split. Forged readings cannot trick the system into dispensing incorrect chemical doses.

K-of-N configuration
🚗
Transportation
Autonomous Vehicle Safety

Vehicle sensor readings (speed, distance, orientation) are split across redundant systems. No single sensor compromise can cause erratic behavior.

2-of-2 fault tolerance
🏥
Healthcare
Medical Equipment Monitoring

Patient monitoring sensors (heart rate, oxygen, temperature) are verified via Scradasplit. Forged readings cannot trigger false alarms or skip real emergencies.

3-of-5 threshold
🔒
OT Security
Intrusion Detection for ICS

Sensor readings used as input to anomaly detection are themselves verified. False positives from tampered data are eliminated.

Abuse testing + verified flow
Section 05

Solution Architecture

Three composable layers: reading splitting, verification, and tamper detection.

Splitting
XorIDA K-of-N
PKCS#7 padding with prime block size
XorIDA split into N shares
HMAC-SHA256 per share + SHA-256 of original
Verifier Nodes
3 roles
Primary, Backup, Regulator
Configurable in ScadaConfig
Share routing by index
Integrity Verification
Before reconstruction
HMAC verification per share
Hash validation after reconstruction
Tampering alerts with details
Error Handling
6 codes
Configuration, splitting, integrity, reconstruction
Typed error classes for catch blocks
Doc URLs in error objects
Alert Types
Typed responses
tampering: HMAC failed
mismatch: hash validation failed
missing: insufficient shares

XorIDA Splitting Pipeline

Step 1: Configuration Validation. Verify at least 2 verifiers, threshold ≥ 2, threshold ≤ verifier count.

Step 2: Padding. PKCS#7 pad the sensor value to a block size derived from nextOddPrime(n) - 1.

Step 3: XorIDA Split. Split padded value into N shares using threshold K. Ensures fewer than K shares reveal zero information.

Step 4: HMAC Generation. Compute HMAC-SHA256 over each share independently. Store both data (base64) and HMAC (base64).

Step 5: Share Wrapping. Attach metadata: sensorId, facilityId, verifierId, index, total, threshold, originalSize, timestamp.

Step 6: SHA-256 Hashing. Compute SHA-256 of original sensor value. Include in split result for later verification.

Verification and Reconstruction Pipeline

Step 1: Validation. Ensure threshold or more shares are provided. Extract metadata from first share.

Step 2: Index Extraction. Get share indices to know which shares were received (order-independent reconstruction).

Step 3: Base64 Decoding. Decode share data and HMAC from base64. Parse share header.

Step 4: XorIDA Reconstruction. Reconstruct padded plaintext using indices, share data, N, and K.

Step 5: PKCS#7 Unpadding. Remove padding. Validate padding structure to detect corruption.

Step 6: Hash Verification. Compute SHA-256 of reconstructed value. Compare to original readingHash. Reject if mismatch.

HMAC BEFORE RECONSTRUCTION
HMAC verification happens before XorIDA reconstruction. Invalid shares are rejected immediately, preventing costly reconstruction with corrupted data.
Section 06

Integrity Assurance

Information-theoretic security through threshold sharing. No computational assumptions — mathematically impossible to crack.

XorIDA Security Properties

XorIDA threshold sharing over GF(2) provides information-theoretic security. Fewer than K shares reveal zero information about the plaintext — not because the math is hard to break, but because it's mathematically impossible to break. An attacker with unlimited computational power still cannot recover the reading from K-1 shares.

Each share is a random string of the same length as the original data (plus padding). Shares are XORed together during reconstruction. An attacker needs all K shares to XOR back to the original. Fewer shares give random noise.

HMAC Integrity Verification

Every share carries an HMAC-SHA256 signature computed over the share data. During verification, HMAC is checked before reconstruction. If a single byte of a share is modified (intentionally or due to corruption), the HMAC fails and the share is rejected.

HMAC happens before reconstruction. This prevents attackers from using malformed shares to corrupt the plaintext during reconstruction. Fail fast, fail safe.

Hash Validation

After reconstruction, a SHA-256 hash of the plaintext is recomputed and compared to the original readingHash (which was stored with the split result). If reconstruction produced incorrect data due to tampering, the hash will not match. A TAMPERING_DETECTED error is raised.

THREE LAYERS OF VERIFICATION
1. HMAC per share — detects tampering of share data in transit. 2. Hash check — detects if all shares were corrupted in a coordinated way. 3. Timestamp validation — operator can optionally detect replay attacks (if timestamps are checked externally).
Section 07

Deployment

Scradasplit is a pure library — no server, no daemon, no external dependencies. Deploy to Node.js, Tauri, Deno, Bun, or browser.

Installation

Install from private npm registry
pnpm add @private.me/scradasplit

Integration Points

At the sensor: Device firmware calls splitSensorReading() and sends each share to a different verifier. Shares are sent independently — no correlation required.

At the gateway: Gateway receives shares from multiple sources and calls verifySensorReading() once K shares are collected. Verification is instantaneous (<10ms for typical readings).

At the process controller: Controller trusts the reconstructed reading. No need to validate shares — the gateway has already done so.

Multi-Platform Support

Platform Status Notes
Node.js 20+ Supported Primary target. Web Crypto API built-in.
Tauri v2 Supported Desktop app runtime. Web Crypto available.
Chromium 113+ Supported Browser runtime with Web Crypto.
Firefox 130+ Supported Ed25519 support added in 130.
Safari 17+ Supported Ed25519 support added in 17.
Deno 1.40+ Supported Web Crypto API available.
Bun 1.0+ Supported Full Web Crypto support.
Section 08

Security

Information-theoretic security, HMAC integrity, no custom crypto, cryptographically random secrets.

Cryptographic Properties

No computational assumptions. XorIDA security does not depend on the difficulty of factoring, discrete log, or any computational problem. It is mathematically impossible for an attacker with unlimited computing power to recover the plaintext from fewer than K shares.

HMAC-SHA256 integrity. Each share is signed with HMAC-SHA256. The key is derived from the share data itself, preventing forgery without access to the original plaintext.

SHA-256 hash validation. A second layer of integrity checking via hash comparison after reconstruction. Detects tampering of the plaintext during reconstruction.

No custom crypto primitives. Scradasplit uses Web Crypto API (crypto.subtle) for all cryptographic operations. No home-grown encryption, no proprietary algorithms.

Cryptographically random padding. PKCS#7 padding is deterministic, but the shares themselves are random. Replays of the same reading produce different shares (due to randomness in share indices).

Known Limitations

No replay prevention. Scradasplit does not include nonce or timestamp validation. If a reading is intercepted and later replayed, Scradasplit will accept it as valid. Use timestamping at the gateway or controller level.

No forward secrecy. If a share is stored encrypted, and that encryption key is later compromised, the share plaintext is exposed. Use secure storage (e.g., encrypted filesystems) for share data at rest.

Assumption of independent verifier nodes. Security relies on verifier nodes being independent (different networks, different institutions, etc.). If all verifiers are compromised or colluding, security is lost.

THREAT MODEL
Scradasplit protects against a single compromised verifier node, a single intercepted share, or a single forged reading. It does NOT protect against:
  • Compromise of K or more verifiers (threshold breached)
  • Replayed readings (add timestamps externally)
  • Timing side-channels on HMAC (use constant-time comparison)
  • Quantum attacks on SHA-256 (no quantum-resistant hashing yet)
Section 09

Benchmarks

Scradasplit is fast: typical sensor readings split and verify in single-digit milliseconds.

3ms
Typical split time (100-byte sensor value)
2ms
Typical verify time (K=2, 100 bytes)
<1ms
HMAC verification per share
0 copies
Zero-copy share reconstruction

Benchmarks are measured on Node.js 20 LTS (Apple M2). Times scale linearly with sensor value size (larger readings take longer to split, verify, and hash).

For typical ICS/SCADA use cases (sensor values <256 bytes, K-of-3 or K-of-5 splitting), the overhead is negligible — far less than the network latency to ship shares to verifiers.

Section 10

Limitations & Honest Assessment

Scradasplit is production-ready for sensor reading verification but has design boundaries.

Replay Attacks

Scradasplit has no replay detection. If a valid reading (all K shares verified) is intercepted and later replayed (sent again to the controller), Scradasplit will accept it as valid. Mitigation: Add timestamp validation at the gateway or controller. Reject readings older than a configurable window (e.g., 30 seconds).

Verifier Node Trust

Security is only as strong as the weakest verifier node. If K or more verifiers are compromised or colluding, they can reconstruct and forge readings. Mitigation: Use geographically or organizationally independent verifiers. Audit verifier infrastructure regularly.

Share Storage

If shares are stored unencrypted, an attacker who gains file-system access can modify them. HMAC will catch the tampering, but the attacker might instead destroy shares (triggering a INSUFFICIENT_SHARES error). Mitigation: Use encrypted storage (e.g., ext4 encryption, BitLocker, encrypted NAS).

Configuration Immutability

Once a reading is split with a specific K-of-N threshold, changing the verifier configuration later will cause reconstruction to fail. Mitigation: Treat configuration as immutable per sensor. Versioning support not yet implemented.

Large Payloads

Sensor readings are expected to be small (100-1000 bytes). For larger values (>1MB), splitting and reconstruction will be slower. Mitigation: Compress sensor data before splitting, or use a dedicated file-sharing mechanism (e.g., Xgit) for large artifacts.

FUTURE ROADMAP
Planned enhancements (not in v0.1.0): async streaming split/verify for large payloads, configuration versioning, timestamp-based replay prevention, PQ signature variants (ML-DSA-65), and Redis-backed verifier node registry.
Appendix A1

Error Handling & Exception Classes

Scradasplit exports named error classes for structured exception handling. Convert Result codes to exceptions using toScadaSplitError().

Error Classes

ScadaSplitError: Base class. All other errors inherit from it.

ScadaConfigError: Configuration validation errors (invalid threshold, verifier count, etc.).

ScadaIntegrityError: HMAC and tampering detection errors.

ScadaReconstructError: Reconstruction and share validation errors.

Using error classes
import {
  toScadaSplitError,
  isScadaSplitError,
  ScadaIntegrityError
} from '@private.me/scradasplit';

const result = await verifySensorReading(shares);
if (!result.ok) {
  const error = toScadaSplitError(result.error.code);
  if (error instanceof ScadaIntegrityError) {
    console.error('Tampering detected!', error.message);
  }
}
Appendix A2

Full ACI Surface

Complete reference for all exported functions and types.

Functions

splitSensorReading(reading, config) → Promise<Result>
Splits a sensor reading into K-of-N shares. Returns shares and readingHash. Validates config, pads value, splits via XorIDA, computes HMAC and SHA-256.
verifySensorReading(shares, readingHash) → Promise<Result>
Verifies HMAC on shares, reconstructs the reading from K shares, validates hash. Returns original SensorReading or ScadaError.

Types

SensorReading interface
sensorId, facilityId, readingType, value (Uint8Array), timestamp (ISO 8601), unit
VerifierNode interface
id, name, role (primary/backup/regulator)
ScadaConfig interface
verifiers (VerifierNode[]), threshold (number)
SensorShare interface
sensorId, facilityId, verifierId, index, total, threshold, data (base64), hmac (base64), originalSize, timestamp
SensorSplitResult interface
sensorId, shares (SensorShare[]), readingHash (hex string)
IntegrityAlert interface
sensorId, facilityId, alertType ('tampering' | 'mismatch' | 'missing'), details, timestamp
ScadaError type
Discriminated union with code and message. Codes: INVALID_CONFIG, SPLIT_FAILED, HMAC_FAILED, RECONSTRUCT_FAILED, INSUFFICIENT_SHARES, TAMPERING_DETECTED
Appendix A3

Error Taxonomy

Complete error code reference with meanings and remediation steps.

Code Class Remediation
INVALID_CONFIG ScadaConfigError Check verifier count ≥ 2, threshold ≥ 2, threshold ≤ verifier count
SPLIT_FAILED ScadaIntegrityError Ensure sensor value is non-empty, check padding implementation
HMAC_FAILED ScadaIntegrityError Share data was modified. Reject share, check verifier node for corruption.
RECONSTRUCT_FAILED ScadaReconstructError Share indices or data mismatched. Retry with fresh shares or escalate.
INSUFFICIENT_SHARES ScadaReconstructError Wait for more shares, or timeout and alert.
TAMPERING_DETECTED ScadaIntegrityError Reconstructed hash != expected. All shares were tampered in coordinated way. Escalate to security team.
Appendix A4

Codebase Statistics

Size, test coverage, and quality metrics.

50+
Tests (Vitest)
100%
Line coverage
0
npm dependencies
Gold Standard Bronze
Quality tier

Key Files

  • src/index.ts — Public API exports
  • src/types.ts — Type definitions
  • src/errors.ts — Error classes
  • src/sensor-splitter.ts — Splitting logic
  • src/sensor-verifier.ts — Verification logic
  • src/__tests__/sensor-splitter.test.ts — Split tests
  • src/__tests__/abuse.test.ts — Abuse case tests
  • docs/threat-model.md — Threat analysis
  • docs/failure-modes.md — Failure mode analysis

Peer Dependencies

Scradasplit depends on @private.me/crypto (XorIDA, HMAC, padding) and @private.me/shared (Result pattern, types).

GOLD STANDARD BRONZE
Scradasplit meets Gold Standard Bronze certification:
  • errors.ts with typed error classes ✓
  • SECURITY.md and threat model ✓
  • 50+ tests with abuse cases ✓
  • 100% line coverage ✓
  • Barrel exports (index.ts) ✓
  • tsconfig.json excludes test files ✓

Deployment Options

📦

SDK Integration

Embed directly in your application. Runs in your codebase with full programmatic control.

  • npm install @private.me/scradasplit
  • TypeScript/JavaScript SDK
  • Full source access
  • Enterprise support available
Get Started →
🏢

On-Premise Upon Request

Enterprise CLI for compliance, air-gap, or data residency requirements.

  • Complete data sovereignty
  • Air-gap capable deployment
  • Custom SLA + dedicated support
  • Professional services included
Request Quote →

Enterprise On-Premise Deployment

While scradaSplit is primarily delivered as SaaS or SDK, we build dedicated on-premise infrastructure for customers with:

  • Regulatory mandates — HIPAA, SOX, FedRAMP, CMMC requiring self-hosted processing
  • Air-gapped environments — SCIF, classified networks, offline operations
  • Data residency requirements — EU GDPR, China data laws, government mandates
  • Custom integration needs — Embed in proprietary platforms, specialized workflows

Includes: Enterprise CLI, Docker/Kubernetes orchestration, RBAC, audit logging, and dedicated support.

Contact sales for assessment and pricing →