magic-wormhole — Get Things from One Computer to Another, Safely
magic-wormhole sends files and text between computers using short human-readable codes like "7-crossover-clockwork". End-to-end encrypted via PAKE, relay-free when possible, and the original inspiration for croc and friends.
What it is
magic-wormhole is a command-line tool that sends files and text between computers using short, human-readable wormhole codes like '7-crossover-clockwork'. It provides end-to-end encryption via the PAKE (Password-Authenticated Key Exchange) protocol, meaning neither the relay server nor any intermediary can read your data. No accounts, no configuration, no firewall rules needed.
magic-wormhole is suited for anyone who needs to transfer files between two machines quickly and securely, especially when the machines are on different networks.
How it saves time or tokens
Alternatives for file transfer include email attachments (size limits), cloud storage (requires login), scp (requires SSH setup), or USB drives (requires physical access). magic-wormhole eliminates all these requirements. The sender runs one command and gets a code. The receiver enters that code on another machine. The transfer happens directly between the two machines when possible, or through an encrypted relay when direct connection is not feasible. Total time from decision to transfer: under 30 seconds.
How to use
- Install magic-wormhole:
pip install magic-wormhole
# or
brew install magic-wormhole
# or
sudo apt install magic-wormhole
- On the sender machine:
wormhole send report.pdf
# Output: Wormhole code is: 7-crossover-clockwork
- On the receiver machine:
wormhole receive 7-crossover-clockwork
# File transfers with end-to-end encryption
Example
Transferring text and directories:
# Send text
wormhole send --text 'API key: sk-abc123'
# Receiver gets the text securely
# Send an entire directory
wormhole send --zip myproject/
# Receiver gets a zip archive of the directory
# Send with a custom code for easier communication
wormhole send --code 3-purple-elephant report.pdf
The wormhole code is the only secret needed. Both sides derive the encryption key from it using SPAKE2, so the relay server never sees the key.
Related on TokRepo
- Security tools — Browse security and encryption tools
- Self-hosted tools — Explore self-hosted utilities
Common pitfalls
- Sharing the wormhole code over an insecure channel. The code is the only authentication factor. Share it verbally, via encrypted chat, or any channel you trust. Anyone with the code can receive the file.
- Expecting large file transfers to be fast over slow networks. magic-wormhole does not resume interrupted transfers in the default implementation. For very large files over unreliable connections, consider tools with resume support.
- Not realizing the code expires after one use. Each wormhole code is single-use. If the transfer fails, you need to generate a new code.
Frequently Asked Questions
Yes. magic-wormhole uses the SPAKE2 protocol (a PAKE scheme) to derive a shared encryption key from the wormhole code. The relay server facilitates the connection but cannot decrypt the data. Even if the relay is compromised, your transfer remains encrypted.
Yes. magic-wormhole works on macOS, Linux, and Windows. The sender and receiver can be on different operating systems. The protocol is the same regardless of platform.
There is no hard size limit in magic-wormhole itself. Transfers of several gigabytes work fine. Speed depends on network bandwidth. For very large transfers, the --transit-helper flag can improve performance by using a direct connection.
Yes. magic-wormhole includes a relay server component that you can deploy on your own infrastructure. This is useful for organizations that want to keep all transfer metadata on their own network. The relay only sees encrypted data.
magic-wormhole was inspired by the desire for simple, secure file transfer that anyone can use without technical setup. The PAKE-based approach means security comes from the protocol, not from user configuration. Several alternative implementations exist in Rust and Go.
Citations (3)
- magic-wormhole GitHub— magic-wormhole uses PAKE for end-to-end encryption
- magic-wormhole Protocol Docs— SPAKE2 password-authenticated key exchange protocol
- SPAKE2 RFC— PAKE-based key agreement for secure transfer
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.