Abstract: KEELOQ technology is an important secure encryption and decryption technology, which has the characteristics of multiple changes and resistance to interception. Significant parts of the technology are secret and in the hands of only a few foreign companies. A practical and reliable KEELOQ algorithm is proposed, and the software process for implementing the algorithm is given.
Keywords: KEELOQ technology encryption and decryption synchronization
As a confidential high-tech technology, KEELOQ technology is relatively unfamiliar to many people, but it is widely used in various anti-theft alarm systems (especially vehicle anti-theft alarm systems), remote control electronic locks and other complete control fields. It is a multi-variable, interception-resistant, safe and reliable code-hopping encryption and decryption technology. At present, this advanced technology is only in the hands of a few foreign companies. They use the advantages of integrated circuit design to package this technology in chips and sell it to users. Engineers often find it inconvenient to do some development based on the hardware they provide. KEELOQ technology is actually a complex protocol. As long as you understand its principles, you can choose appropriate parameters in this protocol according to actual needs. This article conducts special research on KEELOQ technology, proposes a software implementation method, and applies this method to car anti-theft alarm systems.
1 General characteristics of KEELOQ technology
As a safe and practical encryption and decryption technology, KEELOQ technology has the following characteristics:
(2) Applying KEELOQ technology to communications has very good security. For the same command, the codeword obtained after KEELOQ encoding is different each time (in a very long period), and this change is irregular.
(2) The code sent by the sender can only be effectively received by a specific object. The receiver can only effectively decrypt the received data after obtaining (through learning) the sender's encryption key in advance.
(3) A specific object can only be used after learning the information of a certain sender.
(4) This technology can prevent the harm caused by the transmission code being intercepted and then forwarded.
(5) The receiving party can clear the learning information it has saved at any time, so that the original sender cannot control itself, which can effectively prevent illegal use by third parties.
It is these characteristics that make KEELOQ technology more and more important and widely used.
2 Hardware implementation of KEELOQ technology
Special chips based on KEELOQ technology are divided into two types: one for encryption and one for decryption, which are usually used together. The chip that implements the encryption function has 4 button interfaces, and can be used in combination to achieve 15 functions. Every time a key is pressed, the KEELOQ encryption password is automatically generated. The composition of the KEELOQ encryption code is generally as follows:
Description | serial number | Key signal | Check Digit | sync counter |
Once the chip is fabricated, the length of the above items is determined. If the length of the serial number is designed to be 28 bits, the capacity of the entire system will not exceed 268435455 (2 28-1), which is very inconvenient if you want to expand the system capacity. This chip must be preset with some initial values (serial number, encryption key, synchronization counter) before use. Before the sender and receiver can work together, the receiver must first learn to obtain and store the sender's serial number, encryption key, and current synchronization counter value. Learning is an important aspect of KEELOQ technology.
The encryption process of hardware implementation of KEELOQ technology is shown in Figure 1.
The serial number is used to identify different objects; the encryption key is used to encrypt the sent data, making it more difficult to decipher, and it is not sent directly; the synchronization counter is used to resist interception. Every time a key is pressed, the synchronization counter The value is updated, encrypted and transformed before being sent.
The hardware implementation of KEELOQ technology decryption process is shown in Figure 2.
After confirming that the sequence numbers match, the receiver decrypts the received data, then checks whether the synchronization counter matches, and then processes the received key signaling after confirming that it matches.
After use, it was discovered that there are the following shortcomings in implementing KEELOQ technology in hardware:
(1) The hardware cost is high. When using the KEELOQ chip, a microcontroller (MCU) is needed to control it. This is more prominent during mass production.
(2) Key signaling must be combined (more than 1 key is pressed at the same time), otherwise there are only 4 functions, and a maximum of 15 functions through combination. This makes pressing buttons inconvenient and making function expansion almost impossible.
(3) The length of the sequence and synchronous counter of a specific type of chip is fixed. After the system is built, if developers want to expand the capacity of the system or improve the performance of the system only through software upgrades, it is basically impossible to implement KEELOQ technology in hardware.
(4) KEELOQ technology only codes the key signaling at the error detection level and does not code at the error correction level.
(5) Limited by hardware design, flexibility is poor; without core technology, it is easy to be controlled by others.
It is these shortcomings that prompt us to study the use of software to implement KEELOQ technology.
3 Software implementation of KEELOQ technology
The core of KEELOQ technology is the KEELOQ algorithm. As an important part of KEELOQ technology, the KEELOQ algorithm is confidential. After a long period of exploration, research, and verification, this article proposed a reliable KEELOQ algorithm and successfully applied it to the car anti-theft alarm system, achieving very good results.
The serial number encryption key uses a 32-bit m sequence. For a user, the encryption key and the serial number are different. Theoretically, the longer the synchronization counter is, the better, but if it is longer, the overhead in other aspects will be greater. Here, a 16-bit m sequence is selected. The car alarm consists of two parts: the part installed on the car body is called the landline phone; the handheld control part is called the mobile phone. In order to save hardware expenses, the mobile phone is designed with only three buttons and no combination buttons. There are a total of 12 button functions. Each key has four states: one click, two clicks, three clicks, and long press. These 12 types of keys are divided into two categories: one is the command control key to control the operation of the landline (including the learning start key), and the other is the operation key of the mobile phone itself. Each time the command control key is pressed, the KEELOQ encryption process is performed. The software implementation KEELOQ encryption operation process is shown in Figure 3.
It is necessary to perform error correction coding on key signaling: Assume that a certain key signaling is 0110. After transmission through the channel, the codeword decrypted by the receiver becomes 0101, and 0101 also represents a valid command. Obviously, the consequences of this misoperation are serious. Encoded with the Walsh code, after encoding, 3 or less errors can be discovered and corrected at the same time; at the same time, according to the characteristics of the encoding, the encryption key is used to transform the encoded key signaling. Experiments show that these measures greatly improve the reliability of the system.
The relevant part of the KEELOQ algorithm is the synchronized counter. As mentioned before, the mobile phone must be preset with a valid serial number, synchronization counter value, and encryption key before being used for the first time. The landline can learn any mobile phone through control. If the learning is successful, the serial number, synchronization counter value and encryption key of the mobile phone will be saved. Each time the command control key is pressed, the value of the mobile phone's synchronization counter increases by 1 (only one bit changes). After passing through the m sequence generator, from a statistical point of view, half of the bits change. After the receiver confirms that the sequence number of the received data matches, it decrypts the received data and then determines whether the synchronization counter matches. Only after the synchronization counter confirms the match, the received key signaling is processed. Figure 4 illustrates the matching process of confirming the synchronization counter.
It should be noted that the above-mentioned single operation range, double operation range, and the length of the synchronous counter can be selected according to actual needs. Since the synchronization counter is very important, the algorithm performs error detection coding on it during processing. The software implementation of KEELOQ decryption operation process is shown in Figure 5.
In KEELOQ technology, learning function is an important part. Learning includes clearing the original stored information and learning new information. It is divided into two types: general learning and safe learning. This article adopts a safe learning method. Clear the information of the original mobile phone by long pressing the learning clear key on the landline (this key has two functions: long pressing is the clearing function, and clicking is entering the learning mode) (the original mobile phone cannot control the landline, and must be learned after To control), click the learning clear button on the base phone. If the original information of the base phone has been cleared, the learning mode will be entered; otherwise, the click is invalid and the learning mode will not be entered. At this time, if the mobile phone sends a learning start command to the landline, the landline in the learning state will immediately send a learning request signal to the mobile phone after receiving the command. After receiving the request signal, the mobile phone will immediately send the transformed encryption key and synchronization counter to the mobile phone. The landline phone will exit the learning state after sending it and save the new encryption key and synchronization counter value; after the landline phone confirms that the data is valid, it will save the encryption key and synchronization counter value and exit the learning mode, and needs to continue learning. The encryption key and synchronization counter sent from the mobile phone to the landline are different each time you learn (change irregularly), which is the main feature of safe learning. For greater security, the landline phone can only learn information from one mobile phone at most. The safe learning operation process is shown in Figure 6.
Previous article:PIC Design of Controllable Digital Speech Delay
Next article:Software optimization design of real-time MPEG-4 encoding based on DSP
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- I really want to give up GoLang
- Digital tube driver advice
- [TI recommended course] #Boost and buck-boost DCDC converters help wireless charging design#
- How does the MCU in a drone work?
- About the cyclone soc network port printing link donw linkup problem
- What kind of AC socket is most suitable for low-power devices
- How to connect the three wires of GND, VCC and Vout to BNC or XLR port?
- High-efficiency PA design: from Class A to Class J (friendly illustrations and text for PA experts)
- This article reveals the Internet of Things, let’s take a look at it.
- Showing off my goods + some boards I have currently stockpiled