GUIDE
A one-way serial cable as a low-cost data diode
A data diode lets data leave a network and makes it physically impossible for anything to come back. Commercial diodes are appliances bought as an IT project. For moving files off one isolated PC, the same physical idea fits in a serial cable: connect the sender's transmit line to the receiver's receive line, and leave the other direction unconnected.
Written by Taha Bayar, a biologist working on laboratory data handover.
The wiring
On a standard 9-pin serial connector (DB9), a PC sends on pin 3 (TXD), receives on pin 2 (RXD), and pin 5 is signal ground. A one-way cable has only two wires:
| Sending PC (isolated) | Receiving PC | |
|---|---|---|
| Pin 3, TXD (transmit) | → | Pin 2, RXD (receive) |
| Pin 5, GND | — | Pin 5, GND |
| Pin 2, RXD | not connected | Pin 3, TXD |
Build it from two DB9 screw-terminal adapters and two wires, or open an ordinary null-modem cable and cut every wire except TXD→RXD and ground. With nothing connected to the sending PC's receive pin, there is no electrical path back, whatever software runs on either side. Label the cable with its direction; a reversed cable carries nothing.
Speeds and transfer times
Serial speed is set in baud; with 8 data bits, no parity and one stop bit, ten bits carry one byte. Kionel adds about 3% for framing and 10% of spare blocks.
| Speed | About | 1 MB takes | Where it works |
|---|---|---|---|
| 115,200 baud | 10 KB/s | about 1 min 45 s | Every port, including a PC's built-in COM port |
| 230,400 baud | 20 KB/s | about 50 s | Most USB serial adapters |
| 460,800 baud | 40 KB/s | about 25 s | Most USB serial adapters |
| 921,600 baud | 80 KB/s | about 13 s | Adapters based on FTDI, CH340 and similar chips, over a short cable |
Both sides must use the same speed. The RS-232 standard is designed for about 15 m at low speeds; at the higher speeds keep the cable short, or step down a speed if frames are lost. Kionel reports when data arrives but no frames can be read, which is what a speed mismatch looks like.
USB on both ends: a parts list
Most PCs no longer have a 9-pin serial port. The same one-way link can be built between two USB ports:
- Two USB-to-serial adapters with bare pins (often sold as "USB to TTL"), both for the same voltage, 3.3 V. Common chips are FTDI FT232, Silicon Labs CP2102N and WCH CH340.
- Two wires: the sending adapter's TX pin to the receiving adapter's RX pin, and GND to GND. Leave the sending adapter's RX pin and both power pins unconnected.
Each PC sees its adapter as a serial port, and Kionel uses it exactly as above. The one-way property is the missing wire, as with the 9-pin cable; the adapters themselves are ordinary two-way USB devices, so the limits below apply.
The app also offers 1,500,000 and 3,000,000 baud as experimental speeds. They depend on the adapter chip and on short wires, and we have not measured them on hardware yet; if frames are lost, step down. For a supported continuous link, contact us.
Sending with Kionel
- On the receiving PC, open Kionel in Chrome or Edge, choose Receive → Sender has no camera — show a code and Serial cable, set the speed and press Choose the serial port and listen.
- On the isolated PC, open Kionel (the offline package works), choose the file, type the receiver's code, open Send over a serial cable, set the same speed and press Choose the serial port and send.
- The receiver checks the file against the signed dispatch record and signs the delivery receipt. With a folder chosen, the file and receipt are written straight into it.
Because nothing comes back, the sender cannot know the receiver finished; after one full pass it stops and offers Send more, which continues the same transfer for a receiver that started late or lost data. The code or a receiver card is what keeps the content encrypted on the wire; the cable is what keeps the direction one-way.
Unattended: watch a folder
For files that appear on their own, such as logs, alarm exports and batch reports, the sending PC can watch a folder instead of a person choosing each file. Every new or changed file is encrypted to the receiving computer's card, signed and sent; the receiving computer, set to Keep listening after each file with a folder chosen, writes each file and its receipt there. A file still being written is left alone until it has not changed for two seconds.
The other direction: into an isolated PC
Turn the cable round and the isolated PC becomes the receiver: methods, recipes or reference files go in, and nothing can come out, because its transmit pin is not connected. That is the direction classified and safety networks usually care about. The isolated PC listens with the offline package; the outside computer sends. The delivery receipt is then made on the isolated side and stays there, where it can be printed or sealed.
Who may send?
A cable answers this physically: the sender is whatever is wired to the other end. The receiving computer can also answer it itself. After the first delivery, press Accept only this sender from now on: the receiver pins the key that signed the file, and from then on refuses anything signed by another key, names that key and saves nothing. A second sending PC can be added from the refusal message. This is key pinning, as in SSH, not certificates: it says which key may send, and a key copied from a compromised PC would still be accepted.
A transfer that is replayed byte for byte carries the same signed dispatch as before. The receiver recognises it from its transfer log and does not deliver it a second time.
Did everything arrive?
Nothing comes back over a one-way cable, so the sending PC never learns whether a file arrived. Diode vendors answer this by comparing the logs of both sides by hand. Kionel's records are signed on both sides, so the comparison can be checked: download the signed records on the sending and on the receiving computer and drop both on the verifier. It lists every file the sender signed, with the receiver's verified receipt or without one. The sender's records are a file like any other and can be sent over the cable itself.
How this differs from a certified data diode
- No certification. Commercial diodes carry evaluations such as Common Criteria and are built so the one-way property survives failures. A home-made cable is only as good as its wiring and its label.
- A USB adapter is a USB device. Where USB ports are locked, use the PC's built-in COM port at 115,200 baud, or have IT allow the specific adapter.
- It moves files, it does not bridge networks. No protocol conversion, no continuous replication between networks. For that, a diode is the right tool.
- Content is not scanned. What leaves the PC is what was on it. Kionel signs and checks the bytes; it does not inspect them.
For files leaving an instrument PC a few times a day, those limits are usually acceptable, and each transfer still ends with a dispatch record and a delivery receipt an inspector can check. The comparison of diodes, USB and optical transfer helps with the wider choice.