News for hackers. Stuff that matters.
Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @10:36AM (#29781747)
> Do you mean the XOR encryption used? As someone working on the embedded linux(!= than embedded MCU) side i was very surprised to find such a crude "encryption" scheme employed.

I'm not a cryptographer - but I don't think there's anything wrong with XOR encryption, and I'm not sure why you're putting it in scare-quotes - XOR with a sufficiently large key is absolutely fine, and with a one-time pad is unbreakable. XOR with very large keys is how critical military encryption systems such as radios work.

Re:Hacking a VW Golf Power Steering ECU by marcan_42 on Monday January 03, 2022 @01:23PM (#29784199)
> I'm not a cryptographer - but I don't think there's anything wrong with XOR encryption

When cryptographers and security professionals talk about XORing the keystream output of a pseudorandom function with plaintext to encrypt it, we don't call it "XOR encryption", we call it a stream cipher.

When we talk about XORing with a random pad of equal length to the plaintext, we don't call it "XOR encryption", we call it a one-time pad.

When we say "XOR encryption" we invariably mean "silly insecure thing with a repeating keystream no longer than a few bytes".

> XOR with a sufficiently large key is absolutely fine

It isn't. XOR with any key ever used more than once or looped around isn't not just "not unbreakable", it's demonstrably insecure. There is no "sufficiently large key" other than "same size as the plaintext and used only once for that plaintext" (a one time pad). To use smaller keys you need real cryptography, not XOR. Military radios absolutely do not work like this. They use stream ciphers, which can produce ~arbitrary length keystreams without repetition from a small seed key.

Re:Hacking a VW Golf Power Steering ECU by monocasa on Monday January 03, 2022 @11:29AM (#29782468)
I think they mean using XOR with a repeated fixed tiny key _as_ the stream cipher, rather than just using XOR to mix the keystream and the plaintext.

These ECUs aren't using one time pads with key lengths the same size as the firmware. I doubt they're using one time pads at all, which would necessitate each version of firmware using a different key.

Re:Hacking a VW Golf Power Steering ECU by ptsneves on Monday January 03, 2022 @11:27AM (#29782444)
The article's XOR key was 0xFF :) Definitely out of the sufficiently large key range.
Re:Hacking a VW Golf Power Steering ECU by formerly_proven on Monday January 03, 2022 @10:47AM (#29781900)
I'm assuming they meant XOR-ECB with a block size of 1/2/4 bytes.
Re:Hacking a VW Golf Power Steering ECU by heavenlyblue on Monday January 03, 2022 @01:20PM (#29784157)
> XOR with a sufficiently large key is absolutely fine, and with a one-time pad is unbreakable

Excuse me, how do you envision the use of one-time pads in the real world?

And with sufficiently large block keys - how do you deal with data full of zeros? Because XOR of 0 will give you the exact key you have encrypted the data with.

You are not a cryptographer, and indeed, I don’t think you’ve spent enough time thinking about it.

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @01:30PM (#29784324)
> Excuse me, how do you envision the use of one-time pads in the real world?

You load up as much one-time pad as you will have data to transmit - sometimes hundreds of MB of key if required. Storage is cheap.

Re:Hacking a VW Golf Power Steering ECU by danachow on Monday January 03, 2022 @01:46PM (#29784568)
Hundreds of Megabytes? That’s a big number to you? Did you step out of a time warp from 1990?

Also you are surprisingly quite clueless about basic crypto if you think storage is the biggest issue with practically using one time pads (though it is indeed one). I’m pretty sure even the Wikipedia article can explain this so no reason to spoon feed it here.

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @01:52PM (#29784642)
> Hundreds of Megabytes? That’s a big number to you?

If you only have a hundred MB of data to send… a hundred MB of key is sufficient to use as a one-time pad.

Until digitisation the military literally did encryption over radios using physical pads - everyone carried a big one-time-pad (just a few tens of KB though). It was done as a lookup table rather than an XOR though.

Re:Hacking a VW Golf Power Steering ECU by monocasa on Monday January 03, 2022 @03:16PM (#29786106)
The pad system used by the military predigitisation[0] was a set of keys to input into a keystream generator rather than a strict one time pad style system, except for very specific and limited espionage use cases. And it wouldn't be one time, it'd be on the order of a daily key rotation with key reuse (with maybe a few chosen per day depending on classification level).

[0] I'm assuming we mean computerized here. Old school cipher machines of the type of the ENIGMA and M-209 were arguably digital machines, just base ~26.

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @03:50PM (#29786679)
> I'm assuming we mean computerized here

No, pre common man-pack digital radios, so as recently as just prior to this century. They used paper one-time pads, with a big list of table indices for substitution. You still get them for use when you have no digital crypto for whatever reason.

Re:Hacking a VW Golf Power Steering ECU by monocasa on Monday January 03, 2022 @04:36PM (#29787283)
That's not quite what I'm seeing, instead that what I believe you're talking about (Morse code over open air with a Diana cipher backed by one time pads) were pretty much exclusively used by special forces in Vietnam. The issues with key distribution inherent in one time pads otherwise got in the way of cross team cooperation too much since each pad would only exist in two places (the spec ops team, and a major base close by, but not a FOB in case it was overrun).

They might have taught that use case to radio operator MOSs, but it wasn't actually deployed in the general case it seems.

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @04:49PM (#29787443)
> That's not quite what I'm seeing ... it wasn't actually deployed in the general case

I'm was literally trained in the British variant of technique I'm describing. There's a wikipedia article about it, and it's referenced from this cryptography wiki's one-time-pad page. Other countries used similar systems.

https://en.wikipedia.org/wiki/BATCO

https://cryptography.fandom.com/wiki/One-time_pad

Re:Hacking a VW Golf Power Steering ECU by monocasa on Monday January 03, 2022 @06:08PM (#29788380)
So if I'm understanding BATCO correctly, there's an average key reuse by a single sender after 13 messages because of the how the traffic key rotation selects a row? That, combined with the sense I'm getting that the cipher sheets were distributed widely (auth tables imply multiple senders using the same cipher sheet at the same time) seems to imply broad reuse of key rows, making it a pad, but not a one time pad. Do my assumptions filing in the blanks line up?

I'll give it that's it's definitely way better than DRYAD, which is pretty universally not considered a OTP because of the much greater key reuse (like how auth uses the same cipher tables as encrypt, leaking tables). So it boils down to the practical use case on whether it falls into OTP.

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @06:17PM (#29788487)
Yes entire radio net is moving through the shared pad together - so you when you send you consume a bit of the pad, and when someone sends to you they use the next bit of the pad, then you use the next, etc.

A new row per message means you don't re-use between messages (message is something like a sentence).

Each message should be short enough that you don't re-use (a 22-symbol message is already crazy), and you are not allowed to re-use if that means re-using a target symbol, but yes you might slightly re-use within messages if you're being sloppy.

In reality you don't get through the pad very quickly due to the 'compression' of a dictionary for typical parts of messages.

(This is all public info, not disclosing anything here.)

Re:Hacking a VW Golf Power Steering ECU by markus_zhang on Monday January 03, 2022 @11:10AM (#29782219)
> XOR with very large keys is how critical military encryption systems such as radios work.

Is it that large keys are factors of very large prime numbers so that to know the keys you will need a very powerful computer?

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @11:14AM (#29782262)
XOR with a one-time pad doesn't work off factors of large numbers - you're thinking of asymmetric encryption there. You literally just XOR each plain text byte with a key byte.
Re:Hacking a VW Golf Power Steering ECU by markus_zhang on Monday January 03, 2022 @12:08PM (#29783061)
Thanks! I don't know much about cryptography and will check this out.
Re:Hacking a VW Golf Power Steering ECU by ncmncm on Monday January 03, 2022 @02:07PM (#29784874)
There are only two factors of any prime number, large or otherwise: 1 and the number.

But even correcting to what you must have meant to suggest doesn't make sense.

Re:Hacking a VW Golf Power Steering ECU by markus_zhang on Monday January 03, 2022 @03:30PM (#29786362)
Sorry I meant something else, can't wrap my head around to recall the name...
Re:Hacking a VW Golf Power Steering ECU by j4hdufd8 on Monday January 03, 2022 @11:00AM (#29782073)
> XOR with very large keys is how critical military encryption systems such as radios work.

Cool! Do you have any references?

Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @11:08AM (#29782185)
For example the TETRA standard for trunked radio, "The key stream bits shall be modules 2 added (XORed) with plain text bits in data, speech and control channels".
Re:Hacking a VW Golf Power Steering ECU by fanf2 on Monday January 03, 2022 @12:58PM (#29783860)
In the TETRA specification they use the term “key stream” to mean the output of a stream cipher, which they call a “key stream generator”. They aren’t XORing directly with a large key - the TETRA key size is 80 bits. See section 6.3.2.2 of https://www.etsi.org/deliver/etsi_en/300300_300399/30039207/...
Re:Hacking a VW Golf Power Steering ECU by chrisseaton on Monday January 03, 2022 @01:14PM (#29784073)
Yes you can programatically generate a key.
Re:Hacking a VW Golf Power Steering ECU by marcan_42 on Monday January 03, 2022 @01:24PM (#29784224)
And we call that a stream cipher, not "XOR encryption", even though it uses a XOR operation. You're programmatically generating a keystream, which is not the same thing as a key.
Re:Hacking a VW Golf Power Steering ECU by ncmncm on Monday January 03, 2022 @02:10PM (#29784920)
See, this is why we can't have secure things.