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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wj_diode_quantum-1.0.0b3-py3-none-win_arm64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b3-py3-none-win_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8833ef061aa007c6e93dbd2c902db69b178fc2a580ea8a77d291487ccd07464a
|
|
| MD5 |
facb77d52c732eefe0d2167441133d63
|
|
| BLAKE2b-256 |
f6626bcff5ca052bb99d8d42647cb21de5290a88a8f18769ad7c5e17fc61c7c6
|
File details
Details for the file wj_diode_quantum-1.0.0b3-py3-none-win_amd64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b3-py3-none-win_amd64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f921115247674c1b7c1c5ed327bac2604e9f3347948100c9f5daa14f37df2dd5
|
|
| MD5 |
debe91fe1570b637f1d2d41d5c3e1bea
|
|
| BLAKE2b-256 |
a750adf6db7c76db8c5c16d412b9ff0b4f9802eee6345659d2318f3ef1bbc37b
|
File details
Details for the file wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c142046fcf4b1a40fc4f695cbf422c7ac42cf5493ef5303d9bc677d6f9a1468
|
|
| MD5 |
32ead27a7ca34c92d75136907c4a2d77
|
|
| BLAKE2b-256 |
ee77a295f7cda22ccbae3c561e08dc9df4bdeef78d2d584762831a9f237cd031
|
File details
Details for the file wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_aarch64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b3-py3-none-manylinux_2_17_aarch64.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3acc666790a451d5b663727bd90fa360944f9e6e4630b17a8e10fe5f8e2d529
|
|
| MD5 |
4d45228ba978800822b67f770c92ada0
|
|
| BLAKE2b-256 |
0d83b0d625f9cfe7cb032cbc25a7b6bc792c748fb9f52c61c8cc86f14c064987
|
File details
Details for the file wj_diode_quantum-1.0.0b3-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b3-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94d16fb9cd235a58c6792d3c304ba6bb6f7355d19bc301169fe5fc2333997663
|
|
| MD5 |
4b66d047c58aaea46bfc02acaed8ba14
|
|
| BLAKE2b-256 |
68e8d52326e5c147d6ff7b72ef868e602f47187b3712c793aa9ce47d2aba5bcf
|
File details
Details for the file wj_diode_quantum-1.0.0b3-py3-none-macosx_10_9_x86_64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b3-py3-none-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
995ab1900b84455412c408439f32ce98463ea55e31cf7b3b7f2d0a22b7d3d17e
|
|
| MD5 |
c758de77f90989003579127352a63d60
|
|
| BLAKE2b-256 |
96a1f0e01e0394eef350c2df7b379f1384af18d47c65afcfbe464c7fdf9a393e
|