HackerTrans
TopNewTrendsCommentsPastAskShowJobs

meejah

no profile record

Submissions

Shell-with-me/shwim: instant E2EE terminal sharing

meejah.ca
2 points·by meejah·11 ay önce·1 comments

comments

meejah
·8 ay önce·discuss
Here are some fairly simple examples: testing port parsing https://github.com/meejah/fowl/blob/e8253467d7072cd05f21de7c...

...and https://github.com/magic-wormhole/magic-wormhole/blob/1b4732...

The simplest ones to get started with are "strings", IMO, and also gives you lots of mileage (because it'll definitely test some weird unicode). So, somewhere in your API where you take some user-entered strings -- even something "open ended" like "a name" -- you can make use of Hypothesis to try a few things. This has definitely uncovered unicode bugs for me.

Some more complex things can be made with some custom strategies. The most-Hypothesis-heavy tests I've personally worked with are from Magic Folder strategies: https://github.com/tahoe-lafs/magic-folder/blob/main/src/mag...

The only real downside is that a Hypothesis-heavy test-suite like the above can take a while to run (but you can instruct it to only produce one example per test). Obviously, one example per test won't catch everything, but is way faster when developing and Hypothesis remembers "bad" examples so if you occasionally do a longer run it'll remember things that caused errors before.
meejah
·9 ay önce·discuss
I am not a cryptographer, but can explain that Magic Wormhole uses SPAKE2 to negotiate a shared secret (RFC9382 claims equivalent to gap Diffie-Hellman), and then uses NaCl SecretBox to symmetrically encrypt all data between the peers.

(If using the newer Dilation protocol -- which is true for many of the non-file-transfer tools like ShWiM, Git-WithMe or Fowl -- peer traffic uses this shared secret with Noise, specifically "Noise_NNpsk0_25519_ChaChaPoly_BLAKE2s")

One tool that does now use Magic Wormhole for "introduction" like this is EtherSync: https://ethersync.github.io/ethersync/
meejah
·9 ay önce·discuss
Correct.

It does learn some metadata: the endpoints of the messages (unless you use Tor) and the number of bytes in those messages.
meejah
·9 ay önce·discuss
...and also "Git-WithMe" for peer-to-peer, one-off Git usage: https://sr.ht/~meejah/git-withme/
meejah
·9 ay önce·discuss
Note, too, that you may run your own "transit helper" (code: https://github.com/magic-wormhole/magic-wormhole-transit-rel... ) and then specify this via "wormhole --transit-helper tcp:<your host>:<port>" when doing a transfer.

You do need to run the helper on a public IP address, like a rented VPS for example.
meejah
·9 ay önce·discuss
You should probably first test and ensure that you're sending "directly" instead of via the relay -- but if that's true then yes.
meejah
·9 ay önce·discuss
One use-case could be for SyncThing to actually _use_ magic-wormhole as a way to introduce / join another endpoint to a SyncThing folder.
meejah
·9 ay önce·discuss
There are Rust and Haskell implementations too (not quite as feature-full as the Python code yet, though) as well.

In principal WebRTC communication could be added to magic-wormhole, but that work has not been done yet. There is WebSocket support in the relay (including "cross-protocol" so one client can be WebSocket and the other TCP). This is only deployed on the Winden.app servers (tcp://relay.mw.leastauthority.com:4001 and wss://relay.mw.leastauthority.com for the relay).

You'd need to use the Winden.app relay server if you want https://winden.app users to reach your Python CLI (e.g. via "wormhole --relay-url wss://mailbox.mw.leastauthority.com/v1 send" for example)
meejah
·9 ay önce·discuss
You might even use Magic Wormhole to securely transfer WireGuard keys!
meejah
·9 ay önce·discuss
There are several different clients available for Magic Wormhole, including GUIs and phone apps: https://magic-wormhole.readthedocs.io/en/latest/ecosystem.ht...
meejah
·9 ay önce·discuss
If two Magic Wormhole clients _are_ on the same LAN they should communicate directly that way (i.e. no relay required).
meejah
·9 ay önce·discuss
Yes, there are several alternative clients including several for Android: https://magic-wormhole.readthedocs.io/en/latest/ecosystem.ht...
meejah
·11 ay önce·discuss
Building on top of various Magic Wormhole features, "shwim" enables quick and easy 1:1 terminal sharing with durable, end-to-end-encrypted communications using tty-share.
meejah
·2 yıl önce·discuss
Yes, all the implementations speak the same wire protocol.

The Python implementation has the most features. More about which implementations support what features is here: https://magic-wormhole.readthedocs.io/en/latest/ecosystem.ht...
meejah
·2 yıl önce·discuss
The Haskell implementation uses the same protocol as the Python implementation. The main difference is that there are some features the Python implementation has that the Haskell implementation still lacks (most notable "Dilation").

See also https://github.com/magic-wormhole/magic-wormhole-protocols/
meejah
·2 yıl önce·discuss
That is just using normal STUN/TURN via another server that one of those developers is running
meejah
·2 yıl önce·discuss
Yes, it does -- via the Rust implementation.
meejah
·2 yıl önce·discuss
There's also a Haskell implementation (besides the Go one pointed out above). They all interoperate.
meejah
·2 yıl önce·discuss
There is also https://magic-wormhole.readthedocs.io/en/latest/ecosystem.ht... and if that is lacking anything please file a ticket or pull-request
meejah
·2 yıl önce·discuss
Yes.

A technique like this is used to do "invites" in Magic Folder, and also in Tahoe-LAFS. That is, they speak a custom protocol over just the Mailbox server in order to do some secrets-exchanging. They never set up a "bulk transport" link.

There is also a Haskell implementation, if that's of interest.

I love to learn about "non-file-transfer" use-cases for Magic Wormhole, so please connect via GitHub (or https://meejah.ca/contact)