Sending a file between two computers often involves frustrating obstacles: setting up temporary SSH access, dealing with NAT router port forwarding, or uploading confidential files to third-party cloud storage like Google Drive or WeTransfer. croc (created by Zack Scholl) makes peer-to-peer file transfer as simple as typing one memorable code phrase, complete with end-to-end encryption and automatic resume capability.
Why Developers Rely on croc
- Password Authenticated Key Exchange (PAKE): Generates a random cryptographic keypair using a short memorable passphrase. The relay server facilitates the initial handshake but cannot decrypt the data payload.
- Direct LAN P2P Acceleration: If both computers are on the same local Wi-Fi or wired network, croc automatically switches to direct local socket streaming for gigabit-speed transfers.
- Resumes Interrupted Transfers: If Wi-Fi drops halfway through a 20GB database dump transfer, running the command again picks up right where it left off.
croc PAKE Handshake & Tunnel Architecture
croc vs Traditional File Transfer Methods
| Feature | croc | scp / rsync | Magic Wormhole |
|---|---|---|---|
| Firewall / NAT Traversal | Automatic (Relay fallback) | Requires open inbound SSH port | Automatic |
| Transfer Resume | Built-in automatic resume | Supported via rsync flags | No (Restarts from zero) |
| Cross-Platform Speed | Fast (Compiled Go binary) | Fast (C binary) | Moderate (Python implementation) |
By default, croc connects through a free public relay server maintained by the developer. While the data payload is end-to-end encrypted, enterprise environments or homelab users transferring sensitive files can self-host their own private relay using: croc relay. Point your clients to your private relay using croc --relay "myrelay.domain.com:9009" send <file>.
Learn more at the official croc GitHub repository.
Discussion & Issues
Comments
Post a Comment