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, pushes them across a data diode, and serves them one at a time on the protected side.
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": "a3f1c8d20b74e569ff10c3a8827d4e61",
"timestamp": "2026-08-02T04:14:58Z",
"source": "quantumnumbers"
}
value is your 128-bit random number, timestamp is when it was collected. You will never be given
that number again.
Full documentation: docs.waterjuice.org/wj-diode-quantum
Features
- Both ANU APIs — the current keyed service and the older unkeyed one. Enable either or both.
- Any diode tool — the transfer is a configured external command. Built against
diodetool, but nothing about it is hard-coded. - Never serves the same number twice — guaranteed across crashes. A value is recorded as consumed and flushed to disk before it reaches the client.
- Bounded, self-trimming pool — newest served first, oldest discarded at capacity.
- One process per machine — the receiving side supervises the diode tool for you.
- Rejects damaged batches whole — a diode cannot retransmit, so anything malformed is set aside.
- 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 ──> outbox ──> [ send ] ══════> [ recv ] ──> ingest ──> spool
│
v
pool.json <── serve ──> GET /api/random
Nothing comes back, so the collector never learns whether a batch arrived. Both sides are built to be restartable and to keep a buffer: batches wait in the outbox until the send succeeds, and the pool holds a reserve so the server keeps working while the other side is down.
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.
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 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.0b1-py3-none-win_arm64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b1-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 |
24f7b01884a171be36c8bd09df14d6d36b0d8d9d82a9609e29b75fdf00c08897
|
|
| MD5 |
5ea62a9528b4a9611726a4058ec9bd0b
|
|
| BLAKE2b-256 |
b245e17309d1a0a70990eedbf957f4e4d8873e686b1c65f3dcf211f82c6faa1f
|
File details
Details for the file wj_diode_quantum-1.0.0b1-py3-none-win_amd64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b1-py3-none-win_amd64.whl
- Upload date:
- Size: 2.9 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 |
b843d1a7ddec0ed420221d38c0ccdfd09e00883a0a1f9b2678b74c57302859e0
|
|
| MD5 |
671f413d2a11cad05c13ebe630b45df2
|
|
| BLAKE2b-256 |
92606c047dd4f939cb53c3186f0ba54802287e4bdc1c5c5966b9117402d85da4
|
File details
Details for the file wj_diode_quantum-1.0.0b1-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b1-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 |
17b0deafddd6b5e36df2429e733460ba089c3b5d376483d0f5a50a43331a0573
|
|
| MD5 |
f2428f340a88c180e40b0bdd880e32c3
|
|
| BLAKE2b-256 |
3fa80d5bfca56b574a44e9bdeeba72bc26204e0365cfcbffbb32fbceb943ba98
|
File details
Details for the file wj_diode_quantum-1.0.0b1-py3-none-manylinux_2_17_aarch64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b1-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 |
9d64b50ca1e048bd9d836ef951636d705c07d498b04b892bdb6d4331151cfddd
|
|
| MD5 |
f3c1bda59d00bd42e61c180c0b582e42
|
|
| BLAKE2b-256 |
a8eb49f1d9d7a8dfc8755a89075ac444a29267773dfb323ed4241869ffc7e15a
|
File details
Details for the file wj_diode_quantum-1.0.0b1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b1-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 |
e9cb5395cb6d142403fd17909687244ee7d53ba581f5b03185ec535a38997f5d
|
|
| MD5 |
d1bcc578895cc920fc85ce1820bb9896
|
|
| BLAKE2b-256 |
0a3140f92395d7f577ce035d9ce29cc64bc222e821adff352ae2232b12fce455
|
File details
Details for the file wj_diode_quantum-1.0.0b1-py3-none-macosx_10_9_x86_64.whl.
File metadata
- Download URL: wj_diode_quantum-1.0.0b1-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 |
1d4ed332744ce2bb53682aed658131aa9c8bddb2799a74085a24ad2878b70381
|
|
| MD5 |
50fbfe871c0ba36aa7d6d4ad1c263f6f
|
|
| BLAKE2b-256 |
862b1e0b26a8634cfa6938f002c288c34c2e9621706151e29a09f3eb89960cd2
|