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

Xshield: HTTP Split-Channel Reverse Proxy

Transparent HTTPS split-channel reverse proxy. Splits HTTP request and response payloads across N independent HTTPS channels using XorIDA threshold secret sharing. No single channel carries enough data to reconstruct the payload — compromising fewer than K channels reveals nothing. DID mutual authentication authenticates each channel endpoint. Zero code changes required on upstream API servers.

v0.1.0 50 tests passing Information-theoretic security N-of-K threshold 2-255 channels HMAC verified
Section 01

Executive Summary

Xshield is a transparent reverse proxy that splits HTTP payloads across N independent HTTPS channels using XorIDA threshold secret sharing. Information-theoretic security: any attacker who compromises K-1 channels learns zero information about the original payload.

Two core functions cover all use cases: splitRequest() takes an HTTP payload and a proxy configuration, splits the payload into N XorIDA shares, wraps each in an Xformat binary envelope, and returns them for transmission across separate channels. reconstructResponse() takes K or more shares, deserializes the envelopes, verifies HMAC integrity, reconstructs the original payload, and returns it. The proxy runs transparently — client and upstream server see only standard HTTPS.

Each channel is defined by a URL, a DID (Decentralized Identifier) for mutual authentication, and an optional provider label and routing priority. Channels can span different cloud providers, geographic regions, or ISPs — the more diverse the network paths, the stronger the security posture.

Zero npm runtime dependencies. Uses only Web Crypto API (HMAC-SHA256, AES-256-GCM) and XorIDA from @private.me/crypto. Works in Node.js, Deno, Bun, Cloudflare Workers, and browsers.

Section 02

The Problem: Network-Level Adversaries

Standard HTTPS protects payload confidentiality against passive eavesdroppers. But network operators, ISPs, CDNs, and compromised intermediaries can still observe which servers you talk to, how much data you send, and timing patterns. End-to-end encryption stops at the TLS layer — the application payload is encrypted, but a network observer sees the full request/response flow on a single path.

Xshield addresses this by splitting payloads across independent network paths. With a 2-of-3 configuration, an adversary must compromise all three network providers simultaneously to reconstruct even one message. With higher K values, the security grows exponentially: in a 2-of-7 setup, an attacker needs to compromise 7 different organizations at the same time to learn anything.

Threat Model

In scope: Network-level adversaries who control one or more channel paths. An ISP, CDN operator, or cloud provider who observes traffic on their network. A nation-state actor who can intercept HTTPS traffic between client and relays.

Out of scope: Adversaries who control the client itself, the upstream server, or can launch timing/traffic analysis attacks across all channels simultaneously. Xshield is a network-level defense, not a local security boundary.

INFORMATION-THEORETIC SECURITY

XorIDA shares are unconditionally secure. Fewer than K shares reveal zero information regardless of computational power. This remains true even against quantum computers. Only the channel diversity assumption (channels are independent) must hold.

Section 03

Architecture

Xshield splits HTTP payloads using XorIDA, routes shares across independent channels, and reconstructs on the other side. The entire flow is transparent to client and upstream server — they see only standard HTTPS.

XorIDA Splitting

Payloads are split using XorIDA (XOR-based Information Dispersal Algorithm) over GF(2). XorIDA produces N shares such that any K shares can reconstruct the original, but K-1 shares reveal nothing.

The splitting process:

Payload Splitting
1. Pad payload to block boundary (nextOddPrime(n) - 1)
2. Compute HMAC-SHA256 over padded payload
3. Split padded data into N XorIDA shares
4. Generate transaction UUID
5. Wrap each share: [HMAC_KEY:32][HMAC_SIG:32][SHARE_DATA]
6. Serialize envelope (Xformat binary) for each share
7. Return shares + channel assignments

Each share is wrapped in an Xformat binary envelope containing:

  • Product type (XSHIELD): Prevents confusion with other envelope types.
  • N, K values: Stored with each share for verification.
  • Share ID (1-based): Used to index the share during reconstruction.
  • Transaction UUID: Links all shares of a single split operation.
  • HMAC key + signature + payload: The envelope payload contains the HMAC key, HMAC signature, and the XorIDA share data.

Multi-Channel Routing

Each channel is defined by:

Channel Definition
interface ChannelEndpoint {
  channelId: 'aws' | 'azure' | 'gcp'
  url: 'https://relay-1.example.com/share'
  did: 'did:key:z6Mk...'
  provider?: 'AWS us-east-1'
  priority?: 0 // lower = preferred
}

The proxy maintains N channel endpoints. When splitting a payload:

  • Share 0 → channels[0].url via POST with HMAC authentication
  • Share 1 → channels[1].url (independent network path)
  • Share i → channels[i].url

No single channel carries the full payload — each relay holds only one binary share. Even if all N relays are on the same ISP, they operate independently. A network observer on that ISP cannot correlate the three shares without breaking HMAC and deserialization.

DID Mutual Authentication

Each channel endpoint has a DID (Decentralized Identifier) for mutual authentication. Before transmitting a share, the proxy verifies the relay's DID signature. The relay verifies the proxy's DID signature. This prevents relay impersonation and replay attacks.

The authentication flow:

  • Proxy constructs a signed message (via Xlink) containing the share and transaction metadata.
  • Relay verifies the proxy's signature using the proxy's DID public key.
  • Relay responds with its own signed confirmation.
  • Proxy verifies relay's signature using the relay's configured DID.
CHANNEL INDEPENDENCE

Channels should traverse independent network paths. Ideal setup: different cloud providers (AWS, Azure, GCP) in different regions. Acceptable: same provider but different VPCs/regions. Avoid: all channels on the same ISP/network operator.

Section 04

Use Cases

Xshield is designed for deployments where network-level adversaries are a credible threat.

🏛️
Government
Classified Communications
Federal agencies using split-path relay to prevent ISP-level correlation of sensitive traffic.
2-of-3 threshold
🏦
Financial
Secure Trading
Investment banks routing trade execution across independent relays to prevent front-running detection.
2-of-4 threshold
⚖️
Legal
Privileged Communications
Law firms protecting attorney-client privilege from network monitoring and metadata inference.
3-of-5 threshold
🏥
Healthcare
Patient Privacy
HIPAA-compliant systems preventing de-anonymization via traffic pattern analysis.
2-of-3 threshold
🔬
Research
Sensitive Datasets
Universities splitting ML training data to prevent reconstruction from any single relay.
2-of-7 threshold
🤝
Enterprise
Zero-Trust Architecture
Organizations deploying split-path routing as a network segmentation primitive.
N configurable
Section 05

Integration Guide

Xshield is designed for transparent integration. Client and upstream server require zero code changes.

Quick Start

Splitting a Request
import { splitRequest } from '@private.me/httpsplit';

const config = {
  n: 3,
  k: 2,
  proxyDid: 'did:key:z6MkProxy...',
  channels: [
    { channelId: 'aws', url: 'https://relay-1.com/share', did: 'did:key:z6Mk1...' },
    { channelId: 'azure', url: 'https://relay-2.com/share', did: 'did:key:z6Mk2...' },
    { channelId: 'gcp', url: 'https://relay-3.com/share', did: 'did:key:z6Mk3...' },
  ],
};

const payload = new TextEncoder().encode('{"secret":"data"}');
const result = await splitRequest(payload, config);

if (result.ok) {
  const { shares, transactionId } = result.value;
  // Send each share to its assigned channel relay
  for (let i = 0; i < shares.length; i++) {
    await fetch(config.channels[i].url, {
      method: 'POST',
      body: shares[i],
      headers: { 'X-Transaction-ID': transactionId }
    });
  }
}

Reconstruction

Reconstructing from Shares
import { reconstructResponse } from '@private.me/httpsplit';

const receivedShares = [share1, share2, share3]; // Uint8Array[]
const result = await reconstructResponse(receivedShares);

if (result.ok) {
  const original = result.value.payload;
  const txId = result.value.transactionId;
  console.log('Reconstructed:', new TextDecoder().decode(original));
} else {
  console.error('Reconstruction failed:', result.error);
}

Proxy Lifecycle

Creating and Managing a Proxy
import { createProxy } from '@private.me/httpsplit';

const proxyResult = createProxy(config);

if (proxyResult.ok) {
  const proxy = proxyResult.value;

  // Start the proxy
  await proxy.start();
  console.log(proxy.state); // 'RUNNING'

  // Process requests...

  // Stop the proxy
  await proxy.stop();
  console.log(proxy.state); // 'IDLE'
} else {
  console.error('Invalid config:', proxyResult.error);
}
Section 06

API Surface

Xshield exports four core functions and several type definitions. All functions return Result<T, ProxyError> — errors are values, not exceptions.

Core Functions

splitRequest(payload, config): Promise<Result<SplitResult, ProxyError>>
Split an HTTP payload into N XorIDA shares wrapped in Xformat envelopes. Returns transaction ID, share array, and channel assignments.
reconstructResponse(shares): Promise<Result<ReconstructResult, ProxyError>>
Reconstruct original payload from K or more shares. Performs HMAC verification before reconstruction. Validates product type, UUID consistency, and share ID uniqueness.
createProxy(config): Result<ProxyInstance, ProxyError>
Create and validate a proxy configuration. Returns a frozen ProxyInstance with start(), stop(), state, and config properties.

Type Definitions

Configuration & Results
interface ProxyConfig {
  n: number;                 // Total channels (2–255)
  k: number;                 // Reconstruction threshold (2–n)
  channels: ChannelEndpoint[];
  proxyDid: string;          // DID for mutual auth
  maxPayloadBytes?: number;     // Default: 10 MB
  channelTimeoutMs?: number;   // Default: 30000
  verifyHmac?: boolean;        // Default: true
}

interface SplitResult {
  transactionId: string;
  shares: Uint8Array[];
  channels: ChannelEndpoint[];
  n: number;
  k: number;
}

interface ReconstructResult {
  transactionId: string;
  payload: Uint8Array;
  sharesUsed: number;
}
Section 07

Security Design

Xshield is built on three cryptographic layers: information-theoretic splitting (XorIDA), transport encryption (AES-256-GCM), and payload integrity (HMAC-SHA256).

Layer 1: Information-Theoretic Security (XorIDA)

Property: K-1 shares reveal zero information about the original payload. This holds regardless of computational power.

Guarantee: In a 2-of-3 split, an attacker who steals 2 shares and breaks HMAC can still only access the payload IF they have a third share. No brute force, no quantum advantage.

Tradeoff: If an attacker gets K shares from K different channels, they reconstruct the plaintext immediately (after HMAC verification). Xshield relies on channel independence — channels must traverse different networks.

Layer 2: Transport Encryption (Per-Channel AES-256-GCM)

Each share is wrapped in an Xformat envelope that includes AES-256-GCM encryption. Even if a channel relay is compromised, the share data is encrypted at rest and in transit.

Key derivation: Envelope encryption key is derived from the proxy DID via HKDF. Channel relays decrypt using their own DID keys.

Layer 3: Payload Integrity (HMAC-SHA256)

HMAC is computed over the PADDED payload (before splitting). The HMAC key and signature are embedded in each share's envelope payload.

Verification: Before XorIDA reconstruction, all K shares are HMAC-verified. If any share is tampered with, reconstruction fails immediately.

Placement: HMAC verification happens BEFORE unpadding. This prevents padding oracle attacks.

Threat Mitigations

DID MUTUAL AUTHENTICATION

Every channel relay is authenticated via its DID. The proxy verifies the relay's public key; the relay verifies the proxy's. Prevents relay impersonation and MITM attacks.

SHARE INDEPENDENCE

Each split produces unique shares due to XorIDA's random component. Splitting the same payload twice yields completely different share data, preventing inference attacks across multiple messages.

PRODUCT TYPE ENFORCEMENT

Only envelopes tagged with XSHIELD product code (0x0032) are accepted during reconstruction. Prevents confusion with other envelope types and cross-protocol attacks.

KNOWN LIMITATION: HEADER VISIBILITY

HTTP headers encrypted alongside share data. If channel-level encryption is compromised, headers are exposed. Mitigation: use per-channel AES-256-GCM (enabled by default) and assume channels are independent.

Section 08

Performance Characteristics

Xshield splits and reconstructs at microsecond latencies. Network latency dominates — transmitting shares across N channels and waiting for all to arrive is the bottleneck, not crypto.

Splitting Overhead

Payload Size XorIDA Time HMAC Time Envelope Ser. Total
1 KB ~20 µs ~5 µs ~2 µs ~27 µs
64 KB ~280 µs ~45 µs ~8 µs ~333 µs
1 MB ~4.2 ms ~650 µs ~80 µs ~4.93 ms

Reconstruction Overhead

Reconstruction is marginally slower than splitting because it must wait for K shares to arrive and verify HMAC across all. Typical end-to-end latency (split → transmit → reconstruct):

  • LAN (same datacenter): ~15–30 ms (network roundtrip dominates)
  • WAN (multi-region): ~80–200 ms (fastest + slowest channel = latency)
  • Geo-distributed (3 continents): ~300–500 ms
PERFORMANCE NOTE

Xshield is secure by design but not fast. Splitting, encrypting, transmitting across N channels, and reconstructing adds significant latency. Use when security requirements justify the cost (classified, financial, healthcare). Not suitable for interactive applications.

Section 09

Known Limitations

Xshield is powerful but has boundaries. Understanding these limitations is critical for correct deployment.

Channel Endpoint Trust

The proxy trusts channel relays to forward shares faithfully and respond honestly. A malicious relay can:

  • Drop shares → Reconstruction fails if fewer than K shares arrive
  • Delay shares → Reconstruction latency increases
  • Tamper with shares → HMAC verification detects tampering (if HMAC is enabled)

Mitigation: Use DID mutual authentication. Monitor relay behavior for consistent drops or delays. Use redundant channels (N > 2K).

No Channel Rotation

Channel endpoints are fixed at proxy creation time. To change channels, the proxy must be stopped and recreated. There is no built-in mechanism to rotate channels during a session.

Mitigation: Plan channel infrastructure carefully. Use provider-agnostic URLs and DID pairs that can be updated out-of-band.

Header Visibility

HTTP headers are encrypted alongside share data. If channel-level encryption is compromised (e.g., relay SSL cert is stolen), headers are exposed.

Mitigation: Use per-channel AES-256-GCM envelope encryption (enabled by default). Assume channels are independent and not on the same ISP.

No Request-Response Binding

Request and response splits use independent UUIDs. An attacker with visibility to all channels could theoretically correlate timing, but would need sophisticated traffic analysis across all N paths.

Mitigation: Use channel path diversity. The more independent the networks, the harder timing correlation becomes.

Payload Size Limits

Default maxPayloadBytes is 10 MB. Larger payloads are rejected to prevent resource exhaustion. Can be configured per proxy instance.

Section 10

Post-Quantum Security

Xshield inherits post-quantum protection from the PRIVATE.ME platform stack.

Payload Layer (XorIDA)

Status: Quantum-safe unconditionally. XorIDA provides information-theoretic security. K-1 shares reveal zero information regardless of computing power, including quantum computers. No assumption about hardness of any problem.

Transport Layer (Xlink Envelopes)

When messages are exchanged via @private.me/agent-sdk, hybrid post-quantum cryptography protects the envelope:

  • Key exchange: X25519 + ML-KEM-768 (FIPS 203) — always-on in v2+ envelopes
  • Signatures: Ed25519 + ML-DSA-65 (FIPS 204) — opt-in via postQuantumSig: true

Recommendation

Applications integrating Xshield should create agents with postQuantumSig: true for full post-quantum protection across all three cryptographic layers:

  1. Payload layer: XorIDA (information-theoretic)
  2. Channel authentication: ML-DSA-65 signatures
  3. Transport encryption: ML-KEM-768 key exchange
HARVEST NOW, DECRYPT LATER

If you expect adversaries to perform "harvest now, decrypt later" attacks (record encrypted traffic today, decrypt in 10+ years with quantum computers), XorIDA provides unconditional protection. Fewer than K shares are useless regardless of future computing power.

Section 11

Error Handling

All Xshield operations return Result<T, ProxyError>. Errors are values, not exceptions. This enables structured error handling and recovery.

Error Categories

Error Code Cause
INVALID_CONFIG Generic configuration error (see sub-codes)
INVALID_CONFIG:N_TOO_SMALL n < 2
INVALID_CONFIG:K_TOO_SMALL k < 2
INVALID_CONFIG:K_EXCEEDS_N k > n
INVALID_CONFIG:CHANNEL_COUNT_MISMATCH channels.length !== n
INVALID_CONFIG:MISSING_PROXY_DID proxyDid is empty
INVALID_CONFIG:DUPLICATE_CHANNEL_ID Two channels share the same ID
PAYLOAD_TOO_LARGE Payload exceeds maxPayloadBytes
SPLIT_FAILED XorIDA split operation failed
HMAC_FAILED HMAC generation failed (Web Crypto unavailable)
RECONSTRUCT_FAILED:INSUFFICIENT_CHANNELS Fewer than k shares provided
RECONSTRUCT_FAILED:HMAC_MISMATCH Share data was tampered with
RECONSTRUCT_FAILED:DESERIALIZE Envelope parsing failed (bad format, wrong product, UUID mismatch, duplicate IDs)

Error Handling Pattern

Structured Error Recovery
const result = await splitRequest(payload, config);

if (!result.ok) {
  switch (result.error) {
    case 'PAYLOAD_TOO_LARGE':
      console.error('Payload exceeds limit. Chunk it.');
      break;
    case 'INVALID_CONFIG:K_EXCEEDS_N':
      console.error('Config error: k must be <= n');
      break;
    default:
      console.error('Unknown error:', result.error);
  }
}
Section 12

Codebase Statistics

Xshield is lean and focused. Small surface area, comprehensive testing.

6
Source files
~500
Lines of code
50+
Test cases
0
npm deps

File Breakdown

Module Purpose Lines
types.ts Type definitions (ProxyConfig, ChannelEndpoint, SplitResult, etc.) ~120
errors.ts Error class hierarchy and conversion utilities ~100
proxy.ts Core split/reconstruct logic ~400
index.ts Barrel exports ~10
proxy.test.ts Functional and integration tests ~786
abuse.test.ts Security and edge case tests ~292

Testing Coverage

  • Configuration validation: All 8 error paths tested
  • Splitting: Payload sizes 10 B–10 MB, various N/K combinations
  • Reconstruction: Happy path, insufficient shares, HMAC failures, envelope deserialization errors
  • Abuse cases: Oversized payloads, duplicate share IDs, UUID mismatches, product type mismatches
  • Edge cases: Empty payloads, N=255, large N with large K, padding edge cases
VERIFIED BY XPROVE

Xshield's cryptographic core (XorIDA splitting + HMAC verification) is verified by the Xprove verifiable computation module. See /docs/xprove for proof systems and audit trails.

Deployment Options

📦

SDK Integration

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

  • npm install @private.me/httpsplit
  • 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 httpSplit 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 →