Photo cross-post

Jun. 7th, 2025 12:29 pm
andrewducker: (Default)
[personal profile] andrewducker


My brother Mike got me this for my birthday, and it just takes a weight off my mind being able to say "bring the steam temperature up to 95 degrees and hold it there"

(Control over oil temperature when frying eggs is also awesome.)
Original is here on Pixelfed.scot.

The Sickening Has Me

Jun. 6th, 2025 08:20 pm
andrewducker: (xkcd boomdeyada)
[personal profile] andrewducker
I spent the day feeling bad for lacking focus, and wondering why I couldn't get anything done.
And then I slept for an hour on no notice.
And now I'm very wobbly and all of my muscles gently ache.
So I think I'm going to chalk it up as "The Plague" and hope I feel better tomorrow.
andrewducker: (Default)
[personal profile] andrewducker
I see we're back at the "Labour attempt to introduce a mandatory ID card" stage of history*.

My feeling last time, was that the main problem that they always have is that they *start* with the cards being mandatory.

If you start with "Here is a thing that makes your life much easier, that you can carry about if you like." then that will get you 85% of the way there. And then, once you have a voluntary ID card that's not causing any problems for anyone, and that 85% of the population is using to make their life easier, *then* you move in and say "The only people who don't carry an ID card are weirdos and troublemakers, and they're causing friction in the system, we could make it all run more smoothly if only they *had* to carry one."

But no, they always try to go instantly from "Nobody has an ID card." to "Everyone must carry one at all times." - which forms a coalition of all sorts of people from across the political spectrum, and ends up being far more politically costly to them than if they'd just boiled their frog slowly.

(None of which should be taken as me taking a position on ID cards. I'm just constantly bemused by their inability to get things done by trying to rush them through in the most authoritarian manner possible.)

*Younger readers may not remember the fuss in 2006 (repealed in 2011)
[personal profile] mjg59
As I wrote in my last post, Twitter's new encrypted DM infrastructure is pretty awful. But the amount of work required to make it somewhat better isn't large.

When Juicebox is used with HSMs, it supports encrypting the communication between the client and the backend. This is handled by generating a unique keypair for each HSM. The public key is provided to the client, while the private key remains within the HSM. Even if you can see the traffic sent to the HSM, it's encrypted using the Noise protocol and so the user's encrypted secret data can't be retrieved.

But this is only useful if you know that the public key corresponds to a private key in the HSM! Right now there's no way to know this, but there's worse - the client doesn't have the public key built into it, it's supplied as a response to an API request made to Twitter's servers. Even if the current keys are associated with the HSMs, Twitter could swap them out with ones that aren't, terminate the encrypted connection at their endpoint, and then fake your query to the HSM and get the encrypted data that way. Worse, this could be done for specific targeted users, without any indication to the user that this has happened, making it almost impossible to detect in general.

This is at least partially fixable. Twitter could prove to a third party that their Juicebox keys were generated in an HSM, and the key material could be moved into clients. This makes attacking individual users more difficult (the backdoor code would need to be shipped in the public client), but can't easily help with the website version[1] even if a framework exists to analyse the clients and verify that the correct public keys are in use.

It's still worse than Signal. Use Signal.

[1] Since they could still just serve backdoored Javascript to specific users. This is, unfortunately, kind of an inherent problem when it comes to web-based clients - we don't have good frameworks to detect whether the site itself is malicious.
[personal profile] mjg59
(Edit: Twitter could improve this significantly with very few changes - I wrote about that here. It's unclear why they'd launch without doing that, since it entirely defeats the point of using HSMs)

When Twitter[1] launched encrypted DMs a couple
of years ago, it was the worst kind of end-to-end
encrypted - technically e2ee, but in a way that made it relatively easy for Twitter to inject new encryption keys and get everyone's messages anyway. It was also lacking a whole bunch of features such as "sending pictures", so the entire thing was largely a waste of time. But a couple of days ago, Elon announced the arrival of "XChat", a new encrypted message platform built on Rust with (Bitcoin style) encryption, whole new architecture. Maybe this time they've got it right?

tl;dr - no. Use Signal. Twitter can probably obtain your private keys, and admit that they can MITM you and have full access to your metadata.

The new approach is pretty similar to the old one in that it's based on pretty straightforward and well tested cryptographic primitives, but merely using good cryptography doesn't mean you end up with a good solution. This time they've pivoted away from using the underlying cryptographic primitives directly and into higher level abstractions, which is probably a good thing. They're using Libsodium's boxes for message encryption, which is, well, fine? It doesn't offer forward secrecy (if someone's private key is leaked then all existing messages can be decrypted) so it's a long way from the state of the art for a messaging client (Signal's had forward secrecy for over a decade!), but it's not inherently broken or anything. It is, however, written in C, not Rust[2].

That's about the extent of the good news. Twitter's old implementation involved clients generating keypairs and pushing the public key to Twitter. Each client (a physical device or a browser instance) had its own private key, and messages were simply encrypted to every public key associated with an account. This meant that new devices couldn't decrypt old messages, and also meant there was a maximum number of supported devices and terrible scaling issues and it was pretty bad. The new approach generates a keypair and then stores the private key using the Juicebox protocol. Other devices can then retrieve the private key.

Doesn't this mean Twitter has the private key? Well, no. There's a PIN involved, and the PIN is used to generate an encryption key. The stored copy of the private key is encrypted with that key, so if you don't know the PIN you can't decrypt the key. So we brute force the PIN, right? Juicebox actually protects against that - before the backend will hand over the encrypted key, you have to prove knowledge of the PIN to it (this is done in a clever way that doesn't directly reveal the PIN to the backend). If you ask for the key too many times while providing the wrong PIN, access is locked down.

But this is true only if the Juicebox backend is trustworthy. If the backend is controlled by someone untrustworthy[3] then they're going to be able to obtain the encrypted key material (even if it's in an HSM, they can simply watch what comes out of the HSM when the user authenticates if there's no validation of the HSM's keys). And now all they need is the PIN. Turning the PIN into an encryption key is done using the Argon2id key derivation function, using 32 iterations and a memory cost of 16MB (the Juicebox white paper says 16KB, but (a) that's laughably small and (b) the code says 16 * 1024 in an argument that takes kilobytes), which makes it computationally and moderately memory expensive to generate the encryption key used to decrypt the private key. How expensive? Well, on my (not very fast) laptop, that takes less than 0.2 seconds. How many attempts to I need to crack the PIN? Twitter's chosen to fix that to 4 digits, so a maximum of 10,000. You aren't going to need many machines running in parallel to bring this down to a very small amount of time, at which point private keys can, to a first approximation, be extracted at will.

Juicebox attempts to defend against this by supporting sharding your key over multiple backends, and only requiring a subset of those to recover the original. I can't find any evidence that Twitter's does seem to be making use of this,Twitter uses three backends and requires data from at least two, but all the backends used are under x.com so are presumably under Twitter's direct control. Trusting the keystore without needing to trust whoever's hosting it requires a trustworthy communications mechanism between the client and the keystore. If the device you're talking to can prove that it's an HSM that implements the attempt limiting protocol and has no other mechanism to export the data, this can be made to work. Signal makes use of something along these lines using Intel SGX for contact list and settings storage and recovery, and Google and Apple also have documentation about how they handle this in ways that make it difficult for them to obtain backed up key material. Twitter has no documentation of this, and as far as I can tell does nothing to prove that the backend is in any way trustworthy. (Edit to add: The Juicebox API does support authenticated communication between the client and the HSM, but that relies on you having some way to prove that the public key you're presented with corresponds to a private key that only exists in the HSM. Twitter gives you the public key whenever you communicate with them, so even if they've implemented this properly you can't prove they haven't made up a new key and MITMed you the next time you retrieve your key)

On the plus side, Juicebox is written in Rust, so Elon's not 100% wrong. Just mostly wrong.

But ok, at least you've got viable end-to-end encryption even if someone can put in some (not all that much, really) effort to obtain your private key and render it all pointless? Actually no, since you're still relying on the Twitter server to give you the public key of the other party and there's no out of band mechanism to do that or verify the authenticity of that public key at present. Twitter can simply give you a public key where they control the private key, decrypt the message, and then reencrypt it with the intended recipient's key and pass it on. The support page makes it clear that this is a known shortcoming and that it'll be fixed at some point, but they said that about the original encrypted DM support and it never was, so that's probably dependent on whether Elon gets distracted by something else again. And the server knows who and when you're messaging even if they haven't bothered to break your private key, so there's a lot of metadata leakage.

Signal doesn't have these shortcomings. Use Signal.

[1] I'll respect their name change once Elon respects his daughter

[2] There are implementations written in Rust, but Twitter's using the C one with these JNI bindings

[3] Or someone nominally trustworthy but who's been compelled to act against your interests - even if Elon were absolutely committed to protecting all his users, his overarching goals for Twitter require him to have legal presence in multiple jurisdictions that are not necessarily above placing employees in physical danger if there's a perception that they could obtain someone's encryption keys

Photo cross-post

Jun. 3rd, 2025 12:08 pm
andrewducker: (Default)
[personal profile] andrewducker


Terribly comfy under these trees.
Original is here on Pixelfed.scot.

andrewducker: (multimedia errors)
[personal profile] andrewducker
British Voters are happy that UK net migration is down. But they still think it's too high. Sadly, there is no information about how much immigration voters would like, but I suspect that they think that zero is good. And probably that negative is better.

And a fair chunk of this is because Labour and the Conservatives are both backing the idea that immigration is a bad thing. Lib Dems are in favour of being more humane about it than either of them, but only the SNP seem to have a policy that recognises that if immigration doesn't go up the economy is fucked.

Britain is aging. With serious economic consequences, with insufficient people entering the workforce to make up for the people leaving it, and increasing healthcare costs.

If we want the economy to function then either we will have to have more children or to bring more people in to work here. Those are the two options. And nobody has successfully managed to get a developed society to do the former*. So either we deal with an insupportable economy or we increase immigration. But neither of the big political parties wants to deal with the Daily Mail screaming at them, so we're going to spend the next few years doing the economically** stupid thing.

* Except Israel. Who we are unlikely to emulate.
** Obviously I haven't touched on the moral case here.

Why does Edinburgh Council hate cars?

May. 31st, 2025 07:53 pm
andrewducker: (lady face)
[personal profile] andrewducker
I occasionally see people complaining that Edinburgh Council hate cars. And, to be fair, I suspect that some of the council members do dislike them (The Green Party are not known for being big car fans). But the Green Party don't run the council (it's currently Labour supported by the Tories and Lib Dems - but their policies about cars vs buses are very similar to the SNP administration), so why is it that people think the council as a whole hate cars?

It's because the council has very little choice.

In a very rural area cars make total economic sense and buses make very little. There aren't enough people travelling between any two points at a given time to make it worth running buses that often, so buses either don't exist, or only connect larger areas rarely. And because they don't run that often, you can't just wander out and leap on to one to get where you need to. So you pretty much *have* to have a car.

Once you more urban you have a situation where buses are running regularly on key routes, so if you live on them then you'll be able to rely on a bus to get too/from work/school. And if you're doing that enough that you're paying for a bus pass, or that you're able to get to most of the places you want then a chunk of people don't need cars any more.

And then, as you get even more urban, you reach a key point where there are *lots* of buses. And to manage the concentration of people in the city you run out of space on the roads, at least at key parts of the day. You now have traffic jams at rush hour. And that's because you have vehicles that are 4.5m long that are carrying one person and other vehicles that are three times that length that are carrying 100 people. If you want to keep those 100 people moving then one of the most efficient ways of doing it is to get the incredibly wasteful vehicles carrying only 1 person out of the way.

Now, this is problematic. If you do it before you have decent bus routes set up for people to switch to then there will be a lot of resistance. You clearly need to hit a critical point to make it doable. And obviously you need some exceptions. But *something* like it is inevitable as people get more concentrated together. You simply cannot fit everyone in the roads if they are using cars, you need something more compact than that.

Interesting Links for 30-05-2025

May. 30th, 2025 12:00 pm

Photo cross-post

May. 29th, 2025 11:14 am
andrewducker: (Default)
[personal profile] andrewducker


Gideon's nursery had photos taken. I like them.
Original is here on Pixelfed.scot.

Profile

xiphmont: (Default)
xiphmont

Most Popular Tags