Portus
Self-hosted secure file transfer
A file transfer app and server I built so the computers in my household could share files without a cloud service in between. It runs on macOS, Windows and Linux. Devices sign in with Ed25519 keys instead of passwords, over TLS 1.3, and every file is checked end to end with SHA-256. I wrote the protocol as a specification first, then had it checked by code written from that spec alone.
- Role
- Sole developer
- Timeline
- Fall 2026
- Type
- Network systems
- Stack
- Java 21
- TLS 1.3
- Ed25519
- Swing (FlatLaf)
- Docker
- Python
- Jazzer
- GitHub Actions
The problem
My household moves photos, documents and large files between a Mac, a Windows desktop and other machines. Cloud services hand those files to a third party, and the tools that avoid that, like scp and SMB shares, are hard for non-technical people to set up safely. My earlier version, a course project (TCP File Transfer), sent everything in the clear, had no idea who was connecting, couldn't resume a broken transfer, and stopped at 255-byte names and 255-file listings. I needed something a family member could set up from the docs, that an attacker on the network couldn't read or tamper with, and whose security I could show rather than just claim.
The approach
I wrote a STRIDE threat model (opens in a new tab) before any cryptography code, then a protocol specification (opens in a new tab) with MUST and SHOULD rules and worked byte-level examples. The Java tests read those examples straight from the spec, so the spec and the code can't drift apart. To check the spec was complete, a second server and a second decoder were written in Python from the spec alone, and the Java client is tested against them. Identity works like SSH: each device has its own key, the server keeps a list of authorized keys, and a client pins the server's key on first connect, or before it with a pairing code, and refuses to continue if that key ever changes.
System design
C 10 00 00 00 08 50 52 54 53 00 01 00 01
S 11 00 00 00 0e 00 01 00 ff 01 2c 00 00 00 00 40 00 00 00Without TLS: the file's name is in the packets Portus over TLS: the same search finds nothing
What I built
- Designed the Portus protocol and its specification: a versioned handshake, typed and length-prefixed frames, 64-bit sizes, SHA-256 per file, resumable uploads and downloads, paged listings and folders.
- Built key-based identity on TLS 1.3 with mutual authentication. Server keys are pinned or paired, keys can be revoked (a removed device is cut off within a second), and repeated failed handshakes lead to temporary bans.
- Built per-user shares with read-only and read-write grants and quotas reserved atomically, and kept path-traversal, symlink and hard-link defenses on every request. Every sign-in and file operation goes into a hash-chained audit log whose anchors can be copied off the machine. The server also runs without a window or in Docker, alongside a command-line client.
- Kept the security out of the way. Devices sign in with keys only, so there is no password to send, reuse or phish, and the app offers no cryptography settings to get wrong: TLS 1.3, Ed25519 and SHA-256 are fixed. The trade-off is less flexibility, and a device that loses its key has to be added again. The Protocol Inspector is opt-in, so the default view is just two folders.
- Tested it from the outside as well as the inside, and documented every check (opens in a new tab). In Wireshark, the same search that finds a file's name in an unencrypted session finds nothing in a Portus session over TLS. When testssl.sh couldn't get past the key check, I checked the TLS settings directly with openssl s_client. Jazzer ran the parser 748 million times, the client 32 million and the server 2 million, with no crash or finding. CI runs about 200 tests on macOS, Windows and Linux, and tests demonstrate the attacks on textbook RSA from my RSA write-up (opens in a new tab).
More screens
The result
Portus 1.0 is released on GitHub for macOS, Windows and Linux, and none of the packages need Java installed. The Linux packages and the Mac command-line tools rebuild byte for byte, and the release is immutable with a signed attestation (opens in a new tab). My household has moved to it for everyday file sharing, and an outside tester used it for a week, with everything they found fixed. On the same Wi-Fi network, downloads and large uploads run level with scp, and I published the full comparison (opens in a new tab), including where rsync was faster.