For the hackweek I worked on the bridge QR codes support for Tails.
We have noticed that at the moment multiple bridges (which is the case both of the web request and of the email) are encoded as Python lists.
It is almost a JSON format, but it uses single quotes/apostrophes (') instead of double quotes (").
So, parsing the strings is feasible, but not immediate, and I wonder if PT params may include quotes in the future (it would break this workaround).
From the code, I understood that the original intention was having strings separated by \n.
This is also compatible with what Tor Browser output (only one bridge line, without any wrapping).
Sorry for not checking before.
We have still some time to do a last-minute change before Tor Browser 11.5 goes stable.
The Tails's POC implementation can handle both the formats.
I don't know if there are other QR code consumers and/or producers, at the moment.
As discussed in IRC, we thought about using the bridge:// URI in the future, too.
Also, I think that PNG would be better as a format, because JPEG doesn't handle sharp edges in a very good way.
And we could make them larger, because they are very dense.
Designs
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Conversation we had at the Limerick meeting about bridge URIs:
We want more than one bridge line in a URI, to avoid having users to scan/copy-paste multiple QR codes/bridge links.
Links to websites instead of custom scheme URIs are nice, but could actually expose our users and make them stand out to the censor / ISPs, so we rather don't want to send unsuspecting users without the right app installed to a Tor-related website.
Suggestion for bridge URIs containing multiple lines using URL-encoded bridge lines:
We've discussed the multiple bridges per QRCode a lot over the years, I'm still convinced it is not workable. It is just too fussy. I think most of most of the time, it'll literally take longer to scan that single giant QR Code than it would to scan three or four small ones. Giant QR Codes are fussy even when using custom optimized equipment run by trailed professionals. For example, I've been using QRCode-based e-tickets on rail journeys throughout Europe for years now. The scanning is often error prone, sometimes taking quite a while.
QRCode has forms of compression, if you want to try that. Seen the "alphanumeric" encoding: https://en.wikipedia.org/wiki/QR_code It means basically only using all uppercase and few punctuation chars.
I think I might have contributed to the noise here. Let me try to clarify!
At the Tor meeting, I asked meskio how could we move things forward so that we have a new, standard, format in place and we at Tails can actually consume it, to help users connect to Tor: https://gitlab.tails.boum.org/tails/tails/-/issues/18219
He clarified that doing all the work needed (ie: changing BridgeDB) might require quite some time, so I could not expect this to happen soon
I proposed, therefore, to "quickly" agree on the URI format, so that we could write code to support it
Defining a URI format which could only support one bridge seemed worthy of much longer discussions; having the format supporting any number of bridges, and then leaving the decision of how to use this format to QR code producers (ie: BridgeDB, TorBrowser) seemed to us the simplest way of reaching consensus over the URI format.
So, to me, the fact that the URI proposal supports multiple bridges is not a sign that it will be used to create huge QR codes. I actually hope that single-bridge QR code will be the norm!
It would be nice to have a URL format that supports N bridges. But I can't
think of a why to do that without sacrificing having semantic URLs. I guess
there could be one format that lets one bridge be sematically mapped to URLs,
but then have some kind of flag, like a standard path or query string, that
flags it as containing multiple bridges. Then all the data would be in the
fragment.
In relation to DNS leaks, I don't think there can be one single format. Some
use cases should never leak DNS (bridge://) and other use cases require the
link be clickable in standard apps (https://bridge.torproject.org). I think
we need to define:
how bridges map to URL semantics (host, path, query, fragment)
a standard scheme, e.g. bridge: with blob or bridge:// with path, etc.
a standard domain name, e.g. https://bridge.torproject.org
maybe potentially a fake domain name for clickable links without DNS leaks
recommendations for where each should be used
This can be done incrementally and gives us the option to change our minds in
the future. The first step is pretty close to done.
I recognize that once you support multiple bridges in a QR code, nothing prevents you from creating a QR code for a single bridge anyway.
I think we could do so in Tor Browser, since we had bridge cards and we show QRs also for default bridges (which are far too many to be shown in a single QR, and possibly even to generate one, and in general we have small QR codes).
Also, I don't like the URI with an almost plain bridge string.
I feel it's very non semantic.
However, this seems not relevant if use HTTPS links with an existing domain, which might be preferrable for a few reasons:
apps can register also for domains, in some platforms like Android
Tor-enabled apps will be able create a bridge line from this link, without even making the HTTP request, and must do so, if we decide to use HTTPS links
we don't want them to send data to the censor
we don't want the censor to be able to block this mechanism
the custom scheme can be registered at OS level, but apps such as instant messaging apps won't support it
if we use a real domain, we can show a page with a few additional info:
the decoded bridge line (possibly in giant font), with a nice copy button
what's Tor, how you can download Tor-enabled software and how you can add bridges (e.g., Tor Browser, Tails, Onionshare, with the relative screenshots)
try also to redirect to the custom bridge scheme to automatically open the relative app (like what t.me does)
apps can register also for domains, in some platforms like Android
I think that the opposite is true in Linux desktop. Your redirect trick will still make it work, at the cost of a DNS query which will reveal they want to use a Tor bridge.
the custom scheme can be registered at OS level, but apps such as instant messaging apps won't support it
do you mean that if a user receives a tg://share?url=www.example.com?t=12&text=test link over Signal, they cannot successfully click on it?
This would be so surprising to me! But I'm definitely ignorant about Android.
I think that the opposite is true in Linux desktop. Your redirect trick will still make it work, at the cost of a DNS query which will reveal they want to use a Tor bridge.
True. But aren't all links opened in Tor Browser, in Tails?
I think we can't expect all users to open the bridge URL in Tor Browser, on desktop .
do you mean that if a user receives a tg://share?url=www.example.com?t=12&text=test link over Signal, they cannot successfully click on it? This would be so surprising to me! But I'm definitely ignorant about Android.
True. But aren't all links opened in Tor Browser, in Tails?
In Tails, yes, but it's actually irrelevant: if you can open the https link, it means you're already connected to Tor, so why do you want to fiddle with bridges?
Elsewhere, where opening the URI is actually relevant, no. Oh, and a censor now just need to block that domain in order to "block" bridges (not really of course, but if we expect that this URI is used, than there will be user effectively blocked by this very simple censorship).
do you mean that if a user receives a tg://share?url=www.example.com?t=12&text=test link over Signal, they cannot successfully click on it? This would be so surprising to me! But I'm definitely ignorant about Android.
It depends on the regexp used to detect link.
oh, I thought this was much more standard system-wide.
I can just tell you that I sent exactly that link over Conversations (not Signal) and it works.
I can't generalize that this approach always works from this one very simple try.
Fun idea of the day: Encode bridges or bridge URIs as "Ecoji" plain text as emoji to make copy and paste and sharing in social mechanism more fun, slight safer, and slightly more resilient to censorship