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.

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.
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.
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.
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.
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.
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.



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.
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:
| Lever | Range | Effect |
|---|---|---|
| Grid size | 1×1 · 2×2 · 3×3 | More codes per frame = more data, but needs more camera resolution |
| Frame interval | 100 – 1000 ms | Faster frames = more throughput, but risks torn/missed captures |
| QR version / chunk size | 128 – 1024 B per code | Denser symbols carry more but demand finer optics |
| Error-correction level | L ≈ 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
| System | Approach | Throughput | Key limitation |
|---|---|---|---|
| Liu et al. (2020) | Dynamic B/W + colour QR | ~150–900 Kbps | Colour fragile to lighting & calibration |
| Jin et al. (2021) | Streaming QR for air-gap | >10× vs manual scan | Codes-per-frame never varied |
| TXQR (divan) | Animated single-stream QR | ~40–50 Kbps | Single 1×1 fixed-version stream |
| ChromaCode (2018) | Imperceptible (CIELAB) | >1360 Kbps raw | Complex, computationally heavy |
| DeepLight (2021) | Imperceptible (DL, blue ch.) | ~0.95 Kbps goodput | Low goodput, high latency |
| This work | Overt B/W, adaptive grid + interval | Configurable | Simplex; 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.
| Variable | Type | Levels / definition |
|---|---|---|
| Grid size | Independent | 1×1 · 2×2 · 3×3 |
| Frame interval | Independent | 100 – 1000 ms |
| Distance | Independent | 0.5 · 1.0 · 1.5 · 2.0 m |
| Viewing angle | Independent | 0° · 15° · 30° |
| Throughput | Dependent | Total bits received per second |
| Goodput | Dependent | Useful decoded bits per second |
| Bit Error Rate | Dependent | Incorrect bits / total bits (vs ground truth) |
| Frame Error Rate | Dependent | Fraction 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.