13 ms·
Magic Wormhole: Get things from one computer to another, safely
- ptomato 5y agoSee also the (compatible, same middle server by default) golang port, https://github.com/psanford/wormhole-william https://github.com/psanford/wormhole-william, complete with static binaries for mac/win/linux. I've found this helpful when I've needed to send files to somebody who would have problems getting a whole pythonpile of dependencies installed.
- anotherhue 5y agoMagic Wormhole is one of my absolute favourite tools. see also https://wormhole.app/ https://wormhole.app/
- gidam 5y agoto avoid confusion Ferros should have chosen a different and better name, considering that magic-warmhole is an older project doing more or less the same thing (with different and better technology and it's real free software)
- atonse 5y agoIs this open source? How do we know it's doing as advertised?
- deleted 5y ago[deleted]
- lotharrr 5y agoFor (my) magic-wormhole, yep, entirely, source is on the github link above. It uses a pair of helper servers (that I run), for which the source is also on github. But the protocol (implemented in the client, not the server) is carefully designed to be resistant against server misbehavior. So you can either study the client and convince yourself the protocol is indeed secure, or rely upon my claims that my code is working as advertised. But you don't need to rely upon my claims that my servers are not snooping or interfering: that's protected by the protocol.
- noahmasur 5y agoThey're actually different projects. This is what I could find for wormhole.app source: https://github.com/SocketDev/wormhole-crypto https://github.com/SocketDev/wormhole-crypto
- lotharrr 5y ago(author of magic-wormhole here) aww, thanks :) BTW for anyone reading, https://wormhole.app/ https://wormhole.app/ is awesome and serves a very similar purpose, but uses entirely different technology (no PAKE) and has a different security model. In my (https://magic-wormhole.io https://magic-wormhole.io) world, we've kicked around ways to make a good browser-based client (and I've tried to prepare the protocols to work well there), but I haven't had time to pursue any of them. The tasks include 1: port everything to JS (or take the core of the Rust port and compile it to WASM, then write an IO layer in JS), 2: glue it to the browser's file/blob upload/download APIs, 3: settle on a trusted-application security model. To make it work in a vanilla browser with no setup phase, you're pretty much limited to relying upon the webserver from which you get the page, which is the model wormhole.app provides. Other options include using an addon (which shifts the reliance set slightly), or running some sort of Electron thing (making it not really a browser app) that you get from some distribution channel (debian, homebrew, etc) which shifts the reliance set in a better direction.. at least you're probably getting the same application as everybody else using that distribution, vs a webserver that could conceivably serve up a different version each time.
- ccmcarey 5y agoFYI looks like magic-wormhole.io doesn't listen on 443, only on port 80 (which redicts to github).
- tptacek 5y agoFor what it's worth, and I know you're not looking for this fight, but I think it's important: There is a world of difference between what Magic Wormhole can promise and what Wormhole.app can promise. Magic Wormhole relies entirely on clientside cryptography; once you have it installed, you can trust that it's doing what it says on the tin. Which means you can reasonably use it operationally. "Wormhole.app" --- which has a frustrating name, given the distinction --- demands that you trust the server, since the server can on every transaction defeat the cryptography you're using. If someone owns up a Magic Wormhole relay server, there's not much they can plausibly do to intercept the files you send. But if someone owns up Wormhole.app, they can, I believe, quietly pick up and store people's files. Incidentally, apropos none of this: I've been using the Golang https://github.com/psanford/wormhole-william https://github.com/psanford/wormhole-william port on some of my machines for a year now, interoperating with the standard Python Magic Wormhole, and it works great. Magic Wormhole is an achievement. I wrote a blog post about modern cryptographic tools, and what I have to say about Magic Wormhole is that everyone I've introduced to it immediately starts wormholing all sorts of stuff; it's kind of addictive. Thanks for designing it!
- CobrastanJorji 5y agoThat seems like a wonderful service, but if it allows up to 100 downloads over 24 hours, I kind of worry that it's gonna get massively abused for nefarious purposes. It's not quite "publicly writable S3 bucket" abusable, but it's close.
- oldfart2 5y agoHave you heard of the command scp? It comes standard on most distros.
- andrewnicolalde 5y agoThat requires opening a port if you intend to perform a transfer over the internet :)
- deleted 5y ago[deleted]
- byproxy 5y agoSee also: https://github.com/schollz/croc https://github.com/schollz/croc
- IanCal 5y agoI'm a little confused about the security model - with a default middle server and a 1/65536 chance of guessing the password, isn't it fairly likely it could be guessed? Or just a clash of passwords (birthday paradox)? I think I'm probably missing something.
- alecst 5y agoHere's a link from Brain Warner (the author) talking about that: https://www.youtube.com/watch?v=oFrTqQw0_3c&t=1775s https://www.youtube.com/watch?v=oFrTqQw0_3c&t=1775s Hope it helps, it's a good question.
- ptomato 5y agoYou only get one shot at guessing it per transmission attempt.
- gojomo 5y agoIndeed, and as the docs (https://magic-wormhole.readthedocs.io/en/latest/welcome.html#design https://magic-wormhole.readthedocs.io/en/latest/welcome.html...) explain, you'd likely notice an active attack, and the paranoid can choose any arbitrarily-longer code: > PAKE effectively trades off interaction against offline attacks. The only way for a network attacker to learn the shared key is to perform a man-in-the-middle attack during the initial connection attempt, and to correctly guess the code being used by both sides. Their chance of doing this is inversely proportional to the entropy of the wormhole code. The default is to use a 16-bit code (use –code-length= to change this), so for each use of the tool, an attacker gets a 1-in-65536 chance of success. As such, users can expect to see many error messages before the attacker has a reasonable chance of success. (It does strike me, however, that if a 'mailbox server' becomes heavily used, with many pending-but-incompleted wormholes, then an attacker making random guesses might manage to receive someone's random file, instead of the real intended-recipient. Perhaps the sending-side should optionally require an interactive sender-ack, after showing for confirmation a receiver-generated unique secret? In any case: using a longer code, and/or using a private mailbox, could each help eradicate such risks.)
- mahathu 5y agoI use a Telegram (web) chat with myself for sharing files across devices occasionally and it works exceptionally well.
- jstanley 5y agoThere are 2 obvious problems with this approach that Magic Wormhole fixes: 1. you can't start downloading on the other side until the upload is complete - for large transfers this is a significant delay 2. the Telegram operators can read your files
- suifbwish 5y agoTelegram is end to end encrypted
- ycombinete 5y agoNot by default
- SilverRed 5y agoAnd only on mobile so the web client can never be encrypted.
- throwaway67114 5y agoThe only thing end to end encrypted in Telegram is 1 on 1 mobile chats and calls, and you have to explicitly enable it.
- mahathu 5y agoThe instant transfer/download start a really good point in favour of wormhole! I'll give it a try.
- sorenjan 5y agoYou can also use python and any kind of http download tool (browser, curl). Works well within a local network, or if you have control over your firewall. python -m http.server 8000
- pmccarren 5y agoI'm a huge fan of croc[0]. Very similar to Magic Wormhole, but a bit more flexible and written in go. Straight from the README: > croc is a tool that allows any two computers to simply and securely transfer files and folders. AFAIK, croc is the only CLI file-transfer tool that does all of the following: - allows any two computers to transfer data (using a relay) - provides end-to-end encryption (using PAKE) - enables easy cross-platform transfers (Windows, Linux, Mac) - allows multiple file transfers - allows resuming transfers that are interrupted - local server or port-forwarding not needed - ipv6-first with ipv4 fallback - can use proxy, like tor refs: [0]https://github.com/schollz/croc https://github.com/schollz/croc
- WhatIsDukkha 5y agoSadly croc lacks "wormhole ssh invite" which is about 90% of my use of wormhole.
- CobrastanJorji 5y agoThat sounds super useful, but I don't see it mentioned in the documentation anywhere. I found it in the source code, though. Looks like it allows a remote user to add credentials to an authorized_keys file?
- WhatIsDukkha 5y agoFrom the docs - """ wormhole ssh --help Usage: wormhole ssh [OPTIONS] COMMAND [ARGS]... Facilitate sending/receiving SSH public keys Options: --help Show this message and exit. Commands: accept Send your SSH public-key In response to a 'wormhole ssh invite'... invite Add a public-key to a ~/.ssh/authorized_keys file """
- psanford 5y agoCroc has a history of major security vulnerabilities.
- qrv3w 5y ago
- deleted 5y ago[deleted]
- ghostly_s 5y agoDidn't Mozilla have a project similar to this a few years back that was discontinued?
- HanayamaTriplet 5y agoI believe you're thinking of Firefox Send: https://support.mozilla.org/en-US/kb/what-happened-firefox-send https://support.mozilla.org/en-US/kb/what-happened-firefox-s...
- Fiahil 5y agoAs always, the most difficult problem is not sending files between computers, but between smartphones, tablets and computers. I'm still looking for a solution I could use to share pictures and PDF files from Android phones to iPads and Laptops using the "share" modal and completely self-hosted...
- offtop5 5y agoAny reason FTP doesn't work ? I imagine you could run an FTP server on a Raspberry Pi
- jandrese 5y agoBeing completely plaintext makes it unacceptable for many use cases in the modern world. It's also a touch more complicated than it needs to be for the standard use case. Binary vs. ASCII transfer mode (and ASCII is the default most of the time even though it only very rarely makes sense). Plus the whole passive vs. active mode thing. Too many footguns and no security rule it out.
- lucgommans 5y agoIf you're running FTP as plaintext you're indeed doing it wrong, I'm not sure that that must be what GP meant. Not as if we explicitly mention (START)TLS for every other protocol that supports it.
- SilverRed 5y agoYou can't have secure FTP without a certificate and you can't have a certificate without DNS/domain names unless you want to manually add certificates around which is bad UX again. The ideal situation would be some universal airdrop which will never happen. The next easiest solution is to use cloud storage and send a link to the other person.
- lucgommans 5y ago
- jsnell 5y agoPrevious discussion, including two frontpage submissions this year: https://news.ycombinator.com/item?id=9953767 https://news.ycombinator.com/item?id=9953767 https://news.ycombinator.com/item?id=14649727 https://news.ycombinator.com/item?id=14649727 https://news.ycombinator.com/item?id=24702975 https://news.ycombinator.com/item?id=24702975 https://news.ycombinator.com/item?id=27237536 https://news.ycombinator.com/item?id=27237536
- dang 5y agoThanks! Here's a formatted list. (I think we'll probably just make HN's software automatically render links to past threads this way—I can't think of any downsides.) Magic-Wormhole: Get Things from One Computer to Another, Safely - https://news.ycombinator.com/item?id=27237536 https://news.ycombinator.com/item?id=27237536 - May 2021 (4 comments) Magic-Wormhole: Get Things from One Computer to Another, Safely - https://news.ycombinator.com/item?id=24702975 https://news.ycombinator.com/item?id=24702975 - Oct 2020 (9 comments) Ask HN: What is your favorite method of sending large files? - https://news.ycombinator.com/item?id=24351111 https://news.ycombinator.com/item?id=24351111 - Sept 2020 (354 comments) Ask HN: A more convinient Magic Wormhole alternative? - https://news.ycombinator.com/item?id=21352217 https://news.ycombinator.com/item?id=21352217 - Oct 2019 (3 comments) Magic-Wormhole – Get things from one computer to another, safely - https://news.ycombinator.com/item?id=14649727 https://news.ycombinator.com/item?id=14649727 - June 2017 (179 comments) Get things from one computer to another, safely - https://news.ycombinator.com/item?id=9953767 https://news.ycombinator.com/item?id=9953767 - July 2015 (15 comments)
- arthurcolle 5y agoThat would be awesome! EDIT: how will it be done? As another link or as some kind of expandable thread, or with a bot maybe?
- dang 5y agoI don't know yet! Suggestions are welcome! Probably not with a bot though.
- hnnnnnnng 5y agoHow many of these webrtc peer to peer file sharing sites are we going to have? I swear there are hundreds at this point. None of them offer anything different than each other. Sure, it's a great project for a frontend dev to throw together on a weekend. But that's about it
- brink 5y agoThere are a lot of them because they're fun to write. NES emulators are another example.
- tgsovlerkhgsel 5y agoDid you read the link? This is a cli application. I am not aware of them also offering a web site, although that would certainly be a great addition.
- dennis-tra 5y agoMagic wormhole isn’t strictly peer to peer nor uses WebRTC as the traffic is routed through a relay server. This was my motivation to build one of these hundreds file sharing tools [0]. My aim was to build a truly decentralised file sharing CLI as basically a drop-in replacement for croc/magic-wormhole - so it seems relevant to mention it here. It’s based on libp2p and comes with its own trade offs. lotharrr (the author of magic-wormhole) gave kind and valuable feedback when I posted it on HN [1]. [0] https://github.com/dennis-tra/pcp https://github.com/dennis-tra/pcp [1] https://news.ycombinator.com/item?id=26127923 https://news.ycombinator.com/item?id=26127923
- Noumenon72 5y agoIs this suitable for transferring files I own off a work computer without getting in trouble? My notes files have gotten too numerous for the amount my work will let me email as one zip file.
- throwaway67114 5y agoDoesn't zip software such as 7zip support splitting of compressed files into as many pieces as you like and then rejoin them when you want?
- deleted 5y ago[deleted]
- shard 5y agoWhat are the use cases for this program and Croc? What does "safely" mean? Is this to share files amongst untrusted computers? For a small number of files, I currently just email them. If the file is too big, Google Drive or MS OneDrive can be used to send a link. This works across any OS and form factor. For bulk downloads (e.g. downloading all photos/videos I took on a certain day), I plug my phone into my PC via USB. Navigation and selection using the file browser on the PC is much nicer than selecting files on the phone. Does Wormhole and Croc enable use cases not covered here?
- lotharrr 5y agoA few I've found: * You're sitting next to someone at a conference (remember those?) and want to hand them a file: fewer steps than email, the wormhole code is easier to transcribe than most email addresses, the file lands where you want it to rather than in a spam folder somewhere, and neither of your email providers or the network in between them can snoop on or modify the data in transit. * You're ssh'ed into a remote machine, via two layers of proxy servers, deep in a directory structure with lots of spaces and quotes and backslashes and other shell metacharacters in the path, and you want to transfer a file from there back to your desktop. You have no idea how to quote everything properly. So you wormhole it to yourself. * I'm on zoom or the phone with a friend and want to send something from my desktop machine to their laptop. I can read the wormhole code off the sending machine, speak it to them over the phone, they can type it into their machine. The codes are optimized for spoken clarity. * I'm debugging something on the little computer attached to my television and want to copy a logfile off to a real machine. I've got a terminal window open on the screen, and a shell, but that account doesn't have an email address, nor is it listening on SSH. I could write a python one-liner that listens on an HTTP port, but there's no security to that. I can 'wormhole send LOGFILE' and read the code from the screen, and type it into my laptop. By "safely" I mean: confidentiality against anything outside your two computers (eavesdropper only learns the length of the data, as is true for most networks), and integrity (nobody in the middle can modify the file, or cause you to receive something different than what your partner sent). The security of most common file transfer methods depends upon some intermediate server, or two, or a dozen (in the case of email). If by "untrusted computers" you're making a distinction between distributing files to computers that you already know about, vs to computers that you've just met, then yes, that's exactly right. If your laptop and your desktop already know about each other, there are a bunch of tools that work better for a lot of cases, like a shared network filesystem or AirDrop. Magic-wormhole is kinda aimed at how to introduce two machines that don't already have a connection. The wormhole code is a way to leverage the connection between the humans who control those computers, into a secure shared encryption key between the computers themselves.
- tvb12 5y ago> The wormhole send file mode shares the IP addresses of each client with the other (inside the encrypted message), and both clients first attempt to connect directly. If this fails, they fall back to using the transit relay. I know nothing about computers. If the clients successfully connect, the file goes from A -> B, but if the connection fails, it goes from A -> relay server -> B? What conditions might cause the connection to fail?
- lunaru 5y agoI'm not familiar with Magic Wormhole specifically, but I think this may be to solve STUN: https://en.wikipedia.org/wiki/STUN https://en.wikipedia.org/wiki/STUN. Specifically if the clients are behind NATs, having a third party server coordinate can help.
- lotharrr 5y agoYep, if both parties are behind NAT, or some sort of firewall that prevents inbound connections from the other, they'll fall back to using the pre-configured public relay server (or any other server you tell them to use). I need to build some better stats dashboards, but at a glance it looks like maybe a third of the connections wind up using that relay. I'd like to add better hole-punching code (using WebRTC sounds like the right approach), but haven't had the time or found the right library yet.
- jmiskovic 5y agoI love this line from your docs on reasons for setting up own transit relay. > You want to provide your users with a relay that fails at different times than the official one What are your costs for running the official relay server? Do you have plans for if/when they significantly increase?
- lotharrr 5y agoMaybe $20/mo. The bandwidth is growing but not too bad so far, every once in a while I see a really huge transfer that makes me wince (seriously, who sustains a gigabit/s for five hours?), but I've still got some margin before I run up against the monthly transfer allowance. When that happens, I'll probably move the server to a provider that has a slower but flat-rate bandwidth plan, maybe Scaleway. Transfers would be capped by their network limit (100Mbit?), but effectively free. I might also change the transit relay to throttle the connection somewhat after some total number of bytes have been transferred (but that takes actual code, and switching providers would be easier). I'm really glad folks are using it, but I do sort of think that >10GB at a time is a bit much. But I don't have a way to notify a given user about any sort of soft limit like that (the transit relay has no idea how much you're going to send ahead of time, and doesn't have a notification channel other than throwing an error). I've also been meaning to figure out NAT hole punching for years now, and the thought has always been that hole-punching will save a lot of the server bandwidth by making direct connections happen a larger percentage of the time.
- upofadown 5y ago>...in general, the sending machine generates and displays the code, which must then be typed into the receiving machine. So you need to have a secure method of communication to transfer the code? Then why not just use whatever that is to transfer stuff? How is this end to end encryption without any identity management? How do you know who you are exchanging stuff with? How is this different than just regular encryption?
- samthecoy 5y ago> So you need to have a secure method of communication to transfer the code? Then why not just use whatever that is to transfer stuff? Because sometimes that secure method of communication is speech. This is a particularly good utility for transferring information to parties that you can talk to verbally. Also, a bit quicker than plugging a USB stick in.
- 1vuio0pswjnm7 5y agoFrom the section titled "Motivation": "Copying files through Dropbox is not secure against the Dropbox server [and results in ...]" Let's say a user encrypts a file outside of Dropbox, using a program of the user's choice, then she transfers the encrypted blob to Dropbox. Is the author suggesting this is "not secure against the Dropbox server". I am not a Dropbox user. I know it was originally for syncing folders and they orginally used an rsync library and that is about all I know. Pardon the ignorance. Magic Wormhole by default uses hardcoded host:port for a rendezvous server and a transit server operated by [undisclosed]. "The URL of a public server is baked into the library for use as a default, and will be freely available until volume or abuse makes it infeasible to support." This Github page is only for the client, not the servers. In the section titled "Dilation", we are reminded that MW is store and forward by default, not direct connection. How are messages stored on the default public MW server operated by [undisclosed] "secure against [undisclosed]" in a way that messages stored with Dropbox are not "secure against Dropbox". Maybe the author only uses MW with private MW servers, not public ones run by other people. Then his comment about Dropbox would make sense. However I have to wonder, how many new MW users are running their own servers.
- aborsy 5y agoObviously if you encrypt client side, and can securely share a strong key, it does not matter where you store; MW and Dropbox would be equally secure in this respect. With MW you share a weak key (vs a strong key in Dropbox case). Dropbox also provides access to all data. On the other hand, you have to hope there is no vulnerability in MW. With Dropbox, you have much more control over crypto.
- art-vandelay 5y agoThe relay is open source (https://github.com/magic-wormhole/magic-wormhole-transit-relay https://github.com/magic-wormhole/magic-wormhole-transit-rel...), but a trust issue still exists because you can't verify that the hardcoded server is running exactly this code.
- lotharrr 5y agoAs aborsy said, if you can encrypt ahead of time, that's great, you're only relying upon the server for availability, (just like magic-wormhole). You would not be vulnerable to the Dropbox server, or the folks who run them, or someone who managed to compromise it, or to confuse it into giving your files to them, or.. say, that bug which caused all authentication to just be turned off entirely for four hours in 2011. But to let your recipient decrypt your pre-encrypted data, you have to communicate your strong (>=128 bit) key to them, as well as enough information to point at the ciphertext (hostname, port, file ID if the server handles more than one at a time). That's a UX challenge, because 128 bits aren't very humane, no matter how you encode them. Dropbox has a feature to let you upload a file and then get a URL you can give to someone else, but it's long and random and hard to read, and still doesn't include any cryptographic protection. Some secure file-transfer systems deal with this by using fewer bits and then applying a "key stretching" algorithm like bcrypt or Argon2. That forces the attacker to do more work for each guess, which maybe lets you get away with.. 80 bits? 60 bits?. But whoever holds the ciphertext (like the server) can remember it forever, so they can just keep trying for as long as they like, so it's hard to have confidence that you've picked parameters that are strong enough, and the attack resistance is directly at odds with the usability. Magic-wormhole is using PAKE to bring the necessary cryptographic data down to a safe minimum (16 bits or so), baking in knowledge of a server (plus allocating the shortest distinct file identifier it can, usually just one digit) to minimize the non-cryptographic data, and using a phonetically-distinct wordlist to maximize the usability / transcribability of the whole thing. It lets you say just "use magic-wormhole and the code is 4-purple-sausages" and you're done. But it's a trick, of course: we can only get aware with codes that short by pointing everybody at the same servers. You can easily self-host, but then you must either recite a lot more information to your recipient ("use magic-wormhole with --relay-url=ws://myserver.example.net:4000/v1 and a code of 4-purple-sausages"), or pre-stage that information by giving them a config file ahead of time. As for the servers, I run them. Their source code is in repos next to that of the client, namely https://github.com/magic-wormhole/magic-wormhole-mailbox-server https://github.com/magic-wormhole/magic-wormhole-mailbox-ser... and https://github.com/magic-wormhole/magic-wormhole-transit-relay/ https://github.com/magic-wormhole/magic-wormhole-transit-rel... . But the client is designed so that you don't have to rely upon the servers or the people running them to still get confidentiality and integrity of your transferred data. Those properties depend just upon the implementation of the client, and of course the computer that you run it on. The initial low-bandwidth data (a few hundred bytes) goes through the "mailbox server". That phase is store-and-forward, and is used both to perform the PAKE protocol (to get a strong shared key), and to use the now-encrypted connection to negotiate whatever else you want to do (like establish a direct connection for file transfer). The bulk data transfer happens over a direct connection if one can be made, else it goes through the "transit relay", but in neither case does large amounts of data get stored on a server. This means magic-wormhole lacks an important feature that many of its competitors have: the ability to close your computer before your recipient has finished (or even started) retrieving the data. I decided to use an approach that was more sustainable by me (the servers use just a tiny DB for the store-and-forward part), and leave the features that start to look like a file-hosting service to other projects.
- ineedasername 5y agoDirect computer to computer transfer seems like a nice convenience. Is there a large scale use for something like this though? At the enterprise level we just use networked drives with some that have write-only access when you need to drop a file to someone else.
- dchess 5y agoIt's not particularly secure but in a pinch I just use the python standard lib server to start an http server in a folder then open up the port with ngrok temporarily to share the file. Security through obscurity for a very discreet time period works.
- dataduck 5y agoI'm sure this is a noobish question, I don't deal with this sort of operation that often. Can anyone help me understand when you would use this or croc instead of scp?
- seedie 5y agoWhen you don't have a direct connection to the sending/receiving ends. Magic Wormhole and croc use Relays for that. And if you want to transfer files to systems without sshd installed and configured.
- second--shift 5y agoIf we have SSH tunnels and rsync, why do we need this?