Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encryption #104

Open
DrYak opened this issue Apr 13, 2024 · 17 comments
Open

Encryption #104

DrYak opened this issue Apr 13, 2024 · 17 comments

Comments

@DrYak
Copy link

DrYak commented Apr 13, 2024

Hi, I switched to this tool as Plasma switched to Wayland and love it.

A few suggestions regarding encryption.

inside lan-mouse

I've noticed that WebRTC-rs have a working implementation of DTLS which would be the cannonical way for input-leap to encrypt UDP streams.

Have you had a look at it? (I am saddly too much of a rust newbie to be of any use making a PR, and even more so with delicate subjects like encryption)

workarounds outside lan-mouse

Until there's proper encryption inside lan-mouse, a few idea for users to hack their own workarounds:

  • I've noticed dtlspipe which is basically like stunnel but for UDP over DTLS instead of TCP.
  • There is also the classic approach of using netcat to forward UDP to TCP connection and use SSH forwarding to establish a secure connection. This sacrifice the "spontaneous connect/disconnect" that lan-mouse's UDP offers, but I think SSH tunnels and the port not even open on the laptops' firewalls is about the most secure solution (unless one has the wrong version of XZ 😁 )
@feschber
Copy link
Owner

WebRTC dtls is in fact exactly what I was planning to use for this.
I will need to rewrite some of the network code in order to use it but I will hopefully get to it in the coming weeks.

@feschber feschber pinned this issue Apr 13, 2024
@feschber feschber changed the title Suggestion: Encryption Encryption Apr 13, 2024
@DrYak
Copy link
Author

DrYak commented Apr 14, 2024

but I will hopefully get to it in the coming weeks.

That would be extremely cool! I think encryption (or any user-made hack for security) is the last major blocker before more people can start using this as a Synergy replacement (or depending on interests, until Input Leap and/or Waynergy get the bits they need upstreamed into Kwin, portals, etc.)

BTW: I tried packaging your software for my openSuse Tumbleweed. The x86_64 package builds successfully (The i586 variant fails on libadwaita). So I'll be able to easily install accross my machines.

@feschber
Copy link
Owner

feschber commented Apr 15, 2024

BTW: I tried packaging your software for my openSuse Tumbleweed. The x86_64 package builds successfully (The i586 variant fails on libadwaita). So I'll be able to easily install accross my machines.

I'm not very familiar with OpenSuse but feel free to update the installation instructions if you want that to be included. (you can make a PR).

If Libadwaita does not want to build on i586, you could deactivate the feature for building (cli should still be usable):

cargo build --no-default-features --features wayland,x11,xdg_desktop_portal,libei

Let me know, if that works. I just realized that the gio build dependency is not behind the gtk feature flag.

@DrYak
Copy link
Author

DrYak commented Apr 15, 2024

I've tried disabling the GTK Gui, but now the compilation crashes at another point.
Apparently it's going to be complicated to get it working on a non-Tier1 arch.

Well at least the x86_64 works for now.

Looking forward to the upcoming encryption feature.

@DrYak
Copy link
Author

DrYak commented May 24, 2024

Do you think you would have time to look into WebRTC-rs DTLS soon~ish?
That's about the last missing critical feature before lan-mouse is "Good Enough™!" for me.

@feschber
Copy link
Owner

I can not realistically give an accurate estimate. But I will try my best to finish it in the coming month.

@d4nshields
Copy link

Adding security is a fantastic idea. Whether through the WebRTC stack or through some other library, DTLS would indeed be a great solution for securing UDP-based connections while maintaining the performance benefits crucial for our use case.

I've reviewed the network handler module in the source code, and I believe there's a well-defined structure that could facilitate the integration of DTLS. To further enhance this, I was thinking of adding DTLS as an optional feature through a command-line switch, giving users flexibility based on their security needs and performance considerations.

As a current user of the open-source/free fork of Synergy, I am enthusiastic about the potential robustness this solution can bring. Adding security is an absolute must-have for me. I'd love to offer my assistance with this implementation. Whether it's rewriting parts of the network code, testing the new features, or contributing to documentation, I'm eager to contribute and support this initiative in any way I can.

@DrYak
Copy link
Author

DrYak commented Jul 31, 2024

@feschber: Any idea when you'll attack work on that feature?

@feschber
Copy link
Owner

I have a deadline at University coming up tomorrow, will hopefully have more time on hand after that.
Will probably also tackle #164 at the same time and make the whole thing a client server model.

@feschber
Copy link
Owner

feschber commented Sep 4, 2024

to give an update:

I've got things working with selfsigned keys! 🎉

There are some things I still need to figure out though:

  • connection probing
  • automatic ip switching
  • replying to the correct connection (currently events simply sent to the server hosted on the other device)

Regardless: This text was typed over a secure lan-mouse connection 😃

@jonstelly
Copy link
Sponsor

Nice work! I've been looking forward to switching over to lan-mouse but was waiting for encryption. I'm guessing it's the encryption branch? - main...encryption

I'm eager to start testing this, will start playing around with the arch aur package to get it built with new dependencies

@feschber
Copy link
Owner

feschber commented Sep 10, 2024

I'm guessing it's the encryption branch? - main...encryption

Yes, thats correct. It's not quit ready yet, I rewrote quite a few things to fit into the client-server model so be prepared to get your cursor stuck ;). But the basic functionality is working so far.

@jonstelly
Copy link
Sponsor

Got it built and running. I did get the cursor stuck at first, created config files on both machines and now it's up and running. wireshark showed encrypted traffic.

The aur package ( https://aur.archlinux.org/packages/lan-mouse-git ) didn't build correctly but I built directly from git clone and that worked. I'll work on the AUR package to see if I can figure out what's going on (not a rust guy but this is a good excuse to learn a bit)

@feschber
Copy link
Owner

@jonstelly the package does not build currently because I moved the svg.
I will fix that.

@feschber
Copy link
Owner

should be fixed now

This was referenced Sep 10, 2024
@DrYak
Copy link
Author

DrYak commented Sep 17, 2024

That's super cool developments! Thanks for your work!

BTW:
I was wondering, have you given though to emoji verification (like Riot does) as a way to establish a verified encrypted link?

@feschber
Copy link
Owner

Yeah I want to have some sort of 'trust on first use' model, maybe similar to ssh or via emoji verification. However I'm not 100% sure how to do it yet.

Right now I'm side-stepping the authenticity problem a bit to get the rest working first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants