August 17th, 2024

Magic Wormhole: get things from one computer to another, safely

Magic Wormhole is a secure file transfer tool using single-use codes, compatible with Python 3.8+, with comprehensive documentation available online, and released under the MIT license for broad usage.

Read original articleLink Icon
SatisfactionAppreciationCuriosity
Magic Wormhole: get things from one computer to another, safely

Magic Wormhole is a library and command-line tool available on GitHub that facilitates secure file and directory transfers between computers, as well as the transfer of short text snippets. The system operates using "wormhole codes," which are short, human-readable, and single-use codes generated by the sending machine. The recipient must enter this code to complete the transfer, ensuring a user-friendly experience. The library is compatible with Python versions 3.8 and higher, and comprehensive documentation is provided for users, including installation instructions available on the official documentation site. Magic Wormhole can be installed on various operating systems or directly from the source. It is released under the MIT license, allowing for broad usage and modification.

- Magic Wormhole enables secure file transfers using short, single-use codes.

- It is compatible with Python 3.8 and higher.

- Comprehensive documentation and installation instructions are available online.

- The tool is open-source and released under the MIT license.

AI: What people are saying
The comments on the Magic Wormhole article reflect a range of user experiences and suggestions regarding the file transfer tool.
  • Many users praise Magic Wormhole for its reliability and effectiveness in transferring large files, especially in challenging network environments.
  • Several comments suggest alternative tools and projects, indicating a broader interest in file transfer solutions.
  • Users express a desire for additional features, such as a GUI or web-based options for easier file sharing.
  • Concerns about security and the usability of the code generation process are raised, highlighting the need for clarity in its implementation.
  • Some users share personal anecdotes about how Magic Wormhole has been beneficial in specific scenarios, such as transferring files to locked-down corporate machines.
Link Icon 47 comments
By @geerlingguy - 6 months
I've used this for years when passing large files between systems in weird network environments, it's almost always flawless.

For some more exotic testing, I was able to run my own magic wormhole relay[1], which let me tweak some things for faster/more reliable huge file copies. I still hate how often Google Drive will fall over when you throw a 10s-of-GB file at it.

[1] https://www.jeffgeerling.com/blog/2023/my-own-magic-wormhole...

By @aftergibson - 6 months
This is one of those amazing single feature utilities that does one thing incredibly well and goes completely unnoticed as it’s so good but also unremarkable. I should try to be more grateful for these brilliant creations.
By @hoppyhoppy2 - 6 months
A similar project with some nice features that I use is croc: https://github.com/schollz/croc
By @netsec_burn - 6 months
I've used wormhole once to move a 70 GB file. Couldn't possibly do that before. And yes, I know I used the bandwidth of the relay server, I donated to Debian immediately afterwards (they run the relay for the version in the apt package).
By @DavideNL - 6 months
Just noticed by coincidence there's also:

"Rust implementation of Magic Wormhole, with new features and enhancements": https://github.com/magic-wormhole/magic-wormhole.rs

By @lotharrr - 6 months
author here.. happy to answer any questions!
By @smusamashah - 6 months
By @alanbernstein - 6 months
I realize this is a dumb question, but what's a good way to do this between an iPhone and a MacBook? Airdrop is disabled (by policy), iCloud storage is full (because I'm lazy), and I use syncthing on every other device, but I haven't found a client I can use on my work iPhone.
By @dang - 6 months
Related:

Magic Wormhole: Get things from one computer to another, safely - https://news.ycombinator.com/item?id=27262193 - May 2021 (178 comments)

By @dunk010 - 6 months
Tailscale has that Taildrop thing now, too: https://tailscale.com/kb/1106/taildrop
By @toomim - 6 months
How does this relate to https://wormhole.app/ ?
By @justmarc - 6 months
I wasn't yet planning for it, but what the heck.

https://zynk.it is a new project I've been working on together with a small team aimed at delivering a truly easy, fast, efficient, unlimited, privacy-respecting and pain free file-sharing experience. It’s peer-to-peer, E2EE and avoids centralized storage, aligning with the ethos of control and transparency we often discuss here. It allows users to send and receive any file(s) or folder(s) without any limits whatsoever between any device/OS and any device/OS, send and forget, Zynk takes care of all the heavy lifting.

What I hope sets Zynk apart is that it is built to literally be used by anyone, be it a power user, or my mom.

One of my main goals with this project is to remove any pains associated with data transfer once and for all, for any use case.

I'm curious if this resonates with you—would you use it? What would make it indispensable for your workflows?

I'd be happy to discuss it more if anyone is interested. Feel free to sign up for early access on the site.

By @xeanotods - 6 months
I almost lost a job for using this at work. Still not sure how they detected it.
By @annoyingnoob - 6 months
I feel like this project could use a diagram. Maybe I'm a visual learner. I looked at the github link and the docs. It mentions that is uses a couple of servers. Without reading through the Installation steps I didn't grok how it works. A simple diagram with a couple of endpoints and how they connect would go a long way.
By @mynameisash - 6 months
I don't recall where I saw it (either the Python or Rust implementation, most likely), but there was talk about trying to turn this into a browser plugin. I would love to be able to use my browser to send files to someone else (via their browser, if they so choose).
By @lazyeye - 6 months
Slightly off-topic but this explainer article on how TailScale traverses NATs/firewalls is interesting. Tailscale fools both endpoints into believing they are initiating the same network connection simultaneously enabling direct connection between 2 endpoints that would otherwise be impossible.

https://tailscale.com/blog/how-nat-traversal-works

By @bakkoting - 6 months
If you already have node and npm installed, and are happy running random binaries from the internet, you can `npx magic-wormhole` to run this without any further setup. It just wraps wormhole-william, which is the go implementation of magic-wormhole.

I put it on npm primarily so I could send things to other JS developers an absolute minimum of fuss: one command, total, instead of installing a tool and then running the command.

By @lostbeginner0x0 - 6 months
I'm inexperienced and I see a lot of posts like this where open-source that's seemingly loved by the community just don't get the support that they seem to need to survive for a long time.

Why aren't people who know about this and hold important positions doing something about the ecosystem? What can people with no experience but care do to ensure the longevity of open source tools like this?

By @j1elo - 6 months
I'm reading so many good comments that I will be trying Magic Wormhole soon.

How about Warpinator [1]?

It's the application that I use simply because it came by default with my choice of Linux distro, and it works fine. Main use case for me is sending recently taken photos from my phone to the computer.

[1]: https://github.com/linuxmint/warpinator

By @HoyaSaxa - 6 months
> The codes are short and human-pronounceable, using a phonetically-distinct wordlist. The receiving side offers tab-completion on the codewords, so usually only a few characters must be typed.

How does this work from a security perspective? Given the lack of apparent entropy can’t a malicious actor conceivably enter the correct phrase before the good actor?

By @malkosta - 6 months
I have a friend who is not tech savvy at all. And I need him to send me a huge file. Is there any GUI frontend for this?
By @archgoon - 6 months
Just wanted to say thank you to the maintainer and creator of magic wormhole. I had to help my nephew debug what had happened to his computer which didn't have any gui after a restart. Setting up magic wormhole to send files back and forth was a feasible solution over the phone.
By @zzo38computer - 6 months
To send a file from one computer to the other by internet (although often internet should not be needed for this), I think netcat should do. Use tar or something else like that if you want to send multiple files. Use programs to calculate the hash if you want to verify the hash of the file. For large files, it does help to make resumable transfer; fortunately, that can be done easily, too (you can see what the file size is and use the "tail" program to skip some).

You should not need HTTP, FTP, etc. You should be able to use something which can work on any computers, such as just TCP/IP. Unfortunately, some systems (especially some Windows systems) will make that difficult. Using the more complicated such as Magic Wormhole and other programs means you will need two computers that support such a thing. I did once try to transfer a file from Windows to Linux, and had to install ncat to do so but Windows deletes it by default if you try to do that, but I was able to make it to not to do that.

By @XorNot - 6 months
I've been running Pairdrop - https://pairdrop.net/ on my home network and it works great to let my wife out visitors easily share files off phones or laptops when you need a GUI.
By @yownie - 6 months
Do I understand correctly from this thread that there's still no good one reliable way to send files across networks where both participants are NAT'd ?

What about using Onionshare to solve NAT'ing or at least Topr for handshaking?

By @ruph123 - 6 months
If the devices are on the same network I prefer LocalSend. It is cross-platform and there are phone apps. Works very well: https://localsend.org/
By @ddtaylor - 6 months
I find `syncthing` pretty useful for this kind of stuff. It's been around a long time and has a lot of different options for configuration and clients for every platform you could imagine, both UI based and command line.

On every *nix platform I would just install the `syncthing` package and use it quite easily. I've experimented with some wormhole stuff before and looked at this package some, but there would be a lot of extra steps involved right because of the packaging choices.

The package was removed from Fedora in 37 with the "replacement" being use a Snap instead [1]. That doesn't make any sense because that platform is heavily invested in Flatpak and it's very "against the grain." There are some other "Wormhole" apps on Flathub that are verified, but none of them are the same as this. Are they compatible protocol wise or just named similar things? That's assuming you want to enter the game of "is this app safe or made by the same entity?"

I want to enjoy this project and others like it, but it's very confusing. The goal of these tools is to simplify transfer of files and to take most of the "pain" in doing that away. Yet, to actually use most of these tools in any meaningful way between two computers you would need to invest more time into getting this to run on those systems. My brain tells me to make this work you need a big button on the homepage for each well supported platform that just says "Download for Windows" along with a one-click solutions for various Linux platforms (one line command, Flatpak, AppImage, etc.)

[1]: https://magic-wormhole.readthedocs.io/en/latest/welcome.html...

By @emrah - 6 months
Is it better or more appropriate than rsync in certain use cases?
By @ku1ik - 6 months
wormhole is awesome, useful especially in ad-hoc scenarios. I use it often to copy files between systems when I can’t use scp (because of no relevant entries in authorized_keys.
By @jedisct1 - 6 months
Also Piknik: https://github.com/jedisct1/piknik

The first thing I install on any new computer.

By @bredren - 6 months
Is there a wrapper for wormhole that shares the phrase with a counterparty and their client auto requests it?

I have a pal where we want this kind of auto accept style behavior.

By @menzoic - 6 months
Autocompleting secrets sounds unsafe.

> The receiving side offers tab-completion on the codewords, so usually only a few characters must be typed.

By @onetimeuser1235 - 6 months
I've been using this for years. Also, GPU host Runpod uses it in their CLI tools to easily transfer large files to host.
By @scosman - 6 months
https://www.sharedrop.io (source: https://github.com/szimek/sharedrop) is a great user friendly option as well. I use it with friends, and even between VMs on the same machine.
By @jmakov - 6 months
Can it also generate a link so the client can just ckick on it instead of having to install things?
By @Arubis - 6 months
Magic wormhole is a lifesaver for getting config files onto locked-down corporate machines.
By @scirob - 6 months
old but gold use it on the regular. Only thing that could be improved is an option for someone receiving the file to open it up on a website. file.pizza used to do this
By @Obscurity4340 - 6 months
What do all the brilliant folk here think of Resilio Sync?
By @afh1 - 6 months
What ever happened with just setting up ssh or sftp?
By @zkader - 6 months
An alternative that tends to be faster (note: I'm one of the authors) https://github.com/SpatiumPortae/portal
By @meindnoch - 6 months
Does it work without an Internet connection?
By @hypertexthero - 6 months
Excellent, thank you!

Setting this up on a PC and Mac to transfer files back and forth.

There’s an XKCD for this, too: https://xkcd.com/949/

By @TZubiri - 6 months
Obligatory xkcd

https://xkcd.com/949/

By @tarruda - 6 months
I wonder if magic-wormhole could be implemented as a layer on top of Syncthing:

- Generate a short code

- Use the code as the seed to deterministically generate a Syncthing device key + config

Since the Syncthing device key could be generated deterministically, sharing the code with both sides would be enough to complete a dir/file transfer and then discard the keys.