KeeLoq
   HOME

TheInfoList



OR:

KeeLoq is a proprietary hardware-dedicated
block cipher In cryptography, a block cipher is a deterministic algorithm that operates on fixed-length groups of bits, called ''blocks''. Block ciphers are the elementary building blocks of many cryptographic protocols. They are ubiquitous in the storage a ...
that uses a non-linear feedback shift register (NLFSR). The uni-directional command transfer protocol was designed by Frederick Bruwer of Nanoteq (Pty) Ltd., the cryptographic algorithm was created by Gideon Kuhn at the
University of Pretoria The University of Pretoria (, ) is a multi-campus public university, public research university in Pretoria, the administrative and ''de facto'' capital of South Africa. The university was established in 1908 as the Pretoria campus of the Johan ...
, and the silicon implementation was by Willem Smit at Nanoteq (Pty) Ltd (
South Africa South Africa, officially the Republic of South Africa (RSA), is the Southern Africa, southernmost country in Africa. Its Provinces of South Africa, nine provinces are bounded to the south by of coastline that stretches along the Atlantic O ...
) in the mid-1980s. KeeLoq was sold to
Microchip Technology Inc Microchip Technology Incorporated is a publicly listed American semiconductor corporation that manufactures microcontroller, mixed-signal, analog, and Flash-IP integrated circuits. Its corporate headquarters is located in Chandler, Arizona. I ...
in 1995 for $10 million. It is used in ' hopping code' encoders and decoders such as NTQ105/106/115/125D/129D, HCS101/2XX/3XX/4XX/5XX and MCS31X2. KeeLoq has been used in many remote keyless entry systems by such companies like
Chrysler FCA US, LLC, Trade name, doing business as Stellantis North America and known historically as Chrysler ( ), is one of the "Big Three (automobile manufacturers), Big Three" automobile manufacturers in the United States, headquartered in Auburn H ...
,
Daewoo Daewoo ( ; ; ; ; literally "great universe" and a portmanteau of "''dae''" meaning great, and the given name of founder and chairman Kim Woo-choong) also known as the Daewoo Group, was a major South Korean chaebol (type of conglomerate) and aut ...
,
Fiat Fiat Automobiles S.p.A., commonly known as simply Fiat ( , ; ), is an Italian automobile manufacturer. It became a part of Fiat Chrysler Automobiles in 2014 and, in 2021, became a subsidiary of Stellantis through its Italian division, Stellant ...
, Ford,Researchers Crack KeeLoq Code for Car Keys
WIRED Wired may refer to: Arts, entertainment, and media Music * ''Wired'' (Jeff Beck album), 1976 * ''Wired'' (Hugh Cornwell album), 1993 * ''Wired'' (Mallory Knox album), 2017 * "Wired", a song by Prism from their album '' Beat Street'' * "Wired ...
. Retrieved 2024-05-21.
GM,
Honda commonly known as just Honda, is a Japanese multinational corporation, multinational Conglomerate (company), conglomerate automotive manufacturer headquartered in Minato, Tokyo, Japan. Founded in October 1946 by Soichiro Honda, Honda has bee ...
,
Mercedes-Benz Mercedes-Benz (), commonly referred to simply as Mercedes and occasionally as Benz, is a German automotive brand that was founded in 1926. Mercedes-Benz AG (a subsidiary of the Mercedes-Benz Group, established in 2019) is based in Stuttgart, ...
,
Toyota is a Japanese Multinational corporation, multinational Automotive industry, automotive manufacturer headquartered in Toyota City, Aichi, Japan. It was founded by Kiichiro Toyoda and incorporated on August 28, 1937. Toyota is the List of manuf ...
,
Volvo The Volvo Group (; legally Aktiebolaget Volvo, shortened to AB Volvo, stylized as VOLVO) is a Swedish multinational manufacturing corporation headquartered in Gothenburg. While its core activity is the production, distribution and sale of truck ...
,
Volkswagen Group Volkswagen AG (), known internationally as the Volkswagen Group, is a German public multinational conglomerate manufacturer of passenger and commercial vehicles, motorcycles, engines and turbomachinery. Headquartered in Wolfsburg, Lower Saxon ...
, Clifford, Shurlok, and
Jaguar The jaguar (''Panthera onca'') is a large felidae, cat species and the only extant taxon, living member of the genus ''Panthera'' that is native to the Americas. With a body length of up to and a weight of up to , it is the biggest cat spe ...
.


Description

KeeLoq "code hopping" encoders encrypt a 0-filled 32-bit block with KeeLoq cipher to produce a 32-bit " hopping code". A 32-bit
initialization vector In cryptography, an initialization vector (IV) or starting variable is an input to a cryptographic primitive being used to provide the initial state. The IV is typically required to be random or pseudorandom, but sometimes an IV only needs to be un ...
is linearly added (
XOR Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (one ...
ed) to the 32
least significant bit In computing, bit numbering is the convention used to identify the bit positions in a binary number. Bit significance and indexing In computing, the least significant bit (LSb) is the bit position in a binary integer representing the lowes ...
s of the key prior to
encryption In Cryptography law, cryptography, encryption (more specifically, Code, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the inf ...
and after
decryption In cryptography, encryption (more specifically, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the information, known as plai ...
. KeeLoq cipher accepts 64-bit keys and encrypts 32-bit blocks by executing its single-bit NLFSR for 528 rounds. The NLFSR feedback function is 0x3A5C742E or :F(a,b,c,d,e) = d \oplus e \oplus ac \oplus ae \oplus bc \oplus be \oplus cd \oplus de \oplus ade \oplus ace \oplus abd \oplus abc KeeLoq uses bits 1, 9, 20, 26 and 31 of the NLFSR state as its inputs during encryption and bits 0, 8, 19, 25 and 30 during decryption. Its output is linearly combined (XORed) with two of the bits of the NLFSR state (bits 0 and 16 on encryption and bits 31 and 15 on decryption) and with a key bit (bit 0 of the key state on encryption and bit 15 of the key state on decryption) and is fed back into the NLFSR state on every round.


Versions

This article describes the Classic KeeLoq protocol, but newer versions has been developed. The Ultimate KeeLoq system is a timer-based algorithm enhancing the Classic KeeLoq system. The goal of this newer version is to contain stronger, industry standard
AES-128 The Advanced Encryption Standard (AES), also known by its original name Rijndael (), is a specification for the encryption of electronic data established by the U.S. National Institute of Standards and Technology (NIST) in 2001. AES is a variant ...
cipher which replaces KeeLoq cipher algorithm, and have a timer-driven counter which continuously increments, which is the opposite of the Classic KeeLoq where the counter increments based on the button press. This provides protection against
brute-force attack In cryptography, a brute-force attack or exhaustive key search is a cryptanalytic attack that consists of an attacker submitting many possible keys or passwords with the hope of eventually guessing correctly. This strategy can theoretically be ...
and capture and
replay attack A replay attack (also known as a repeat attack or playback attack) is a form of network attack in which valid data transmission is maliciously or fraudulently repeated or delayed. This is carried out either by the originator or by an adversary w ...
, known as RollJam for Samy Kamkar's work.


Attacks


Replay attack

For simplicity, individual "code hopping" implementations typically do not use
cryptographic nonce In cryptography, a nonce is an arbitrary number that can be used just once in a cryptographic communication. It is often a random or pseudo-random number issued in an authentication protocol to ensure that each communication session is unique, ...
s or
timestamping A timestamp is a sequence of characters or encoded information identifying when a certain event occurred, usually giving date and time of day, sometimes accurate to a small fraction of a second. Timestamps do not have to be based on some absolu ...
. This makes the protocol inherently vulnerable to
replay attack A replay attack (also known as a repeat attack or playback attack) is a form of network attack in which valid data transmission is maliciously or fraudulently repeated or delayed. This is carried out either by the originator or by an adversary w ...
s: For example, by jamming the channel while intercepting the code, a thief can obtain a code that may still be usable at a later stage. This sort of "code grabber," while theoretically interesting, does not appear to be widely used by car thieves. A detailed description of an inexpensive prototype device designed and built by
Samy Kamkar Samy Kamkar (born December 10, 1985) is an American privacy and security researcher, computer hacker and entrepreneur. At the age of 16, he dropped out of high school. One year later, he co-founded Fonality, a unified communications company bas ...
to exploit this technique appeared in 2015. The device about the size of a wallet could be concealed on or near a locked vehicle to capture a single keyless entry code to be used at a later time to unlock the vehicle. The device transmits a jamming signal to block the vehicle's reception of rolling code signals from the owner's fob, while recording these signals from both of his two attempts needed to unlock the vehicle. The recorded first code is forwarded to the vehicle only when the owner makes the second attempt, while the recorded second code is retained for future use. A demonstration was announced for
DEF CON DEF CON (also written as DEFCON, Defcon, or DC) is a Computer security conference, hacker convention held annually in Las Vegas Valley, Las Vegas, Nevada. The first DEF CON took place in June 1993 and today many attendees at DEF CON include comp ...
23.


Cryptanalysis

KeeLoq was first cryptanalyzed by Andrey Bogdanov using sliding techniques and efficient
linear approximation In mathematics, a linear approximation is an approximation of a general function (mathematics), function using a linear function (more precisely, an affine function). They are widely used in the method of finite differences to produce first order ...
s.
Nicolas Courtois Nicolas Tadeusz Courtois (born 14 November 1971) is a cryptographer. He was formerly senior lecturer in computer science at University College London. Courtois was one of the co-authors of both the XSL attack against block ciphers, such as the ...
attacked KeeLoq using sliding and algebraic methods. The attacks by Bogdanov and Courtois do not pose any threat to the actual implementations that seem to be much more vulnerable to simple brute-force of the key space that is reduced in all the code-hopping implementations of the
cipher In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption—a series of well-defined steps that can be followed as a procedure. An alternative, less common term is ''encipherment''. To encipher or encode i ...
known to date. Some KeeLoq "code grabbers" use
FPGA A field-programmable gate array (FPGA) is a type of configurable integrated circuit that can be repeatedly programmed after manufacturing. FPGAs are a subset of logic devices referred to as programmable logic devices (PLDs). They consist of a ...
-based devices to break KeeLoq-based keys by brute force within about two weeks due to the reduced key length in the real world implementations. In 2007, researchers in the
COSIC The Computer Security and Industrial Cryptography research group, commonly called COSIC, is a research group at the Department of Electrical Engineering of KU Leuven, which is headed by Bart Preneel. Research Research and expertise in digital ...
group at the university at
Leuven Leuven (, , ), also called Louvain (, , ), is the capital and largest City status in Belgium, city of the Provinces of Belgium, province of Flemish Brabant in the Flemish Region of Belgium. It is located about east of Brussels. The municipalit ...
,
Belgium Belgium, officially the Kingdom of Belgium, is a country in Northwestern Europe. Situated in a coastal lowland region known as the Low Countries, it is bordered by the Netherlands to the north, Germany to the east, Luxembourg to the southeas ...
, (K.U.Leuven) in cooperation with colleagues from
Israel Israel, officially the State of Israel, is a country in West Asia. It Borders of Israel, shares borders with Lebanon to the north, Syria to the north-east, Jordan to the east, Egypt to the south-west, and the Mediterranean Sea to the west. Isr ...
found a new attack against the system. Using the details of the algorithm that were leaked in 2006, the researchers started to analyze the weaknesses. After determining the part of the key common to cars of a specific model, the unique bits of the key can be cracked with only sniffed communication between the key and the car. Microchip introduced in 1996 a version of KeeLoq ICs which use a 60-bit seed. If a 60-bit seed is being used, an attacker would require approximately 1011 days of processing on a dedicated parallel
brute force attack In cryptography, a brute-force attack or exhaustive key search is a cryptanalytic attack that consists of an attacker submitting many possible Key (cryptography), keys or passwords with the hope of eventually guessing correctly. This strategy can ...
ing machine before the system is broken.


Side-channel attacks

In March 2008, researchers from the Chair for Embedded Security of
Ruhr University Bochum The Ruhr University Bochum (, ) is a public research university located in the southern hills of the central Ruhr area, Bochum, Germany. It was founded in 1962 as the first new public university in Germany after World War II. Instruction began ...
, Germany, presented a complete break of remote keyless entry systems based on the KeeLoq RFID technology. Their attack works on all known car and building access control systems that rely on the KeeLoq cipher. The attack by the Bochum team allows recovering the secret cryptographic keys embedded in both the receiver and the remote control. It is based on measuring the electric power consumption of a device during an encryption. Applying what is called side-channel analysis methods to the power traces, the researchers can extract the manufacturer key from the receivers, which can be regarded as a master key for generating valid keys for the remote controls of one particular manufacturer. Unlike the cryptanalytic attack described above which requires about 65536 chosen plaintext-ciphertext pairs and days of calculation on a PC to recover the key, the side-channel attack can also be applied to the so-called KeeLoq Code Hopping mode of operation (a.k.a.
rolling code A rolling code (or sometimes called a hopping code) is used in keyless entry systems to prevent a simple form of replay attack, where an eavesdropper records the transmission and replays it at a later time to cause the receiver to 'unlock'. Such ...
) that is widely used for keyless entry systems (cars, garages, buildings, etc.). The most devastating practical consequence of the side-channel analysis is an attack in which an attacker, having previously learned the system's master key, can clone any legitimate encoder by intercepting only two messages from this encoder from a distance of up to . Another attack allows one to reset the internal counter of the receiver (garage door, car door, etc.), which makes it impossible for a legitimate user to open the door.


References


External links


Microchip KeeLoq siteIntroduction to Ultimate KeeLoq TechnologyHCSXXX Encoder Family - Product InformationUltimate KeeLoq Technology, the Next Generation of Security - Featuring MCS3142 Dual KeeLoq Encoder
* *
C source code by Ruptor



N.T. Courtois and G.V. Bard, 'Algebraic and Slide Attacks on KeeLoq'
*
Physical Cryptanalysis of KeeLoq code-hopping applications
{{Cryptography navbox , block Block ciphers Broken block ciphers Automotive technology tradenames Radio electronics Vehicle security systems Microchip Technology hardware Garage door openers