The first remotes always sent the same fixed code. Someone with a receiver could record it and play it back later: the so-called replay attack. Rolling code, or hopping code, was created to close this gap. The Rolling code entry describes its history and main schemes.
How it works
- The remote and the control unit share a secret key and a counter.
- With each press the remote increments the counter and encrypts the value with the key.
- The control unit decrypts the message and checks that the counter is later than the last one received.
- If the code is valid it executes the command and updates its own counter; a code already used is rejected.
The acceptance window
If you press the remote away from the car, the counter moves on but the control unit does not know. To avoid locking up, the unit accepts codes within a certain window of later values. If there have been too many presses out of range, a resynchronisation procedure described in the handbook is needed.

Limits and known attacks
Rolling code makes simple replay useless, but a technique combining jamming and recording has been demonstrated: the thief jams the first press, records the code, and when the owner presses again uses the code that has not yet been used. That is why it is important to always check that the car has responded, as explained in the guide on jammers.
Beyond rolling code: challenge-response
The most advanced systems, also used in immobiliser transponders and keyless keys, do not just use a counter: the car sends a random challenge and the key must calculate the correct answer. A recorded answer is useless for the next challenge.
Tip
If you buy an aftermarket alarm, check that the remote uses rolling code or encryption and that lost remotes can be deleted from the control unit’s memory.
Frequently asked questions
What happens if I press the remote away from the car?
The remote’s counter moves on, but the control unit still accepts codes within a window of later values. Only after a great many presses out of range may the resynchronisation procedure in the handbook be needed.
Is rolling code impossible to break?
It makes simple recording and replay useless, but techniques combining jamming and recording are known. Always checking that the car has responded to the command remains the simplest defence.
Sources and further reading
- Rolling codeen.wikipedia.org


