rugk / offline-qr-code

📱 Browser add-on allowing you to quickly generate a QR code offline with the URL of the open tab or other text!
https://addons.mozilla.org/firefox/addon/offline-qr-code-generator/?utm_source=github.com&utm_medium=github&utm_content=github-url-description&campaign=github-url-description
Other
424 stars 129 forks source link

Encrypted exchange by QR-code channel #315

Closed oneofthehorses closed 11 months ago

oneofthehorses commented 11 months ago

Hi!

It would be awesome feature to create something like "encrypted channel where devices first say hello to each other (wich means exchange of public keys) and then you can send\recive information by secure channel throught QR-code's

Thanks for your works!!!

rugk commented 11 months ago

Well… if we ask for security we first would have to ask for a threat model… What's yours?

I propose one here…

treat model

Anyone intercepting/MITM the connection? I guess? The situation could be scanning a password from your desktop with your phone.

Threats are many:

We focus on the interception part.

current solution

IMHO the current solution is already quite robust, as “intercepting” currently would require:

All in all, practically, I only see should surfing as a practical attack. While photos may be possible to expand the time for an attack, it's likely also easy enough to scan the QR code instantly instead.

Note if you are being shoulder-surfed, possibly much more data is already compromised, as you are likely being watched for longer and people may see entering your password etc.

Proposed solution

Some asymmetric(?) encryption.

However:

Effects

Thus, this could indeed be effective.

Implementation effort

Here comes the catch: Huuuge. Especially to do properly. E.g. one big challenge is a diffie hellman exchange would require your phone communicating back to your laptop. Bidirectional communication is, however, not really a feature of QR codes. :wink: (Also said DH key exchange has big key lengths, but this could be solved by using elliptic curves aka ECDH instead.)

However, the worst thing may be a practical one: Both clients need to support it. If this add-on supports it, that is not enough. The app (in our example) also needs to do so.

Summary

All in all, this is less benefit with much work. And without a proper way to do it (cryptography always goes wrong and without being a cryptographer you ought not even to try to implement low-level stuff.), it will likely fail. Thus, I don't see that as a feature soon or in the near future.

Alternatives

oneofthehorses commented 11 months ago

The main idea behind this in sense of benefits is work with airgapped OS's and Live USB like Tails OS in case of passwords or any sensetive info compromised.

This is kinda same realisation but in bit different angle (can check from 2:53) https://yewtu.be/watch?v=LfNoeu9s93Y

rugk commented 11 months ago

@oneofthehorses okay, hmm so some software called "QR bridge" implements something like this and the video author says it costs $19 on some (Apple app?) store? Thus it is likely proprietary and I would not trust it with any sensitive data ion the first place.

I also found no good results for it. And the link in the description goes to https://sunknudsen.com/store/qr-bridge, which is a 404 page… so, well…

oneofthehorses commented 11 months ago

Yes, that's why i also don't trust him and any proprietary implimentation of if, so i taking time to find foss alternative

But yet, without success

rugk commented 11 months ago

Well… okay, but there is also no reference for implementation then unfortunately.

Also, as said, depending on your exact threat model, you are very likely fine with using the extension here as is to share short passwords in a safe environment e.g. As long as you make sure no shoulder surfing happens, just go ahead.