Inside a VW Golf Key Fob: How a Rolling Code Actually Works (and Why It Keeps the Car Safe)

Inside a VW Golf Key Fob: How a Rolling Code Actually Works (and Why It Keeps the Car Safe)
On this page

This is the companion write-up to my latest video, where I opened up the key fob of my own 2011 VW Golf and watched its signal on a software-defined radio. The video shows the idea in a couple of minutes; this post is the deeper, slower explanation that would not fit on screen — how the signal is built, what every part of it does, and why simply recording it gets an attacker nowhere. If you are into car electronics, RF, or ethical hacking, this is the long version for you. Everything here was captured from my own car, for research and learning.

Overview of a 96-bit VW Golf key fob frame captured at 434 MHz
One full press from the fob, captured at 434 MHz and decoded into 96 bits. It always splits into the same three zones.

First, what the key fob is actually doing

Before we touch a single bit, here is the plain picture. Your key fob is a tiny radio transmitter. When you press a button it sends a short burst on the 434 MHz band — a slice of radio spectrum set aside across much of the world for low-power remotes like this. There is no Wi‑Fi, no Bluetooth and no pairing handshake in the moment: the fob simply shouts a short message into the air and trusts that the car is listening nearby.

The message is sent with the simplest radio signalling there is, called OOK — on‑off keying. The transmitter is switched fully on for a 1 and off for a 0. On top of that the fob uses Manchester encoding, where every bit is sent as a transition — low‑to‑high or high‑to‑low — rather than a flat level. That looks like extra effort, but it earns two things: the average power stays steady, and the receiver can recover the timing from the signal itself, so the car keeps its place in the stream even when the two clocks are not perfectly matched. On my Golf each chip is about 294.6 microseconds long, which works out to roughly 1.7 kilobits per second. Slow by computer standards — but the whole message is tiny, so it is sent and finished in a blink.

The 96‑bit frame, zone by zone

Decode that burst and you get a frame that is exactly 96 bits long. Every press of every button has the same shape, and it divides into three zones:

  • Bits 0–24 — the car’s fixed ID. Think of it as the car’s phone number. On mine it is 0x578E7F, and it never changes — not between presses, not between buttons, not from one year to the next. Every fob is tied to one car, so this is how the car knows the message is meant for it and not for the identical VW parked next to it.
  • Bits 25–89 — the rolling code. This is the heart of the whole system: about 65 bits that are almost completely different every single time you press. Not nudged up by one, not lightly shuffled — rewritten. This is the part that makes recording the signal pointless, and in a moment you will see exactly why.
  • Bits 90–95 — the button code. Six bits that just say which button you pressed. On my car lock is 101010, unlock is 110001, and trunk is 011100. For a given button, these six bits stay put.

What one button press looks like

When you press a button, the fob does not send the frame just once. It repeats the identical frame several times in a row, so that even with interference or a bad moment of timing the car is almost sure to catch at least one clean copy. Within that single press, every repeat is byte‑for‑byte the same — you can see the copies stacked up in the capture below.

A single LOCK press showing the same 96-bit frame repeated several times
A single LOCK press: the exact same frame, repeated a few times inside one burst for reliability.

What “rolling” actually means

Here is the part that trips people up. If the code is different every time, how does the car tell a genuine press from random noise — or from an old recording? The answer is a shared secret and a counter.

When your fob was paired to the car, both sides were handed the same secret key, and both keep a counter that ticks up by one every time you press a button. The fob never sends that counter in the open. Instead it feeds the counter and the secret key through a one‑way calculation and transmits the scrambled result — and that result is the rolling code you see in the middle of the frame. The car runs the very same calculation with its own copy of the key and its own counter. If the two results line up, the press is real.

Two practical details make it work in the real world:

  • Each code is accepted once. The car only honours a code whose counter is at, or just ahead of, where it expects. Play an old one back and its counter is now behind the car’s — so it is rejected on sight.
  • There is a resync window. Because you sometimes press the fob out of range — in your pocket, across the car park — the car tolerates the counter having jumped ahead by a handful of presses, then catches back up. That is why bashing the button a few times far from the car never locks you out.

Why this defeats a replay attack

Now put it together. Within one press the frames are identical — but across presses, the fixed ID and the button code hold perfectly still while that middle rolling block changes completely and never repeats. The car keeps its own counter and accepts each code only once.

So a signal that someone recorded earlier is already expired the moment your car hears your real press: the counter has moved on and the old code is behind the line. Passively recording the fob from a distance — the attack that used to open older fixed‑code remotes instantly — simply is not enough to clone this one. That is the entire point of a rolling code, and in the coloured data further down you can watch it happen line by line.

So is a rolling‑code car impossible to beat?

It is worth being honest rather than selling a myth. Rolling code solves one specific problem extremely well: it kills the simple “record and replay” trick that worked on the fixed‑code remotes of the 1990s. If all someone does is capture your signal from across the street, that capture is worthless.

No single mechanism makes a car unbreakable, though, and researchers have poked at these systems for years. The weak points that remain are generally about protecting the secret key and the wider system — not about replaying a captured code — which is exactly why manufacturers guard that key and keep improving the maths behind it. And a different technology entirely, keyless “comfort access” where the car unlocks just because the key is nearby, has its own well‑known soft spot: relay attacks, where two people quietly pass the key’s signal between them. Rolling code does nothing about that, because no button is ever pressed. If your car has keyless entry, a cheap signal‑blocking pouch for the key at home is the simple, sensible defence.

To be clear about the spirit of this: the post is here to help you understand how the protection works, not to get around it. Everything shown was captured from my own vehicle, for learning.

The decoded data, zone by zone

Enough theory — here is the real thing, straight off my own fob. I have coloured the three zones so the pattern jumps out: the blue fixed ID and the green button code never move, while the amber rolling block is different on every single line. These exact codes are long expired — my car counted past them the instant I pressed — so they are here purely to show the structure.

Fixed ID — bits 0–24Rolling code — bits 25–89Button — bits 90–95

LOCK (button 101010)

010101111000111001111111110011001101001000101111110111110100000000111111101000111101101011101010  = 578E7FCCD22FDF403FA3DAEA
010101111000111001111111111101111000010111010000110111010110011001111000100101110001111111101010  = 578E7FF785D0DD6678971FEA
010101111000111001111111100100010000100101101100001001110101101000000110000001011001000011101010  = 578E7F91096C275A060590EA

UNLOCK (button 110001)

010101111000111001111111100011001000011001000000001100101110011100111011010110110010011011110001  = 578E7F8C864032E73B5B26F1
010101111000111001111111101011110000110000011000111100000100011011010011100011000000010101110001  = 578E7FAF0C18F046D38C0571
010101111000111001111111100110111011100011100010100011011011111001111101111001111110001001110001  = 578E7F9BB8E28DBE7DE7E271

TRUNK (button 011100)

010101111000111001111111100100001000111010001011010101010001101001101000100001001010000001011100  = 578E7F908E8B551A6884A05C
010101111000111001111111101011110111101100111011010000111001011010001111111111010011000111011100  = 578E7FAF7B3B43968FFD31DC
010101111000111001111111111101010100110101101100000000110011111000110100010100001001101111011100  = 578E7FF54D6C033E34509BDC

Download the full decoded capture (.txt) — every press, with the complete 96‑bit payload and hex for each.


If you found this interesting, the full teardown is on my YouTube channel, and there is plenty more like it — car electronics, RF, and ethical hacking — across the blog. Have a look around, and if there is a system you want me to pull apart next, tell me.

Written by

Taifun Mamedov

Taifun Mamedov, founder and lead instructor of Ocsaly Academy. 570,000+ students, 26 courses on Udemy, published Packt author. Working hands-on with car electronics, car hacking, digital forensics and software defined radio since 2017.

Courses by Taifun Mamedov

Share this article