Skip to content

Repository files navigation

Alien Optical Transfer

Alien Optical Transfer animated demonstration

Transfer files from a screen to a camera through animated QR codes. The payload travels through light: no Bluetooth, no Wi-Fi Direct, no pairing and no upload server.

Alien Optical Transfer is a browser-based experimental project built to study one-way optical links, fountain codes and resilient file reconstruction. Its interface combines a compact Windows 98/XP-style utility with an original CRT computer shell.

Highlights

  • Generic files and UTF-8 notes up to 8 MiB.
  • One page can act as sender or receiver.
  • Systematic LT fountain transport: missing QR frames do not need retransmission.
  • Frames can arrive out of order and duplicates are ignored.
  • Per-frame CRC32 plus SHA-256 verification of the recovered content.
  • Filename and MIME type preservation with receiver-side sanitization.
  • Gzip compression only when it reduces the transmitted payload.
  • Local previews for text, images, audio and video.
  • Adjustable speed from 1 to 20 FPS.
  • QR density from 160 to 1,200 bytes per frame.
  • No analytics, remote fonts or application payload network requests.

Quick start

Requirements: Node.js 20 or newer and a modern browser with WebAssembly, getUserMedia, Web Crypto and Compression Streams.

npm install
npm run dev

Open the HTTPS address printed by Vite on both devices. On the sending device, select a file and start the stream. On the receiving device, choose Ricevi, allow camera access and fill the guide with the QR code.

The local TLS certificate is self-signed during development, so the receiving device may require accepting the browser warning once.

Optical tuning

Density Intended use
480 B Reliable starting point
880 B Denser mode for good cameras and monitors
1,200 B Experimental TURBO mode

Start with 8 FPS and 480 B. Raise one setting at a time. A digitally generated QR can be valid while a physical camera still loses it because of focus, exposure, glare, moiré or display refresh transitions.

Increasing the maximum file size changes how much can be transferred. Increasing frame density or FPS changes how long the transfer takes. Large files remain possible at low density, but may take a long time.

Changing density after preparing a file invalidates that optical session: press Prepare again so the encoder can rebuild its source blocks. The sender then shows the estimated duration of the first systematic pass, while the receiver shows measured accepted payload per second. Turbo is faster only when the camera can decode its denser QR frames reliably; on a difficult optical setup, dropped frames can cancel the theoretical gain.

How it works

  1. file-container.ts creates an AOF2 capsule containing metadata, optional gzip data and the full SHA-256 digest.
  2. protocol.ts divides the capsule into AOT/2 frames.
  3. fountain.ts first emits every original block once, then produces an unbounded stream of deterministic LT repair equations.
  4. qrcode renders each frame; zxing-wasm reads it from the receiving camera.
  5. The peeling decoder solves source blocks incrementally and reconstructs the capsule only when every block is available.
  6. The receiver verifies the transport digest, opens the capsule and verifies its full SHA-256 before offering a preview or download.

The protocol currently has no back-channel. The sender does not know when the receiver has finished and continues producing repair frames until paused.

Project structure

src/main.ts               Browser UI, sender timer and camera capture
src/protocol.ts           AOT/2 frame format, CRC and session receiver
src/file-container.ts     AOF2 metadata, compression and SHA-256 capsule
src/fountain.ts           Systematic LT encoder and peeling decoder
src/background-shader.ts  Dependency-free decorative WebGL background
src/style.css              CRT/Y2K responsive interface
tests/                     Unit, loss-recovery and real QR decode tests

Verification

npm test
npm run build

The suite covers file compression and tampering, protocol sessions, frame corruption, duplicate/out-of-order frames, 25% systematic-frame loss and real ZXing decoding at both normal and 1,200-byte Turbo density.

GitHub Actions runs the same test and production-build commands on every push and pull request.

Security and limitations

  • The optical payload is not encrypted. Any camera that sees the screen can record it.
  • CRC32 detects damaged QR frames; it is not an authentication mechanism.
  • SHA-256 verifies integrity but does not identify the sender.
  • The 8 MiB limit is a browser safety/product limit, not a theoretical protocol limit.
  • Turbo density has been verified with generated images and still needs a real device compatibility matrix.
  • This is an experimental project, not an audited secure-transfer product.

Originality and acknowledgements

Alien Optical Transfer has its own AOT/2 frame format, AOF2 file capsule, systematic transport phase, bounded decoder memory, interface and tests. It does not vendor source files from the projects below.

The project was informed by prior open-source work on the same optical-channel problem, especially:

  • Decimen Optical Transfer (MIT) for animated QR and LT-fountain design ideas.
  • TXQR for the broader fountain-coded QR concept.
  • libcimbar for research into custom high-density color barcodes. libcimbar code is not included in this build.

Standard algorithmic components such as CRC32, SHA-256, robust-soliton sampling, SplitMix-style deterministic generation and peeling decoding are documented in the source. See THIRD_PARTY_NOTICES.md for dependencies and acknowledgements.

Contributing

Small reproducible improvements and device measurements are welcome. Read CONTRIBUTING.md before opening a pull request.

License

Alien Optical Transfer is released under the MIT License.

About

Screen-to-camera file transfer through animated QR codes. no internet, Bluetooth or pairing required.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages