INTRODUCTION TO KEELOQ
All KEELOQ encoders use the KEELOQ code hopping
technology to make each transmission by an encoder
unique. The encoder transmissions have two parts.
The ﬁrst part changes each time the encoder is acti-
vated and is called the hopping code part and is
encrypted. The second part is the unencrypted part of
the transmission, principally containing the encoder’s
serial number identifying it to a decoder. Refer to
DS91002, Introduction to KEELOQ.
The hopping code contains function information, a dis-
crimination value, and a synchronization counter. This
information is encrypted by an encryption algorithm
before being transmitted. A 64-bit encryption key is
used by the encryption algorithm. If one bit in the data
that is encrypted changes, the result is that an average
of half the bits in the output will change. As a result, the
hopping code changes dramatically for each transmis-
sion and can not be predicted.
The encoder transmits up to four bits of function infor-
mation. Up to 15 different functions are available.
Stored in the encoder EEPROM, this information can
be used to check integrity of decryption operation by a
decoder. If known information is inserted into the trans-
mitted string before encryption, the same information
can be used at the decoder to check whether the infor-
mation has been decrypted correctly. 12 bits (including
overﬂow bits) are available in the Microchip HCSXXX
The transmitted word contains a 16-bit synchronization
counter. The synchronization information is used at the
decoder to determine whether a transmission is valid or
is a repetition of a previous transmission. Previous
codes are rejected to safeguard against code grabbers.
The HSC300 and HCS301 encoders transmit two over-
ﬂow bits which may be used to extend the range of the
synchronization counter from 65,536 to 196,608 button
operations. The HCS360 and HCS361 encoders trans-
mit one overﬂow bit which can be used to extend the
range of the synchronization counter from 65,536 to
131,071 button operations.
The encoder’s serial number is transmitted every time
the button is pressed. The serial number is transmitted
unencrypted as part of the transmission and serves to
identify the encoder to the decoder.
Other Status and Function Information
The HCS200, HCS300, and HCS301 encoders include
provision for four bits of function information and two
status bits in the ﬁxed code portion of its transmission.
The two status bits indicate whether a repeated trans-
mission is being sent, and whether the battery voltage
is low. The HCS200 does not send repeated transmis-
sion information, and the bit is permanently set to ‘0’.
The HCS360/361 encoders transmit two bits that are
used as a Cyclic Redundancy check. These bits can be
used to check the integrity of the reception. Addition-
ally, the HCS360 and HCS361 encoders can extend
the length of the serial number from 28 bits to 32 bits,
replacing the unencrypted function code.
The Microchip HCSXXX encoders all have the ability to
transmit a ﬁxed seed. The seed value is programmed
into the encoder when the encoder is ﬁrst initialized
along with the counters, key, serial number, and other
information. The seed length differs from encoder to
encoder with the HCS200, HCS300, and HCS301 hav-
ing a 32-bit seed. The HCS360 and HCS361 encoders
have a 48-bit seed. The HCS200, HCS300, and
HCS301 encoders transmit the seed if all the inputs are
activated simultaneously (S0, S1, S2, and S3). The
HCS360 and HCS361 encoders transmit the seed
immediately if S0 and S3 are activated or delayed if S0
and S1 are activated for more than 3 seconds.
Table 1 summarizes seed transmissions in the Micro-
chip HCSXXX encoders
© 1996 Microchip Technology Inc.