World Library  
Flag as Inappropriate
Email this Article

Rolling code

Article Id: WHEBN0004468184
Reproduction Date:

Title: Rolling code  
Author: World Heritage Encyclopedia
Language: English
Subject: HomeLink Wireless Control System, Remote control
Publisher: World Heritage Encyclopedia

Rolling code

A rolling code (or sometimes called a hopping code) is used in keyless entry systems to prevent replay attacks, 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.


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

Application in RF remote control

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.

Rolling code vs. fixed code RF remote control

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.


HCS301 chip from an Audi A6 keyless entry remote, which uses a rolling code system

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.[1] In a resyncing situation, the encrypted 32 bits are replaced with a 32-bit seed value.


  1. ^ Microchip (2001), HC301 KeeLoq Code Hopping Encoder, Microchip Technology Inc., DS21143B 

External links

  • How Remote Entry Works; cites successful attack on KeeLoq.
  • Atmel Inc.'s application note AVR411
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.