5 ms·
> 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
by chrisseaton 5y ago
> 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.
- formerly_proven 5y agoI'm assuming they meant XOR-ECB with a block size of 1/2/4 bytes.
- j4hdufd8 5y ago> XOR with very large keys is how critical military encryption systems such as radios work. Cool! Do you have any references?
- chrisseaton 5y agoFor 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".
- fanf2 5y agoIn 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/02.01.01_60/en_30039207v020101p.pdf https://www.etsi.org/deliver/etsi_en/300300_300399/30039207/...
- chrisseaton 5y agoYes you can programatically generate a key.
- markus_zhang 5y ago> 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?
- chrisseaton 5y agoXOR 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.
- markus_zhang 5y agoThanks! I don't know much about cryptography and will check this out.
- ncmncm 5y agoThere 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.
- markus_zhang 5y agoSorry I meant something else, can't wrap my head around to recall the name...
- ptsneves 5y agoThe article's XOR key was 0xFF :) Definitely out of the sufficiently large key range.
- monocasa 5y agoI 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.
- deleted 5y ago[deleted]
- heavenlyblue 5y ago> 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.
- chrisseaton 5y ago> 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.
- danachow 5y agoHundreds 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.
- chrisseaton 5y ago> 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.
- monocasa 5y agoThe 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.
- marcan_42 5y ago> 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.