rolling code
termKept in this browser · My desk
A remote-control and key-fob scheme in which each button press sends a different code, typically an encrypted counter, so that a recorded transmission cannot simply be replayed; also called a hopping code.
In Microchip's KeeLoq HCS301 encoder, each press produces a 66-bit code word: a 32-bit hopping code holding a 16-bit counter and the buttons, encrypted with a 64-bit key, plus a 28-bit serial number and status bits in clear. Because people press buttons out of range, the receiver accepts a window: up to 16 codes ahead at once, up to 32K codes ahead after a second sequential press, and nothing already used. The underlying United States patent 5,517,187 names Frederick Bruwer, Willem Smit and Gideon Kuhn as inventors and Nanoteq of South Africa as original assignee, with a 1990 priority date.
How it fell. Cryptanalysis broke KeeLoq in 2007 and, practically, at Eurocrypt 2008, where one key-derivation scheme was shown to leak the master secret from a single key; differential power analysis at CRYPTO 2008 cloned remotes from ten power traces and extracted manufacturer keys. Samy Kamkar's RollJam (DEF CON 23, 2015) jammed and captured two presses, replayed the first and kept the second. Rolling-PWN (CVE-2021-46145) and RollBack (2022) abused counter resynchronization so that old codes worked again. Defences. Codes that expire, authenticated actions, per-device keys and two-way challenge and response; Microchip's Ultimate KeeLoq is a timer-based design with AES-128.
Also known as: rolling codes, hopping code, hopping codes, code hopping, keeloq, rolljam, código rolante, código saltitante, codigo rolante
Sources
- Microchip Technology, HCS301 KeeLoq Code Hopping Encoder datasheet DS21143C, 2011 (read 2026-11-16): 66-bit code word, 32-bit hopping code, 28-bit serial number, 64-bit key; learning; synchronization windows of 16 codes (single operation) and 32K (double operation), the rest blocked
- Google Patents, US5517187A (read 2026-11-16): inventors Bruwer, Smit and Kuhn; original assignee Nanoteq Pty Ltd; priority 29 May 1990; published 14 May 1996; Microchip among current assignees
- University of Haifa research portal, A practical attack on KeeLoq, EUROCRYPT 2008 (read 2026-11-16): 2^16 known plaintexts, 2^44.5 encryptions, 7.8 days on 64 cores; one key-derivation scheme leaks the master secret
- University of Lübeck research portal, On the Power of Power Analysis in the Real World, CRYPTO 2008 (read 2026-11-16): remote cloned from ten power traces; manufacturer key extracted; cloning from two eavesdropped messages
- Andy Greenberg, WIRED, This Hacker's Tiny Device Unlocks Cars And Opens Garages, 6 August 2015 (read 2026-11-16): RollJam, a US$32 device that jams, captures and replays rolling codes
- NVD, CVE-2021-46145, published 6 January 2022 (read 2026-11-16): Honda Civic 2012 keyfob replay, 'non-expiring rolling code and counter resynchronization'
- Csikor et al., RollBack, arXiv 2210.11923, 14 September 2022 (read 2026-11-16): replay-and-resynchronize attack without jamming; about 70% of tested makes vulnerable