get things from one computer to another, safely

Overview

Magic Wormhole

PyPI Tests Windows Build Status codecov.io Docs

Get things from one computer to another, safely.

This package provides a library and a command-line tool named wormhole, which makes it possible to get arbitrary-sized files and directories (or short pieces of text) from one computer to another. The two endpoints are identified by using identical "wormhole codes": in general, the sending machine generates and displays the code, which must then be typed into the receiving machine.

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. Wormhole codes are single-use and do not need to be memorized.

For complete documentation, please see https://magic-wormhole.readthedocs.io or the docs/ subdirectory.

This program uses two servers, whose source code is kept in separate repositories: the mailbox server, and the transit relay.

License, Compatibility

Magic-Wormhole is released under the MIT license, see the LICENSE file for details.

This library is compatible with Python 3.6 and higher (tested against 3.6, 3.7, 3.8, and 3.9). It also still works with Python 2.7 and 3.5, although these are no longer supported by upstream libraries like Cryptography, so it may stop working at any time.

Packaging, Installation

Magic Wormhole packages are included in many operating systems.

Packaging status

To install it without an OS package, follow the Installation docs.

Comments
  • Memory overuse in wormhole receive

    Memory overuse in wormhole receive

    Trying to send a large (11.2GB) directory makes the receiving machine seize up. Monitoring in htop, I can see the receive process taking up more and more memory. Strangely, during compression and sending, the sending machine keeps memory to a reasonable, if not small, amount.

    opened by hectorBrown 19
  • ImportError: cannot import name attrs

    ImportError: cannot import name attrs

    Ubuntu 16.04.2 LTS, Google Compute Engine.

    $ wormhole send it_worked.txt Traceback (most recent call last): File "/usr/local/bin/wormhole", line 7, in from wormhole.cli.cli import wormhole File "/usr/local/lib/python2.7/dist-packages/wormhole/init.py", line 6, in from .wormhole import create File "/usr/local/lib/python2.7/dist-packages/wormhole/wormhole.py", line 3, in from attr import attrs, attrib ImportError: cannot import name attrs

    I looked up that error message on the web and didn't find anything resembling clarity. Any hints?

    opened by sowbug 16
  • signing releases

    signing releases

    the Debian packaging process can check for upstream signatures when packaging new tarballs..

    i encourage you to use OpenPGP signatures to certify the source code you ship. it's the only bit missing to ensure a complete trust chain between you as developpers and Debian end-users.

    while we do minimal reviews of changes when we package new upstream versions, some things may go unnoticed if a maintainer is in a rush. having OpenPGP signatures ensures that the packages were not attacked while in transit.

    thanks!

    opened by anarcat 15
  • tests hang against twisted-16.3.0

    tests hang against twisted-16.3.0

    Running 'tox' on wormhole trunk (currently at cdb5c19) hangs at test_scripts.Cleanup. Downgrading Twisted from current 16.3.0 to 16.2.0 lets it pass all tests.

    opened by warner 15
  • Parse IPv6 address in TCP hint (--transit-helper argument)

    Parse IPv6 address in TCP hint (--transit-helper argument)

    I tried pointing to my own transit-relay server by using wormhole --transit-helper=tcp:[1111:2222:3333:4444:cccc:dddd:eeee:ffff]:4001 send "./example.file", however I got:

    non-numeric port in TCP hint 'tcp:[1111:2222:3333:4444:cccc:dddd:eeee:ffff]:4001'
    

    Not using brackets didn't work either:

    non-numeric port in TCP hint 'tcp:1111:2222:3333:4444:cccc:dddd:eeee:ffff:4001'
    

    I dug around and replaced a line in parse_hint_argv in file _hints.py. Once parsing IPv6 addresses worked, I was able to use my transit-relay server to send/receive files over IPv6:

    Sending (->relay:tcp:1111:2222:3333:4444:cccc:dddd:eeee:ffff:4001)..
    100%|██████████████████████████████████████| 13.3k/13.3k [00:00<00:00, 5.00MB/s]
    File sent.. waiting for confirmation
    Confirmation received. Transfer complete.
    

    (An IPv6 address has to be within square brackets, otherwise it isn't recognized.)

    It might not be the most elegant solution to use a complicated regex string, but it does the trick. Hostnames, IPv4, and IPv6 addresses are recognized.

    opened by FelisDiligens 14
  • Issue32 ssh setup.3

    Issue32 ssh setup.3

    Here's a bit more sketched-out version of the idea of a top-level send() and receive() API...This PR also takes out the "just invoke 'wormhole send'" part of the other PR.

    opened by meejah 14
  • refactor to use Click

    refactor to use Click

    Okay, this is ready now I believe. I left "wormhole-server" (e.g. instead of a subcommand) but we'd chatted about making it "wormhole server" so currently it's easy to go back (but if wormhole-server is the way to go then wormhole-server should get its own Config class)

    opened by meejah 14
  • use human-readable sizes more broadly

    use human-readable sizes more broadly

    there was a function to "abbreviate" sizes, but it was somewhat unclear and incomplete. reuse the sizeof_fmt_* set of functions from the borg backup project (MIT licensed) to implement a more complete and flexible display that will scale up to the Yottabyte and beyond. it also supports non-IEC units (like "kibibyte", AKA 1024 bytes) if you fancy that stuff.

    this is a workaround for #91: it allows users to better see the size of the file that will be transfered.

    some places are still kept in bytes, most notably when receive fails to receive all bytes ("got %d bytes, wanted %d") because we may want more clarity there.

    text transfers also use the "bytes" suffix (instead of "B") because it will commonly not reach beyond the KiB range.

    note that the test suite only covers decimal (non-IEC) prefix, but it is assumed to be sufficient to be considered correct.

    opened by anarcat 12
  • Update README.md

    Update README.md

    I needed libsodium-dev on an Ubuntu 15.10 machine, since without it I was getting

    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FO
    RTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c build/temp.linux-x86_64-3.4/_sodium.c -o build/temp.linux-x86_64-3.4/build/temp.linux-x86_64-3.4
    /_sodium.o
    
    build/temp.linux-x86_64-3.4/_sodium.c:390:20: fatal error: sodium.h: No such file or directory
    
    compilation terminated.
    
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    opened by asymmetric 12
  • Server claims 0.9.2 is current, but ours is 0.10.0

    Server claims 0.9.2 is current, but ours is 0.10.0

    See https://github.com/Homebrew/homebrew-core/pull/14914

    I'm trying to update the Homebrew formula but the test block fails with

    iMac-TMP:homebrew-core joe$ brew test -vd magic-wormhole
    /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/magic-wormhole.rb
    Testing magic-wormhole
    ==> Using the sandbox
    /usr/bin/sandbox-exec -f /tmp/homebrew20170624-92376-1uhi4he.sb /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.0.0-p648/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/test.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/magic-wormhole.rb -vd
    /usr/local/Homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/magic-wormhole.rb
    ==> /usr/local/Cellar/magic-wormhole/0.10.0/bin/wormhole receive 329017-homebrew-test
    Warning: errors may occur unless both sides are running the same version
    Server claims 0.9.2 is current, but ours is 0.10.0
    Sending text message (3 Bytes)
    On the other computer, please run: wormhole receive
    Wormhole code is: 329017-homebrew-test
    
    Warning: errors may occur unless both sides are running the same version
    Server claims 0.9.2 is current, but ours is 0.10.0
    text message sent
    iMac-TMP:homebrew-core joe$
    
    opened by ilovezfs 11
  • A Maze of Twisted Wormholes, None Alike

    A Maze of Twisted Wormholes, None Alike

    Issue:

    Lots of broken wormholes: mine, Rob's, now Dave's.

    Symptom:

    wormhole send and wormohole receive return an error.

    $ wormhole send
    Traceback (most recent call last):
      File "/usr/bin/wormhole", line 11, in <module>
        sys.exit(wormhole())
      File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "/usr/lib/python2.7/site-packages/click/decorators.py", line 27, in new_func
        return f(get_current_context().obj, *args, **kwargs)
      File "/usr/lib/python2.7/site-packages/wormhole/cli/cli.py", line 182, in send
        from . import cmd_send
      File "/usr/lib/python2.7/site-packages/wormhole/cli/cmd_send.py", line 7, in <module>
        from twisted.internet import reactor
      File "/usr/lib64/python2.7/site-packages/twisted/internet/reactor.py", line 38, in <module>
        from twisted.internet import default
      File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
        install = _getInstallFunction(platform)
      File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 44, in _getInstallFunction
        from twisted.internet.epollreactor import install
      File "/usr/lib64/python2.7/site-packages/twisted/internet/epollreactor.py", line 24, in <module>
        from twisted.internet import posixbase
      File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in <module>
        from twisted.internet import error, udp, tcp
      File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 28, in <module>
        from twisted.internet._newtls import (
      File "/usr/lib64/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>
        from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
      File "/usr/lib64/python2.7/site-packages/twisted/protocols/tls.py", line 63, in <module>
        from twisted.internet._sslverify import _setAcceptableProtocols
      File "/usr/lib64/python2.7/site-packages/twisted/internet/_sslverify.py", line 38, in <module>
        TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
    AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
    

    Fix:

    http://stackoverflow.com/questions/42225773/install-scrapy-on-mac-successful-but-run-error

    pip install Twisted==16.4.1

    $ sudo pip install Twisted==16.4.1
    Collecting Twisted==16.4.1
      Downloading Twisted-16.4.1.tar.bz2 (3.0MB)
        100% |████████████████████████████████| 3.0MB 406kB/s 
    Requirement already satisfied: zope.interface>=3.6.0 in /usr/lib64/python2.7/site-packages (from Twisted==16.4.1)
    Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from zope.interface>=3.6.0->Twisted==16.4.1)
    Requirement already satisfied: six>=1.6.0 in /usr/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->Twisted==16.4.1)
    Requirement already satisfied: appdirs>=1.4.0 in /usr/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->Twisted==16.4.1)
    Requirement already satisfied: packaging>=16.8 in /usr/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->Twisted==16.4.1)
    Requirement already satisfied: pyparsing in /usr/lib/python2.7/site-packages (from packaging>=16.8->setuptools->zope.interface>=3.6.0->Twisted==16.4.1)
    Installing collected packages: Twisted
      Found existing installation: Twisted 17.1.0
        Uninstalling Twisted-17.1.0:
          Successfully uninstalled Twisted-17.1.0
      Running setup.py install for Twisted ... done
    Successfully installed Twisted-16.4.1
    [dlwillson@intecrowd-vboxws ~]$ wormhole send
    Text to send:
    

    Notes:

    Even though that fixed a box, I remain confused about the actual problem, because another box has Twisted (17.1.0) and it works fine. (i.e. no downgrade needed)

    opened by davidlwillson 11
  • ERROR permission denied on recieve. cant find downloaded zip

    ERROR permission denied on recieve. cant find downloaded zip

    I forgot to change the access rights to the folder I specified with wormhole and got hit with an access denied error after the zip was transferred. Where is the downloaded zip located? searched in /var/tmp but nothing

    opened by mashakos 1
  • Tab completion for nameplates gives error

    Tab completion for nameplates gives error

    I tried out the tab completion of nameplates for fun and ran into an error.

    1. wormhole receive
    2. Type a digit then tab, try a few times until it completes
    3. Erase the completed bit, type a digit and press tab again
    Enter receive wormhole code: 4completer exception: nameplate (1-) already entered, cannot go back
    Traceback (most recent call last):
      File "/nix/store/vshzbil4ps6rybwljfi3swwg2w2x0ihi-python3.10-magic-wormhole-0.12.0/lib/python3.10/site-packages/wormhole/_rlcompleter.py", line 45, in completer
        return self._wrapped_completer(text, state)
      File "/nix/store/vshzbil4ps6rybwljfi3swwg2w2x0ihi-python3.10-magic-wormhole-0.12.0/lib/python3.10/site-packages/wormhole/_rlcompleter.py", line 59, in _wrapped_completer
        self._matches = self._commit_and_build_completions(text)
      File "/nix/store/vshzbil4ps6rybwljfi3swwg2w2x0ihi-python3.10-magic-wormhole-0.12.0/lib/python3.10/site-packages/wormhole/_rlcompleter.py", line 94, in _commit_and_build_completions
        raise AlreadyInputNameplateError(
    wormhole.errors.AlreadyInputNameplateError: nameplate (1-) already entered, cannot go back
    

    In general I am increasingly convinced that this entire feature should just be removed, as it involves quite a bit of complexity without really improving the user experience. Think about it, how often have you used it yourself? (Tbf I think it could be made worthwhile having so that users would actually use it, but that would require even more effort)

    opened by piegamesde 4
  • [FR] add option to merge received directories with local directories

    [FR] add option to merge received directories with local directories

    E.g., the remote sends a/ which has two files a/b/1.txt and a/b/2.txt, but we already have the file a/b/d.txt locally. This currently fails because the local directory already exists.

    opened by NightMachinery 6
  • Bug: Config tests failing in Windows 10

    Bug: Config tests failing in Windows 10

    The unit tests in the Config class in wormhole.test.test_args fail in Windows 10 when running all tests (i.e. python -m wormhole.test.run_trial wormhole) but succeed when running only the tests in test_args (as in python -m wormhole.test.run_trial wormhole.test.test_args).

    Failing output:

    ...
        test_write_when_closing ...                                            [OK]
    wormhole.test.test_args
      Config
        test_receive ...                                                     [FAIL]
        test_send ...                                                        [FAIL]
      Receive
        test_accept_file ...                                                   [OK]
        test_appid ...                                                         [OK]
    ...
    [lots of tests]
    ...
    ===============================================================================
    [FAIL]
    Traceback (most recent call last):
      File "c:\users\user\repo\magic-wormhole\src\wormhole\test\test_args.py", line 202, in test_receive
        self.assertEqual(cfg.stdout, sys.stdout)
      File "C:\Users\user\repo\magic-wormhole\.tox\py38\lib\site-packages\twisted\trial\_synctest.py", line 424, in assertEqual
        super().assertEqual(first, second, msg)
      File "C:\Python38\lib\unittest\case.py", line 912, in assertEqual
        assertion_func(first, second, msg=msg)
      File "C:\Python38\lib\unittest\case.py", line 905, in _baseAssertEqual
        raise self.failureException(msg)
    twisted.trial.unittest.FailTest: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> != <colorama.ansitowin32.StreamWrapper object at 0x0000020D534E4EB0>
    
    wormhole.test.test_args.Config.test_receive
    ===============================================================================
    [FAIL]
    Traceback (most recent call last):
      File "c:\users\user\repo\magic-wormhole\src\wormhole\test\test_args.py", line 198, in test_send
    
        self.assertEqual(cfg.stdout, sys.stdout)
      File "C:\Users\user\repo\magic-wormhole\.tox\py38\lib\site-packages\twisted\trial\_synctest.py", line 424, in assertEqual
        super().assertEqual(first, second, msg)
      File "C:\Python38\lib\unittest\case.py", line 912, in assertEqual
        assertion_func(first, second, msg=msg)
      File "C:\Python38\lib\unittest\case.py", line 905, in _baseAssertEqual
        raise self.failureException(msg)
    twisted.trial.unittest.FailTest: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> != <colorama.ansitowin32.StreamWrapper object at 0x0000020D534E4EB0>
    
    wormhole.test.test_args.Config.test_send
    -------------------------------------------------------------------------------
    Ran 449 tests in 62.482s
    
    FAILED (skips=1, expectedFailures=1, failures=2, successes=445)
    ERROR: InvocationError for command 'C:\Users\user\repo\magic-wormhole\.tox\py38\Scripts\python.EXE' -m wormhole.test.run_trial wormhole (exited with code 1)
    ____________________________________________ summary _____________________________________________ ERROR:   py38: commands failed
    

    This bizarre problem appears to be caused by colorama being loaded in some different set of tests and colorama.init() executed, changing the value of sys.stdout from the default <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> to a colorama.ansitowin32.StreamWrapper, a state that persists as long as the interpreter is running. Presumably, colorama is being loaded by click which has it among its dependencies.

    I'd be happy to address this myself, but I'm not sure what the actual desired behaviour of these tests are. Perhaps the point is to check that the click app writes output to the calling shell's stdout? Are we happy to just check the filenos are the same?

    opened by awmacpherson 1
  • Can't use

    Can't use "wormhole receive" to generate a code

    It looks like the intent of the CLI is that wormhole receive --code-words 2 would allocate a 2-length code and await a sender on that mailbox.

    However, it doesn't do that: it still prompts for a code. This means there's no way to use the software in the mode where the receiver generates the code and then communicates that to the sender (where they'd use wormhole send --code <whatever>).

    opened by meejah 0
Owner
null
Command line tool to automate transforming the effects of one color profile to another, possibly more standard one.

Finished rendering the frames of that animation, and now the colors look washed out and ugly? This terminal program will solve exactly that.

Eric Xue 1 Jan 26, 2022
Ahmed Hossam 12 Oct 17, 2022
Safely add untrusted strings to HTML/XML markup.

MarkupSafe MarkupSafe implements a text object that escapes characters so it is safe to use in HTML and XML. Characters that have special meanings are

The Pallets Projects 514 Dec 31, 2022
Safely pass trusted data to untrusted environments and back.

ItsDangerous ... so better sign this Various helpers to pass data to untrusted environments and to get it back safe and sound. Data is cryptographical

The Pallets Projects 2.6k Jan 1, 2023
keyring MITkeyring (🥉27 · ⭐ 630) - Store and access your passwords safely. MIT

The Python keyring library provides an easy way to access the system keyring service from python. It can be used in any application that needs safe pa

Jason R. Coombs 948 Dec 18, 2022
Kyrie Eleison - The best and unique way to encrypt some data or a file safely

Encrypt your important data and files easily and safely with Kyrie Eleison.

Billy 39 Oct 27, 2022
Change your Windows background with this program safely & easily!

Background_Changer Table of Contents: About the Program Features Requirements Preview Credits Reach Me See Also About the Program: You can change your

Sina.f 0 Jul 14, 2022
This is a repository to learn and get more computer vision skills, make robotics projects integrating the computer vision as a perception tool and create a lot of awesome advanced controllers for the robots of the future.

This is a repository to learn and get more computer vision skills, make robotics projects integrating the computer vision as a perception tool and create a lot of awesome advanced controllers for the robots of the future.

Elkin Javier Guerra Galeano 17 Nov 3, 2022
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021
People log into different sites every day to get information and browse through these sites one by one

HyperLink People log into different sites every day to get information and browse through these sites one by one. And they are exposed to advertisemen

null 0 Feb 17, 2022
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

Joakim Sørensen 39 Dec 31, 2022
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

JOBIN 0 Dec 1, 2021
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

URL Uploader Bot An Open Source ALL-In-One Telegram RoBot, that can do lot of things. My Features Installation The Easy Way You can also tap the Deplo

NT BOTS 1 Oct 23, 2021
Yet another Django audit log app, hopefully the simplest one.

django-easy-audit Yet another Django audit log app, hopefully the easiest one. This app allows you to keep track of every action taken by your users.

Natán 510 Jan 2, 2023
Telegram bot to auto post messages of one channel in another channel as soon as it is posted, without the forwarded tag.

Channel Auto-Post Bot This bot can send all new messages from one channel, directly to another channel (or group, just in case), without the forwarded

Aditya 128 Dec 29, 2022
A Script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag.

Channel Auto Message Forward A script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag

null 16 Oct 21, 2022
A tool for transferring server variable values from one intersect gamedata.db to another

Server Variable Transfer Tool Purpose This tool exists for use with the Intersect Engine (Ascension Game Dev GitHub). Its purpose is to UPDATE one sql

AVild 2 Oct 27, 2021
OpenTOTP is yet another time-based, one-time passwords (OTPs) generator/verifier inspired by RFC 6238.

OpenTOTP is yet another time-based, one-time passwords (OTPs) generator/verifier inspired by RFC 6238. It generates and validates OTPs based

null 1 Nov 15, 2021
Python script to clone SQL dashboard from one workspace to another

Databricks dashboard clone Unofficial project to allow Databricks SQL dashboard copy from one workspace to another. Resource clone Setup: Create a fil

Quentin Ambard 12 Jan 1, 2023
A web-based chat application that enables multiple users to interact with one another

A web-based chat application that enables multiple users to interact with one another, in the same chat room or different ones according to their choosing.

null 3 Apr 22, 2022