QR·STREAM
Offline Screen → Camera Optical Link
qr.upekshaip.com

Adaptive QR Streaming Framework

A configurable, air-gap-friendly optical data channel that encodes arbitrary binary files into a looping stream of QR codes — displayed on any screen and captured by any camera. No network, no back-channel, no specialised hardware. Data travels purely as light. Built as a BSc (Hons) Computer Science research prototype at NSBM Green University.

CRC-32 + SHA-256 integrity
optional AES-256-GCM
1×1 · 2×2 · 3×3 grids
100 – 1000 ms frame interval
npm package planned
A laptop displaying a 2×2 grid of QR codes being scanned by a smartphone camera
screen → camera · a 2×2 grid in transit
01 – 02 · Standard Transfer
01 · SENDER (Tx)

Transmit a file

Load any binary file and broadcast it as a looping QR stream. Configure the grid size (1×1 · 2×2 · 3×3), frame interval, chunk size, and error-correction level. Each chunk carries a sequence ID and CRC-32 checksum; a META frame per cycle carries the filename, size, and SHA-256 hash so the receiver can reconstruct bit-perfectly.

02 · RECEIVER (Rx)

Receive a file

Capture the QR stream through a webcam. Each video frame is scanned for codes using the native BarcodeDetector API (jsQR fallback on non-Chromium browsers). Chunks arrive in any order and are inserted into a sequence-number buffer. When all unique chunks are received and the SHA-256 matches, the file opens in a completion dialog with preview and download.

03 – 04 · Encrypted Transfer — AES-256-GCM
03 · ENCRYPTED SENDER (Enc·Tx)

Transmit with encryption

Adds an optional password field to the standard transmitter. When a password is set the file is encrypted with AES-256-GCM before chunking — the ciphertext travels over the optical link, never the plaintext. Key derivation uses PBKDF2 (100 000 iterations, SHA-256). A salted verifier hash, salt, and IV are embedded in the META frame so the receiver can validate the password without it ever leaving the sender.

04 · ENCRYPTED RECEIVER (Enc·Rx)

Receive an encrypted file

Same capture and reassembly pipeline as the standard receiver. After SHA-256 verification of the ciphertext a password prompt appears. The entered password is re-derived with PBKDF2 and compared against the stored verifier hash — a wrong password is caught before decryption is attempted. On success, AES-GCM decryption produces the original file; its authentication tag provides a cryptographic bit-integrity guarantee.

05 – 06 · Automated Research Harness
05 · HARNESS (Auto Tx)

Automated transmitter

Runs an unattended sweep over a matrix of grid sizes and frame intervals against a fixed synthetic payload. For each configuration it broadcasts the ground-truth payload over a same-origin BroadcastChannel so the paired receiver can compute exact Bit Error Rate. Each configuration window runs for a fixed duration before advancing to the next.

06 · HARNESS (Auto Rx)

Automated receiver

Screen-captures the Auto Tx tab and continuously decodes each frame, accumulating per-configuration metrics: raw throughput, goodput, BER, FER, chunk success rate, and mean processing latency. Results are displayed in a table and exportable as CSV — ready for regression analysis to answer RQ1, RQ2, and RQ3 of the research study.

The optical channel, end to end
01
Segment
File bytes split into fixed-size chunks, each wrapped with sequence ID, total count, and CRC-32.
02
Compose
N² QR codes rendered and tiled into a single N×N composite frame on canvas.
03
Display
Render-ahead scheduler holds each frame for exactly the configured interval, drift-corrected.
04
Light
The only medium is visible light across a direct line-of-sight gap. No RF, no wires.
05
Decode
Camera frames scanned for all QR codes at once; each payload parsed and CRC-verified.
06
Reassemble
Chunks buffered by sequence number across cycles; SHA-256 must match before the file is released.
Animated 2×2 QR stream cycling through data frames
a 2×2 stream in flight
System architecture
Sender and receiver pipeline architecture: data processing, adaptive parameter selection, QR generation, frame processing, QR decoding, and data reconstruction
Sender & receiver pipelines — the adaptive controller selects QR version, grid size, and frame rate before a transfer begins (interim report, §3.3). Click to open full size.

Background

High-security environments — military systems, nuclear controls, industrial SCADA networks, and financial clearinghouses — use air-gapped networks: machines physically isolated from all RF and wired external links to prevent remote intrusion and data exfiltration. Even in an air-gapped system, administrators must still move data in (firmware updates, security patches, configuration files) and move data out (audit logs, diagnostics). Traditionally this relies on USB drives or optical media, which introduce the BadUSB class of hardware-level attacks and cumbersome media-management logistics.

Screen-Camera Communication (SCC) is a compelling alternative. Data is modulated into a sequence of visual frames on a transmitter screen and demodulated by a receiver camera. Because visible light cannot penetrate walls, the channel requires direct line-of-sight — eavesdropping is confined to a physically controlled space. And the appeal is broader than classified enclaves: a lecturer pushing a dataset to a room full of students, a field technician loading firmware onto an instrument with no radio, or two people exchanging a file without pairing, accounts, or an intermediary server.

Existing SCC research splits into two camps. Systems like ChromaCode (2018) and DeepLight (2021) pursue imperceptible communication — hiding data in subtle colour variations of ordinary video. While technically impressive, they require deep-learning decoders, are sensitive to ambient lighting, and offer lower reliability. The other camp — including this project — uses overt high-contrast QR codes, prioritising data integrity, robust decoding, and implementation simplicity. Yet even overt systems are rigid: fixed parameters that cannot adapt to different cameras, distances, or lighting. That adaptability gap is what this framework fills.

Why adaptivity matters — the physics

The channel is imperfect in ways that all scale with code density and frame rate. The rolling shutter in consumer cameras exposes a frame row by row, so a code that changes mid-exposure is captured torn — holding frames longer restores legibility. Perspective distortion compresses the apparent module size of codes near the edges of a dense grid first. Motion blur, autofocus hunting, and falling ambient contrast erode the smallest modules soonest. The practical capacity of the channel is therefore not a single number but a surface over the grid-size × frame-interval plane — the surface this study maps empirically.

Two principles anchor the design. The Nyquist–Shannon sampling theorem implies the receiver must oversample the display: to guarantee one clean capture of every frame held for duration t, the camera rate should comfortably exceed 2/t. And because the link is simplex (no acknowledgements), reliability comes from redundancy, not retransmission: the frame sequence loops cyclically and the receiver fills gaps on later passes — a lightweight form of fountain coding.

Research problem & questions

Present-day offline screen-camera systems are rigid and frequently inefficient: they give the operator no practical means of balancing transfer speed against delivery reliability, because neither the spatial layout (grid size) nor the temporal rate (frame interval) can be adjusted to the conditions at hand. The way grid layout (N×N) and frame interval (t) jointly govern the speed-versus-reliability curve has never been charted systematically.

RQ 1
Throughput & GoodputHow do variations in QR grid size (spatial multiplexing: 1×1, 2×2, 3×3) and frame display interval (temporal multiplexing: 0.1 s – 1.0 s) independently and interactively affect the raw throughput and goodput of the system?
RQ 2
Reliability (BER & FER)What is the quantitative relationship between configuration parameters and reliability, as measured by Bit Error Rate and Frame Error Rate — and at what point does increasing grid density cause a catastrophic drop in decoding success?
RQ 3
Predictive modelCan a mathematical regression model accurately predict total transmission time for a given file size, configuration, and environmental constraint, thereby aiding operators in planning?
RQ 4
Environmental robustnessHow do distance, viewing angle, and ambient light degrade denser grids (3×3) relative to simpler ones (1×1), and can adaptive settings mitigate this degradation?

QR fundamentals — the four adaptive levers

QR codes (ISO/IEC 18004) encode data in a matrix of black and white modules with finder, alignment, and timing patterns that survive rotation and moderate perspective distortion. They give the framework four independent levers:

LeverRangeEffect
Grid size1×1 · 2×2 · 3×3More codes per frame = more data, but needs more camera resolution
Frame interval100 – 1000 msFaster frames = more throughput, but risks torn/missed captures
QR version / chunk size128 – 1024 B per codeDenser symbols carry more but demand finer optics
Error-correction levelL ≈ 7% · M ≈ 15% · Q ≈ 25% · H ≈ 30%More Reed-Solomon recovery data = survives damage, carries less payload

Reed-Solomon correction built into every QR reader repairs symbol-level damage for free; the framework layers a CRC-32 per chunk and a SHA-256 over the whole file on top, giving three independent guards against corruption while staying simple enough to run in a browser.

How this compares to prior systems

SystemApproachThroughputKey limitation
Liu et al. (2020)Dynamic B/W + colour QR~150–900 KbpsColour fragile to lighting & calibration
Jin et al. (2021)Streaming QR for air-gap>10× vs manual scanCodes-per-frame never varied
TXQR (divan)Animated single-stream QR~40–50 KbpsSingle 1×1 fixed-version stream
ChromaCode (2018)Imperceptible (CIELAB)>1360 Kbps rawComplex, computationally heavy
DeepLight (2021)Imperceptible (DL, blue ch.)~0.95 Kbps goodputLow goodput, high latency
This workOvert B/W, adaptive grid + intervalConfigurableSimplex; no back-channel

None of the surveyed systems exposes spatial and temporal parameters as first-class, user-tunable controls. A flagship-phone camera can resolve a dense 3×3 grid at close range; a modest laptop webcam may only decode a single code reliably. Exposing grid size and frame interval at run time lets one artifact span the whole hardware range — that hardware-aware tunability, rather than raw peak throughput, is the contribution.

Encryption — AES-256-GCM with PBKDF2

The encrypted pages add an optional password layer on top of the standard protocol. On the sender: a random 16-byte salt and 12-byte IV are generated per transmission; the password is stretched through PBKDF2 (100 000 iterations, SHA-256) into a 256-bit AES-GCM key; the file is encrypted and the ciphertext is what gets chunked and streamed. The META frame carries the salt, IV, and a SHA-256 hash of the raw key bytes (the password verifier) — never the password.

On the receiver: the ciphertext is reassembled and SHA-256-verified first, proving transmission integrity independently of the password. The entered password is re-derived and checked against the verifier before any decryption is attempted, so a wrong password is caught instantly. AES-GCM's authentication tag then guarantees that a successful decryption is bit-perfect.

Methodology & experimental design

The study follows Design Science Research (Peffers et al., 2007): the artifact is built, demonstrated, and evaluated in iterative cycles. Evaluation is quantitative — the automated harness sweeps a full factorial matrix and logs telemetry to CSV for regression modelling.

VariableTypeLevels / definition
Grid sizeIndependent1×1 · 2×2 · 3×3
Frame intervalIndependent100 – 1000 ms
DistanceIndependent0.5 · 1.0 · 1.5 · 2.0 m
Viewing angleIndependent0° · 15° · 30°
ThroughputDependentTotal bits received per second
GoodputDependentUseful decoded bits per second
Bit Error RateDependentIncorrect bits / total bits (vs ground truth)
Frame Error RateDependentFraction of frames with ≥1 failed code

The predictive model (RQ3) is validated, not merely fitted: runs are split into training and held-out test sets, accuracy reported as R², RMSE, and MAE, with k-fold cross-validation confirming the results don't depend on a particular split.

From prototype to package

The framework is delivered as this zero-install web application, and the streaming core — segmentation, the self-describing protocol, encoding, detection, and reassembly — is being extracted into an open-source npm package (working name qr-stream) so any Node or JavaScript application can embed robust screen-camera transfer. Release accompanies the final research article.

Browser compatibility: Multi-QR detection for 2×2 and 3×3 grids requires the native BarcodeDetector API — use Chrome or Edge for the full experiment. A jsQR fallback handles 1×1 streams in all browsers. The automated harness additionally requires getDisplayMedia (screen capture), also Chromium only.