Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

wj-diode-quantum

Collects quantum random numbers from the Australian National University, streams them across a data diode, and serves them one at a time on the protected side. Each value is 1024 bits.

A data diode only carries data one way, so a machine behind one cannot ask ANU for random numbers itself. This program splits the job in two: one side collects and pushes, the other stockpiles what arrives and hands it out on request.

Quick start

Two machines, one command each.

Machine 1 — internet side

uv tool install wj-diode-quantum
wj-diode-quantum setup send
wj-diode-quantum collect -c config.json

Machine 2 — protected side

uv tool install wj-diode-quantum
wj-diode-quantum setup recv
wj-diode-quantum serve -c config.json

Check it works

curl localhost:8099/api/status    # numbers are arriving
curl localhost:8099/api/random    # take one
{
  "value": "74b033a4332c7112cf0c3ff5...67f6b30ee",
  "timestamp": "2026-08-02T04:14:58Z",
  "source": "quantumnumbers"
}

value is your 1024-bit random number, 256 lowercase hex characters. timestamp is when it was collected. You will never be given that number again.

Open http://localhost:8099/ in a browser for the same thing with live pool figures.

Full documentation: docs.waterjuice.org/wj-diode-quantum

Features

  • Nothing is written to disk — on either side. The numbers exist only in pipes and in memory.
  • Both ANU APIs — the current keyed service and the older unkeyed one, each on its own schedule sized to its rate limit. Enable either or both.
  • Any diode tool — the transfer is a configured external command reading and writing a stream. Built against diodetool, but nothing about it is hard-coded.
  • Never serves the same number twice — for as long as the server is running, which is as long as the pool exists.
  • Bounded, self-trimming pool — newest served first, oldest discarded at capacity.
  • One process per machine — the receiving side runs the diode tool for you.
  • Damage is contained — a diode cannot retransmit, so a corrupted value is dropped and the stream resynchronises rather than losing everything behind it.
  • Zero dependencies — a single static binary, Go standard library only.

Requirements

  • A tool that can move a file across your diode, on both sides.
  • An ANU API key from quantumnumbers.anu.edu.au, free with an account. Optional if you only use the legacy endpoint.

Building

make build        # wheels for all platforms, plus documentation
make check        # tests, format check, and vet
make dev          # run from source via a .venv launcher

How it fits together

  internet side                     diode                  protected side
  ─────────────                     ─────                  ──────────────
  ANU ──> collect ──> [ stream-send ] ══════> [ stream-recv ] ──> serve ──> GET /api/random
                            stdin                  stdout          │
                                                                   v
                                                            in-memory pool

Nothing comes back, so the collector never learns whether anything arrived. Nothing is stored: a transfer the diode will not take is retried and then discarded, and the pool is lost on restart and refills from the far side's next cycle.

Security

There is no authentication on the API. Anyone who can reach the port can drain the pool. The default binds to 127.0.0.1 — keep it on loopback or a trusted network, or put a reverse proxy in front of it. Supply is finite, so a rate limit matters as much as authentication.

Diode passwords are written to a file with mode 0600 and passed with --password-file rather than on a command line, where ps would expose them.

Because a diode carries nothing back, the collector cannot be told the server is running low. Watch /api/status, the root page, or wj-diode-quantum stats on the protected side.

Licence

Released under the Unlicense — public domain.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wj_diode_quantum-1.0.0b3-py3-none-win_arm64.whl (2.6 MB view details)

Uploaded Python 3Windows ARM64

wj_diode_quantum-1.0.0b3-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_x86_64.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_aarch64.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

wj_diode_quantum-1.0.0b3-py3-none-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

wj_diode_quantum-1.0.0b3-py3-none-macosx_10_9_x86_64.whl (2.9 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file wj_diode_quantum-1.0.0b3-py3-none-win_arm64.whl.

File metadata

File hashes

Hashes for wj_diode_quantum-1.0.0b3-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 8833ef061aa007c6e93dbd2c902db69b178fc2a580ea8a77d291487ccd07464a
MD5 facb77d52c732eefe0d2167441133d63
BLAKE2b-256 f6626bcff5ca052bb99d8d42647cb21de5290a88a8f18769ad7c5e17fc61c7c6

See more details on using hashes here.

File details

Details for the file wj_diode_quantum-1.0.0b3-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for wj_diode_quantum-1.0.0b3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f921115247674c1b7c1c5ed327bac2604e9f3347948100c9f5daa14f37df2dd5
MD5 debe91fe1570b637f1d2d41d5c3e1bea
BLAKE2b-256 a750adf6db7c76db8c5c16d412b9ff0b4f9802eee6345659d2318f3ef1bbc37b

See more details on using hashes here.

File details

Details for the file wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2c142046fcf4b1a40fc4f695cbf422c7ac42cf5493ef5303d9bc677d6f9a1468
MD5 32ead27a7ca34c92d75136907c4a2d77
BLAKE2b-256 ee77a295f7cda22ccbae3c561e08dc9df4bdeef78d2d584762831a9f237cd031

See more details on using hashes here.

File details

Details for the file wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 a3acc666790a451d5b663727bd90fa360944f9e6e4630b17a8e10fe5f8e2d529
MD5 4d45228ba978800822b67f770c92ada0
BLAKE2b-256 0d83b0d625f9cfe7cb032cbc25a7b6bc792c748fb9f52c61c8cc86f14c064987

See more details on using hashes here.

File details

Details for the file wj_diode_quantum-1.0.0b3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wj_diode_quantum-1.0.0b3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94d16fb9cd235a58c6792d3c304ba6bb6f7355d19bc301169fe5fc2333997663
MD5 4b66d047c58aaea46bfc02acaed8ba14
BLAKE2b-256 68e8d52326e5c147d6ff7b72ef868e602f47187b3712c793aa9ce47d2aba5bcf

See more details on using hashes here.

File details

Details for the file wj_diode_quantum-1.0.0b3-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for wj_diode_quantum-1.0.0b3-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 995ab1900b84455412c408439f32ce98463ea55e31cf7b3b7f2d0a22b7d3d17e
MD5 c758de77f90989003579127352a63d60
BLAKE2b-256 96a1f0e01e0394eef350c2df7b379f1384af18d47c65afcfbe464c7fdf9a393e

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0

6 files

This release

1.0.0b3 This release

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page