Rolling code: Difference between revisions

Content deleted Content added
External links: Update broken link
Tags: Mobile edit Mobile web edit
 
(44 intermediate revisions by 34 users not shown)
Line 1:
{{short description|Changing keyless entry code for extra security}}
A '''rolling code''' (or sometimes called a '''hopping code''') is used in [[keyless entry]] systems to prevent [[replay attack]]s, where an [[Eavesdropping|eavesdropper]] records the transmission and replays it at a later time to cause the receiver to 'unlock'.
{{redirect| Hopping code || frequency-hopping spread spectrum }}
 
A '''rolling code''' (or sometimes called a '''hopping code''') is used in [[keyless entry]] systems to prevent a simple form of [[replay attack]]s, where an [[Eavesdropping|eavesdropper]] records the transmission and replays it at a later time to cause the receiver to 'unlock'. Such systems are typical in [[garage door opener]]s and keyless car entry systems.
Such systems are typical in [[garage door opener]]s and keyless car entry systems. The most widely spread algorithm for code hopping systems today is [[KeeLoq]].{{Citation needed|date = December 2008}}
 
== Techniques ==
 
* Common PRNG ([[Pseudopseudorandom Randomnumber Number Generatorgenerator]]) — preferably [[Cryptographically secure pseudorandom number generator|cryptographically secure]] — in both transmitter and receiver
* Transmitter sends 'next' code in sequence
* Receiver compares 'next' to its calculated 'next' code.
* A typical implementation compares within the next 256 codes in case receiver missed some transmitted keypresses.
 
[[HMAC-based one-time password]] employed widely in [[multi-factor authentication]] uses similar approach, but with pre-shared secret key and [[HMAC]] instead of PRNG and pre-shared [[random seed]].
== Application in RF Remote Control ==
 
== Application in RF Remoteremote Controlcontrol ==
A rolling code transmitter is useful in a security system for providing secure encrypted [[radio frequency]] (RF) transmission comprising an interleaved trinary bit fixed code and rolling code. A receiver demodulates the encrypted RF transmission and recovers the fixed code and rolling code. Upon comparison of the fixed and rolling codes with stored codes and determining that the signal has emanated from an authorized transmitter, a signal is generated to actuate an electric motor to open or close a movable component.
 
A rolling code transmitter is useful in a security system for providingimproving securethe encryptedsecurity of [[radio frequency]] (RF) transmission, comprising an interleaved trinary bit fixed code and rolling code. A receiver demodulates the encrypted RF transmission and recovers the fixed code and rolling code. Upon comparison of the fixed and rolling codes with stored codes and determiningseeing that thethey signalpass hasa emanatedset fromof analgorithmic authorized transmitterchecks, a signal is generated to actuate an electric motor to open or close a movable component.{{citation-needed|date=November 2023}}
 
== Rolling code vs. fixed code RF remote control ==
 
Remote controls send a digital code word to the receiver. If the receiver determines the codeword is acceptable, then the receiver will actuate the relay, unlock the door, or open the barrier. Simple remote control systems use a fixed code word; the code word that opens the gate today will also open the gate tomorrow. An attacker with an appropriate receiver could discover the code word and use it to gain access sometime later. More sophisticated remote control systems use a rolling code (or hopping code) that changes for every use. An attacker may be able to learn the code word that opened the door just now, but the receiver will not accept that code word for the foreseeable future. A rolling code system uses cryptographic methods that allow the remote control and the receiver to share codewords but make it difficult for an attacker to break the cryptography.
[[File:Rolling-code-rf-remote-control-2.png|thumb|200px|this is a typical inner photo of audi a6 car keyless entry remote, which uses rolling-code technology chip HCS301 to enhance transmission security.]]
 
== KeeLoq ==
Remote controls send signals in code. When the sending code is the same as the code which is expected by the receiver, then the receiver will actuate the relay, unlock the door, or open the barrier. Remote controls with a fixed code always send the same fixed code. Remote controls with a rolling code (or hopping code) always send out a different code from the one previously sent.
[[File:Rolling-code-rf-remote-control-2.png|thumb|200pxupright|thisHCS301 ischip afrom typicalan inner[[Audi photo of audi a6 carA6]] keyless entry remote, which uses a rolling- code technology chip HCS301 to enhance transmission security.system]]
 
== Typical Rolling code System - KeeLoq ==
{{main|KeeLoq}}
 
The Microchip HCS301 was once the most widely used system on garage and gate remote control and receivers. The chip uses the KeeLoq algorithm. The HCS301 KeeLoq system transmits 66 data bits.:
* 34 bits are not encrypted : a 28-bit serial number, 4 bits of button information, and 2 status bits (repeat and low battery indicators).
* 32 bits are encrypted (the rolling code) : 4 bits of button information, 2 bits of OVR (used to extend counter value), 10 bits of DISC (discrimination value; often the low 10 bits of the serial number), and a 16-bit counter.<ref>{{Citation |last=Microchip |title=HC301 KeeLoq Code Hopping Encoder |year=2001 |id=DS21143B |publisher=Microchip Technology Inc. |___location= |url=http://ww1.microchip.com/downloads/en/devicedoc/21143b.pdf}}</ref><ref>{{cite web|url=https://garagedoorpitt.com/garage-door-remote-not-working-reasons/|title=Garage Door Remote Not Working Reasons| date=4 November 2021 }}</ref> In a resyncing situation, the encrypted 32 bits are replaced with a 32-bit seed value.
 
As detailed at [[KeeLoq]], the algorithm has been shown to be vulnerable to a variety of attacks, and has been completely [[Broken (cryptography)|broken]].
 
== Rolljam vulnerability ==
A rolling code transmitted by radio signal that can be intercepted can be vulnerable to falsification. In 2015, it was reported that [[Samy Kamkar]] had built an inexpensive electronic device about the size of a wallet that could be concealed on or near a locked vehicle to capture a single keyless entry code to be used at a later time to unlock the vehicle. The device transmits a jamming signal to block the vehicle's reception of rolling code signals from the owner's fob, while recording these signals from both of his two attempts needed to unlock the vehicle. The recorded first code is forwarded (replayed) to the vehicle only when the owner makes the second attempt, while the recorded second code is retained for future use. Kamkar stated that this vulnerability had been widely known for years to be present in many vehicle types, but was previously undemonstrated.<ref name="RollinCode">{{cite news | title=A hacker made a $30 gadget that can unlock many cars that have keyless entry | url=http://www.techinsider.io/samy-kamkar-keyless-entry-car-hack-2015-8 | work=[[Tech Insider]] | first=Cadie | last=Thompson | date=2015-08-06 | access-date=2015-08-11}}</ref> A demonstration was done during [[DEF CON]] 23.<ref name="DC23">{{cite web | title=Drive It Like You Hacked It: New Attacks and Tools to Wirelessly Steal Cars | url=https://www.defcon.org/html/defcon-23/dc-23-speakers.html#Kamkar | work=[[DEF CON]] 23 | first=Samy | last=Kamkar | date=2015-08-07 | access-date=2015-08-11}}</ref>
 
== References ==
Line 32 ⟶ 39:
==External links==
* [http://auto.howstuffworks.com/remote-entry1.htm How Remote Entry Works]; cites successful attack on KeeLoq.
* Atmel Inc.'s application note [httphttps://wwwww1.atmelmicrochip.com/Imagesdownloads/aemDocuments/documents/OTH/ApplicationNotes/ApplicationNotes/Atmel-2600-AVR411-Secure-Rolling-Code-Algorithm-for-Wireless-Link_Application-Note.pdf AVR411][[Category:Automotive technologies]]
 
[[Category:Radio electronics]]