▲ | nullc 6 days ago | ||||||||||||||||||||||||||||||||||
Cryptography is actually difficult for the requirements of a key fob. The principle issue is that requiring two way communication greatly increases hardware cost and lowers range/reliability. You also would prefer to minimize or eliminate any volitile storage on the devices. Also you very much want to absolutely minimize the data sent, both for battery life and range/reliability reasons. And whatever volatile storage the devices have you need to have some way of handling it being reset when its lost due to a dead battery or replaced device. So standard replay resistant protocols like "door sends a random challenge, fob signs/decrypts/encrypts it and sends the result" are excluded due to the two-way requirement. The next obvious set is along the lines of "device sends an encrypted counter, door enforces that the counter only goes up" requires nonvol storage in both devices, and then gets tripped up when the fobs counter goes back down due to being reset. (also harder to implement multiple fobs, as they each need unique state). | |||||||||||||||||||||||||||||||||||
▲ | cyberax 6 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||
> Cryptography is actually difficult for the requirements of a key fob. No, it's not. > The next obvious set is along the lines of "device sends an encrypted counter, door enforces that the counter only goes up" That's already how rolling codes work. Running a strong crypto algorithm (even Ascon/Speck would be fine here) requires negligible power. The issue is that this system is still susceptible to jam+replay attack. An attacker can jam the transmitter signal, while recording it at the same time. The user assumes that the button press just didn't register and tries again. The attacker also jams this and records the code. But then the attacker replays the _previous_ code that they stored, keeping the latest code for their future use. This can _also_ be fixed with a simple capacitor-powered timer circuitry, charged during the keypress. The device can stay completely inert at all other times. | |||||||||||||||||||||||||||||||||||
▲ | fc417fc802 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
Agree about the requirements but disagree that it's difficult. Two way communication and a few KiB of nonvolatile storage on the fob shouldn't be a deal breaker when an ESP32 dev board runs under $10 (an ESP32 being massive overkill for the described use case). The device sending an encrypted counter is also trivially easy. There's no reason a modern vehicle can't store hundreds (or thousands, or tens of thousands ...) of { u64 fob_id, u64 fob_key, u64 fob_counter } triplets. Push it up to 128 bits if you're paranoid, it won't have a meaningful impact on resource usage. Case in point regarding the car storing state, the (broken) rolling window algorithm they use requires that the car track the window and accept presses that are out of sync by a decently wide margin. That's likely more complicated and resource intensive than simply enforcing that the nonce only ever goes up. The rational conclusion is that the manufacturers are either incompetent or malicious. I firmly conclude the latter given that the fobs they offer that are actually secure introduce vendor lock in and a charge to replace a key. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
▲ | SoftTalker 6 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||
If only almost everyone carried a computer with a radio and local storage and a good battery with them almost everywhere | |||||||||||||||||||||||||||||||||||
|