ArticleslgStudy

science

Rolling code

Rolling code is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Rolling code rather than just read about it. In short: A rolling code (or sometimes called a hopping code) is used in keyless entry systems to prevent a simple form of replay attack, where an eavesdropper records the transmission and replays it at a later time to cause the receiver to 'unlock'. Such systems are typical in garage door openers and keyless car entry systems.

Rolling code — main illustration
Rolling code — illustration

Key takeaways

  • Rolling code belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Rolling code to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Rolling code from memory before moving on to harder problems.

Reference excerpt

A rolling code (or sometimes called a hopping code) is used in keyless entry systems to prevent a simple form of replay attack, where an eavesdropper records the transmission and replays it at a later time to cause the receiver to 'unlock'. Such systems are typical in garage door openers and keyless car entry systems.

Techniques Common PRNG (pseudorandom number generator) — preferably 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 A rolling code transmitter is useful in a security system for improving the security 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 seeing that they pass a set of algorithmic checks, a signal is generated to actuate an electric motor to open or close a movable component.

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.

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. 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.

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. A demonstration was done during DEF CON 23.

References

External links How Remote Entry Works; cites successful attack on KeeLoq. Atmel Inc.'s application note AVR411

Worked examples

Example 1 — a first encounter with Rolling code

Start with the simplest possible case. Write down what Rolling code claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Rolling code before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Rolling code ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Rolling code

In research
Rolling code appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Rolling code in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Rolling code is common in secondary-school and first-year university syllabi. It links to neighbouring topics Automotive technologies, Radio electronics, so understanding it makes those chapters shorter.
In everyday life
Look for Rolling code outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Rolling code in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Rolling code means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Rolling code out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Rolling code in simple terms?

A rolling code (or sometimes called a hopping code) is used in keyless entry systems to prevent a simple form of replay attack, where an eavesdropper records the transmission and replays it at a later time to cause the receiver to 'unlock'. Such systems are typical in garage door openers and keyles…

Why does Rolling code matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Rolling code?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Rolling code.

Tags

  • Automotive technologies
  • Radio electronics

Keep exploring