[go: up one dir, main page]

CN102568062B - Encryption and decryption method for remote controller - Google Patents

Encryption and decryption method for remote controller Download PDF

Info

Publication number
CN102568062B
CN102568062B CN201110299153.7A CN201110299153A CN102568062B CN 102568062 B CN102568062 B CN 102568062B CN 201110299153 A CN201110299153 A CN 201110299153A CN 102568062 B CN102568062 B CN 102568062B
Authority
CN
China
Prior art keywords
encryption
code
data
stage
decryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201110299153.7A
Other languages
Chinese (zh)
Other versions
CN102568062A (en
Inventor
欧建平
秦浩
路影
陈文强
由毅
赵福全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Geely Holding Group Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd
Original Assignee
Zhejiang Geely Holding Group Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Geely Holding Group Co Ltd, Zhejiang Geely Automobile Research Institute Co Ltd filed Critical Zhejiang Geely Holding Group Co Ltd
Priority to CN201110299153.7A priority Critical patent/CN102568062B/en
Publication of CN102568062A publication Critical patent/CN102568062A/en
Application granted granted Critical
Publication of CN102568062B publication Critical patent/CN102568062B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Lock And Its Accessories (AREA)

Abstract

本发明涉及一种高安全性的遥控器加密解密方法。本发明可以解决现有技术安全性不高的问题,其技术方案要点是,高安全性的遥控器加密解密方法包括三个阶段:学习阶段、加密阶段和解密执行阶段,学习阶段:将设定好的序列号和非线性转换表储存入第一数据存储器、第二数据存储器里;中央集控器根据程序设定产生个随机码S,进入加密阶段;加密阶段包括以下步骤:控制芯片将当前读取的计数码、序列号、操作码按照程序设定进行有序排列构成原始数据G0;控制芯片将原始数据G0与非线性转换表做第一次加密运算,得到滚动码G1;控制芯片将滚动码G1与随机码S做第二次加密运算,得到密文F1,然后进入解密执行阶段。本发明能提高遥控器的安全性。

The invention relates to a high-safety remote controller encryption and decryption method. The present invention can solve the problem of low security in the prior art, and the key point of the technical solution is that the high security remote control encryption and decryption method includes three stages: a learning stage, an encryption stage and a decryption execution stage, and the learning stage: the setting A good serial number and nonlinear conversion table are stored in the first data memory and the second data memory; the central centralized controller generates a random code S according to the program setting, and enters the encryption stage; the encryption stage includes the following steps: the control chip converts the current The read count code, serial number, and operation code are arranged in an orderly manner according to the program setting to form the original data G0; the control chip performs the first encryption operation on the original data G0 and the nonlinear conversion table to obtain the rolling code G1; the control chip will The rolling code G1 and the random code S perform the second encryption operation to obtain the ciphertext F1, and then enter the decryption execution stage. The invention can improve the security of the remote controller.

Description

Remote controller encrypting and decrypting method
Technical field
The present invention relates to a kind of encrypting and decrypting method, the encrypting and decrypting method that particularly a kind of applicable automobile remote controllers uses.
Background technology
The means that at present automobile remote controllers is encrypted are divided into and adopt two kinds of hardware encipher and software cryptographies.These two kinds of encryptions all can adopt rolling code to prevent that remote controller is replicated, and reach higher fail safe.But this higher fail safe is all comparatively speaking, once the algorithm of remote controller, parameter are divulged a secret, the remote controller of so same batch will all be decoded, be copied, and for using the car owner of same batch of remote controller, be all a kind of potential threat.Also have this type of safety problem even be widely regarded as now the remote controller of safe employing AES encryption, that is because AES encrypts or other block encryption algorithm all exists key, plaintext and algorithm all by remote controller manufacturer or programming personnel are grasped, cause as long as remote controller manufacturer or the programming personnel of beginning of production are leaked, or, in the time of transmission security key and plaintext, intercepted and captured with same frequency by lawless person, the remote controller of so same batch is easy to will be replicated, crack.
Chinese patent notification number CN2262322 Y, on September 10 1997 day for announcing, a kind of Multi-way wireless remote controller of multi-level encryption, a kind of Multi-way wireless remote controller of multi-level encryption are disclosed, comprise remote control transmitter and receiver of remote-control sytem, described remote control transmitter comprises a radiating circuit; A transistor matrix coding circuit being formed by coding integrated circuit and peripheral cell thereof; Receiver of remote-control sytem comprises a receiving circuit being made up of reception, amplification, demodulation, shaping unit; A decoding circuit; A random coded circuit being formed by switch integrated circuit, microprocessor and peripheral cell thereof; A switching circuit being formed by transistor and peripheral cell thereof; With one by the state latch output circuits for triggering that form with door integrated circuit, latch integrated circuit and peripheral cell.This technical scheme also can provide compared with remote controller, but its main purpose is to be " uniqueness " of remote controller so once its algorithm, parameter that still has remote controller is divulged a secret, the remote controller of so same batch is by the problem of all being decoded, copying.
Summary of the invention
Divulged a secret once the object of the invention is to solve algorithm, the parameter of remote controller in above-mentioned prior art, so remote controller password is cracked, the same batch of simultaneously nearly all problem that remote controller is also cracked simultaneously, provides a kind of encrypting and decrypting method just having compared with automobile remote controllers.
The technical solution adopted for the present invention to solve the technical problems is: a kind of remote controller encrypting and decrypting method, the hardware foundation of described remote controller encrypting and decrypting method is automobile remote controllers and the central controller that matches with automobile remote controllers, described automobile remote controllers comprises control chip, remote controller encrypting and decrypting method comprises three phases: learning phase, encryption stage and deciphering execution phase, wherein
Described learning phase is carried out in the time using automobile remote controllers, in the time that central controller is judged as first with automobile remote controllers communication, enters learning phase,
In learning phase, central controller produces a random code S according to program setting, and central controller is preserved this random code S and carried out communication with automobile remote controllers;
Encryption stage step: control chip produces corresponding command code according to user's operation, command code and the sequence number setting and non-linear conversion table process ordered arrangement and for the first time cryptographic calculation obtain rolling code G1, rolling code G1 and random code S do cryptographic calculation for the second time, obtain ciphertext F1, control chip is to central controller transmission ciphertext F1;
In in the deciphering execution phase, centre central controller reads random code S, and ciphertext F1 is carried out to the inverse operation of cryptographic calculation for the second time, draws rolling code G1; And then rolling code G1 is done to the inverse operation of cryptographic calculation for the first time, then draw command code and sequence number according to data structure;
Central controller judges that according to sequence number whether ciphertext F1 is correct, how correctly executable operations code of ciphertext F1, otherwise refusal executable operations code.
By such setting, even ensured the sequence number that hardware environment of the present invention sets manually in process of production, non-linear conversion table all leaks, still can ensure that the hardware environment in the present invention can not be imitated, because having lacked random code S still cannot complete automobile remote controllers and copy, and random code S is produced at random by central controller, so random code S cannot be by manually normally obtaining, some random code S in same batch of hardware are obtained in the present invention even adopt extremity, but because each random code S is all not identical, so the product of same batch still can ensure safety, improve fail safe of the present invention, and the setting of random code S can complete in other places in nonproductive source completely, during such as this remote controller of purchase, start learning phase by buyer, even if beginning of production malice is leaked like this, also cannot constitute a threat to fail safe of the present invention.
As preferably, on control chip, be electrically connected with oscillating circuit, key circuit and the first data storage, control chip is successively by the first amplifying circuit, the first coupling circuit is electrically connected with the first communicator, control chip is successively by the second amplifying circuit, the second coupling circuit is electrically connected with the second communicator, described central controller is successively by the 3rd amplifying circuit, the 3rd coupling circuit is electrically connected with the 3rd communicator, described central controller is successively by the 4th amplifying circuit, the 4th coupling circuit is electrically connected with the 4th communicator, described central controller is electrically connected with the second data storage.Arrange like this, ensured that the first communicator and the 3rd communicator carry out communication, the second communicator and the 4th communicator carry out communication, and between the first communicator and the second communicator, frequency is different, the situation that there will not be synchronous signal to be intercepted and captured.
As preferably, described remote controller encrypting and decrypting method learning phase step, comprises the following steps:
Learning phase step 1: the sequence number setting and non-linear conversion table are stored in the first data storage, the second data storage;
Learning phase step 2: central controller produces a random code S according to program setting, and central controller is preserved this random code S to the second data storage and carried out communication by the 4th communicator and automobile remote controllers;
Learning phase step 3: automobile remote controllers receives random code S by the second communicator, and deposit this random code S in first data storage;
Learning phase step 4: remote controller encrypting and decrypting method completes learning phase step, enters the encryption stage.
Arrange like this, ensured that random code, sequence number and non-linear conversion table can be read by central controller and control chip.
As preferably, the described encryption stage comprises the following steps:
Encryption stage step 1: control chip produces corresponding command code according to user to the different operating of automobile remote controllers key circuit, and the every operation of key circuit once, control chip reads a count code in from control chip register, then after count code being added to one, again deposit register in, wait for when key circuit operates again, repeat to read;
Encryption stage step 2: control chip carries out ordered arrangement by the current count code reading, sequence number, command code according to program setting and forms initial data G0;
Encryption stage step 3: control chip reads non-linear conversion table from the first data storage, initial data G0 and non-linear conversion table are done cryptographic calculation for the first time by control chip, obtains rolling code G1;
Encryption stage step 4: control chip reads random code S from the first data storage, rolling code G1 and random code S are done cryptographic calculation for the second time by control chip, obtains ciphertext F1, and control chip transmits ciphertext F1 by the first communicator to central controller;
Encryption stage step 5: remote controller encrypting and decrypting method completes encryption stage step, enters the deciphering execution phase.
Arrange like this, ensured command code, count code, sequence number through with the cryptographic calculation for the first time of non-linear conversion table and with the cryptographic calculation for the second time of random code, draw the ciphertext F1 of higher-security
As preferably, the described deciphering execution phase comprises the following steps:
The deciphering execution phase one: central controller receives ciphertext F1 by the 3rd communicator;
The deciphering execution phase two: central controller reads random code S, and ciphertext F1 is carried out to the inverse operation of cryptographic calculation for the second time, draws rolling code G1;
The deciphering execution phase three: central controller reads non-linear conversion table, and central controller is carried out the inverse operation of cryptographic calculation for the first time according to non-linear conversion table to rolling code G1, draws initial data G0;
The deciphering execution phase four: central controller, according to the solution read raw data G0 of data structure, obtains respectively the rear count code of deciphering, the rear sequence number of deciphering, command code;
The deciphering execution phase five: central controller is checked sequence number, when sequence number after deciphering from be stored in sequence number in the second data storage when different, central controller judges this ciphertext F1 mistake, refusal is carried out the deciphering execution phase six, when sequence number after deciphering be stored in sequence number in the second data storage when identical, central controller 20 judges that this ciphertext F1 is correct, carries out the deciphering execution phase six;
Carry out the deciphering execution phase six: central controller is checked the rear count code of deciphering, and after central controller identification deciphering, count code is effective, carry out the deciphering execution phase seven, otherwise refuse to carry out the deciphering execution phase seven;
Carry out the deciphering execution phase seven: count code after deciphering is covered the count code in the second data storage by central controller, performs an action according to command code simultaneously.
Arrange like this, can effectively be decrypted executable operations code to ciphertext F1.
As preferably, the clear data length that described cryptographic calculation is for the first time set is more than or equal to the data length of initial data G0, key data length is more than or equal to the data length of non-linear conversion table, the clear data length that described cryptographic calculation is for the second time set is more than or equal to the data length of rolling code G1, the key data length that described cryptographic calculation is for the second time set is more than or equal to the data length of random code S, carrying out for the first time before cryptographic calculation, adopt the method for data stuffing respectively non-linear conversion table and initial data G0 to be converted to and to meet key data and the clear data that cryptographic calculation requires for the first time, then carry out cryptographic calculation for the first time, carrying out for the second time before cryptographic calculation, adopt the method for data stuffing respectively rolling code G1 and random code S to be converted to and to meet key data and the clear data that cryptographic calculation requires for the second time, the method of described data stuffing is, in the data that need executing data to fill, increased fillibility data reaches and the method for setting data length by program setting, described fillibility data are random number, data 0 or do XOR and draw by extracting part divided data in the data that need executing data to fill.Arrange like this, ensured that the data length of plaintext and key can allow each initial data setting participate in computing, improved fail safe.
As preferably, in the described deciphering execution phase two: central controller reads random code S, draw clear data after ciphertext F1 being carried out to the inverse operation of cryptographic calculation for the second time, central controller is deleted fillibility data according to program setting and is drawn rolling code G1; In the described deciphering execution phase three: central controller reads non-linear conversion table, central controller draws clear data after rolling code G1 being carried out according to non-linear conversion table the inverse operation of cryptographic calculation for the first time, and central controller is deleted fillibility data according to program setting and drawn initial data G0.Arrange like this, deleted fillibility data, accelerated arithmetic speed.
As preferably, described cryptographic calculation for the first time adopts des encryption algorithm, and described cryptographic calculation for the second time adopts AES cryptographic algorithm.DES algorithm is the DSE arithmetic in cryptographic system, Data Encryption Standard is otherwise known as, it is the DSE arithmetic cryptographic algorithm of American I BM company development in 1972, in satisfactory situation, non-linear conversion table in the present invention is the key in standard des encryption algorithm, initial data G0 in the present invention is the plaintext in standard des encryption algorithm, aes algorithm is a kind of block encryption standard that Federal Government adopts, in many ways analyzed and widely the whole world use, in satisfactory situation, random code S in the present invention is the key in standard A ES cryptographic algorithm, rolling code G1 in the present invention is the plaintext in standard A ES cryptographic algorithm, simultaneously cryptographic calculation and cryptographic calculation employing for the second time for the first time be different cryptographic algorithm, reduce the possibility cracking after divulging a secret.
As preferably, described cryptographic calculation for the first time adopts des encryption algorithm, and described cryptographic calculation for the second time adopts des encryption algorithm.Because plaintext, the ciphertext of des encryption algorithm are all 64, so the ciphertext of cryptographic calculation can, directly as expressly participating in cryptographic calculation for the second time, reduce the process of data stuffing for the first time; Equally, because DES algorithm is to hop algorithm, so while carrying out DES decipherment algorithm, also do not need to get rid of invalid data, extract valid data, reduced data transaction link.
As preferably, in the described execution deciphering execution phase six, when being more than or equal to the counting code value being stored in the second data office memory, counting code value after deciphering adds 1 and when being less than or equal to the counting code value being stored in the second data storage and adding rated value, after central controller identification deciphering, count code is effective, carry out the deciphering execution phase seven, otherwise refusal is carried out the deciphering execution phase seven.Arrange like this, increase the verification of count code, further increase fail safe, wherein the setting of rated value can be 1 any integer of being greater than by program setting, here can be set to rated value is 200, and driving to press remote controller because general only needs once, but the generation in order to prevent from repeatedly repeating to press the problems such as remote controller, what rated value can be arranged is slightly large, is 200 can ensure that fail safe also there will not be the problem that repeatedly button cannot operate so rated value is set.
The invention has the beneficial effects as follows: the present invention can improve the fail safe of remote controller effectively, even if ensureing remote controller manufactures source and divulges a secret, the present invention still can ensure the high security of remote controller and not reproducible, even have remote controller to be cracked with in batch remote controller, still can there is higher-security with batch remote controller.
Brief description of the drawings
Fig. 1 is a kind of circuit theory diagrams of automobile remote controllers in the present invention;
Fig. 2 is a kind of circuit theory diagrams of central controller in the present invention;
Fig. 3 is a kind of main flow chart of the present invention;
Fig. 4 is a kind of flow chart in learning stage of the present invention;
Fig. 5 is a kind of flow chart in the stage of encrypting in the present invention;
Fig. 6 is a kind of flow chart of deciphering the execution phase in the present invention.
In figure: 10, control chip, 11, the first data storage, 12, the first amplifying circuit, 13, the first coupling circuit, 14, the first communicator, 15, the second amplifying circuit, 16, the second coupling circuit, 17, the second communicator, 18, key circuit, 19, oscillating circuit, 20, central controller, 21, the second data storage, 22, the 3rd amplifying circuit, 23, the 3rd coupling circuit, 24, the 3rd communicator, 25, the 4th amplifying circuit, 26, the 4th coupling circuit, 27, the 4th communicator.
Embodiment
Below by specific embodiment, and by reference to the accompanying drawings, technical scheme of the present invention is described in further detail.
Embodiment 1:
A kind of remote controller encrypting and decrypting method, in order to realize the method, needs following hardware foundation (referring to accompanying drawing 1), the central controller 20 that comprises battery-powered automobile remote controllers and match with automobile remote controllers.Automobile remote controllers comprises control chip 10, key circuit 18, oscillating circuit 19, the first data storage 11, the first amplifying circuit 12, the first coupling circuit 13, the first communicator 14, the second amplifying circuits 15, the second coupling circuit 16, the second communicator 17.Key circuit 18, oscillating circuit 19 and the first data storage 11 are all electrically connected with control chip 10, control chip 10 is electrically connected with the first communicator 14 by the first amplifying circuit 12 and the first coupling circuit 13 successively, and control chip 10 is electrically connected with the second communicator 17 by the second amplifying circuit 15 and the second coupling circuit 16 successively.On central controller 20, be electrically connected with the second data storage 21(referring to accompanying drawing 2), central controller 20 is electrically connected with the 3rd communicator 24 by the 3rd amplifying circuit 22 and the 3rd coupling circuit 23 successively, is electrically connected successively by the 4th amplifying circuit 25 and the 4th coupling circuit 26 with the 4th communicator 27.Key circuit 18 is that user is operated, 19 of oscillating circuits provide operating frequency, the first data storage 11, the second data storage 21 carries out data storage, control chip 10 in the present embodiment is the single-chip microcomputer with program memory function, central controller 20 is the central controller that lucky company produces, central controller 20 is arranged in car body and carries out communication with the interior each equipment of car, between central controller 20 and control chip 10, carry out communication by communicator, the first communicator 14 and the 3rd communicator 24 are high frequency communicator, the second communicator 17 and the 4th communicator 27 are low frequency communication device.
The present invention mainly comprises following three phases (referring to accompanying drawing 3): initialization S1, learning phase S3, encryption stage S4 and deciphering execution phase S5.
First central controller 20 carries out initialization S1, determine the stage according to judging that the register-bit of setting enters: whether use for the first time S2, whether the first use in the present embodiment specifically refers to is first and automobile remote controllers carries out communication, and the register-bit here can be carried out free setting according to programming by central controller 20.When central controller 20, according to this register-bit data judging, this time communication is the first communication of central controller 20 and automobile remote controllers, and the present invention enters learning phase S3, and meanwhile, central controller 20 is preserved the register-bit numerical value negate by program setting; When central controller 20, according to this register-bit data judging, this time communication is not the first communication of central controller 20 and automobile remote controllers, and the present invention enters encryption stage S4.
Learning phase S3 comprises the following steps:
Learning phase step 1 S31: the sequence number setting and non-linear conversion table are stored in the first data storage, the second data storage, adopt in the present embodiment central controller 20 to carry out communication by the 3rd communicator 24 with automobile remote controllers, central controller 20 transfers to automobile remote controllers by being stored in 21 li of sequence numbers that set of the second data storage and non-linear conversion table, and sequence number and non-linear conversion table are stored into the first data storage 11 by control chip 10; Non-linear conversion table is in the present embodiment to meet 64 bit data that des encryption algorithm secret key requires;
Learning phase step 2 S32: central controller 20 produces a random code S according to program setting, central controller 20 is preserved this random code S to the second data storage 21 and is carried out communication by the 4th communicator 27 with automobile remote controllers; The length of random code S is 256;
Learning phase step 3 S33: automobile remote controllers receives random code S by the second communicator 17, and deposit this random code S in first data storage 11;
Learning phase step 4 S34: remote controller encrypting and decrypting method completes learning phase step, enters the encryption stage;
Described encryption stage S4 comprises the following steps:
Encryption stage step 1 S41: control chip 10 produces corresponding command code according to user to the different operating of automobile remote controllers key circuit 18, and the every operation of key circuit once, control chip 10 reads the count code in control chip 10 registers, and again deposit register in after then count code being added to one, wait for when key circuit 18 operates again, read; The command code is here carried out free setting by control chip 10 according to programming, and the register-bit here can be carried out free setting according to programming by control chip 10;
Encryption stage step 2 S42: control chip carries out ordered arrangement by the current count code reading, sequence number, command code according to program setting and forms initial data G0; Initial data G0 carries out after being arranged in order by count code, sequence number, command code that shift operation forms in the present embodiment, 64 of initial data G0 deficiency, carry out data stuffing, supplied by data 0, form and meet 64 bit data that expressly require in des encryption algorithm.
Encryption stage step 3 S43: control chip 10 reads non-linear conversion table from the first data storage 11, the initial data G0 and the non-linear conversion table that complete data stuffing are done cryptographic calculation for the first time by control chip, obtains rolling code G1; What cryptographic calculation adopted for the first time is des encryption algorithm, and non-linear conversion table is the key in standard des encryption algorithm, and the initial data G0 in the present invention is the plaintext in standard des encryption algorithm after data stuffing, and the rolling code G1 drawing is 64.
Encryption stage step 4 S44: control chip reads random code S from the first data storage 11, rolling code G1 and random code S are done cryptographic calculation for the second time by control chip, obtain ciphertext F1, control chip transmits ciphertext F1 by the first communicator to central controller; In the present embodiment, cryptographic calculation employing for the second time is aes algorithm, it is wherein 256 as the length of the random code S of key, so the length of program setting key is 256, and can be set as arbitrarily 128,192 or 256 by program as rolling code G1 expressly, in the present embodiment, rolling code G1 forms 256 plaintexts that meet aes algorithm after data stuffing, wherein fillibility data can also can be filled or copy filling by rolling code G1 for data 0 for random number, adopt data 0 to fill in the present embodiment.
Encryption stage step 5 S45: remote controller encrypting and decrypting method completes encryption stage step, enters the deciphering execution phase;
Deciphering execution phase S5 comprises the following steps:
Deciphering execution phase one S51: central controller 20 receives ciphertext F1 by the 3rd communicator 24;
Deciphering execution phases two S52: central controller 20 reads random code S, and ciphertext F1 is carried out to the inverse operation of cryptographic calculation for the second time, draws rolling code G1; As key, ciphertext F1 is carried out to AES decipherment algorithm by random code S, draw after padding data the plaintext of 256, then will inquire about according to desired location, by rolling code G1 extraction, draw rolling code G1;
Deciphering execution phase Three S's 53: central controller 20 reads non-linear conversion table, and central controller 20 is carried out the inverse operation of cryptographic calculation for the first time according to non-linear conversion table to rolling code G1, draws initial data G0; Be central controller 20 using rolling code G1 as ciphertext, using non-linear conversion table as key, carry out DES decipherment algorithm, the plaintext drawing is shifted and removes after the calculating of filler, draw initial data G0
Deciphering execution phases four S54: central controller 20, according to the solution read raw data G0 of data structure, obtains respectively the rear count code of deciphering, the rear sequence number of deciphering, command code; Central controller 20, according to order and the position of inserting the data such as count code, sequence number, command code, is read the rear count code of deciphering, the rear sequence number of deciphering, command code;
Deciphering execution phases five S55: central controller 20 is checked sequence number, then enters and judges the stage: whether carry out deciphering execution phase step 6 S56; When sequence number after deciphering be stored in sequence number in the second data storage 21 when different, central controller 20 judge this ciphertext F1 mistake, refusal is carried out and is deciphered execution phases six S57, deciphers the execution phase to finish S50; When sequence number after deciphering be stored in sequence number in the second data storage 21 when identical, central controller 20 judge that this ciphertext F1 is correct, execution phases six S57 is deciphered in execution;
Carry out deciphering execution phases six S57: central controller 20 is checked the rear count code of deciphering, then enters and judges the stage: whether carry out deciphering execution phase step 7 S58; When being more than or equal to the counting code value being stored in the second data office memory 21, counting code value after deciphering adds 1 and when being less than or equal to the counting code value being stored in the second data storage 21 and adding 200, after central controller 20 is assert deciphering, count code is effective, carry out deciphering execution phases seven S59, otherwise refusal is carried out deciphering execution phases seven S59, and the deciphering execution phase finishes S50;
Carry out deciphering execution phases seven S59: count code after deciphering is covered the count code being stored in the second data storage 21 by central controller 20, performs an action according to command code simultaneously.
Embodiment 2:
Basic hardware basis is identical with embodiment 1, difference be in, the first communicator 14 and the 3rd communicator 24 are low frequency communication device, the second communicator 17 and the 4th communicator 27 are high frequency communicator.
Embodiment 3:
The present embodiment is substantially the same manner as Example 1, and difference is in random code S in the present embodiment and meets 64 bit data that DES algorithm secret key requires, and comprises the key of 56 and 8 additional bit parity check positions, so also there is following difference:
The encryption stage step 4 S44 that do not coexist of the first place: control chip reads random code S from the first data storage 11, rolling code G1 and random code S are done cryptographic calculation for the second time by control chip, obtain ciphertext F1, control chip transmits ciphertext F1 by the first communicator to central controller; In the present embodiment, cryptographic calculation employing for the second time is DES algorithm, it is wherein 64 as the length of the random code S of key, and be also 64 as rolling code G1 expressly, so in the present embodiment, rolling code G1 does not need padding data can form 64 plaintexts that meet DES algorithm.
Second place's difference is to decipher execution phases two S52: central controller 20 reads random code S, and ciphertext F1 is carried out to the inverse operation of cryptographic calculation for the second time, draws rolling code G1; As key, ciphertext F1 is carried out to AES decipherment algorithm by random code S, draw expressly and be 64 rolling code G1 without extracted data.
Embodiment 4:
The present embodiment is substantially the same manner as Example 1, difference is in the present embodiment, the clear data length that cryptographic calculation is set is for the first time greater than the data length of initial data G0, key data length is more than or equal to the data length of non-linear conversion table, the clear data length that described cryptographic calculation is for the second time set is greater than the data length of rolling code G1, the key data length that cryptographic calculation is set is for the second time greater than the data length of random code S, carrying out for the first time before cryptographic calculation, adopt the method for data stuffing respectively non-linear conversion table and initial data G0 to be converted to and to meet key data and the clear data that cryptographic calculation requires for the first time, then carry out cryptographic calculation for the first time, carrying out for the second time before cryptographic calculation, adopt the method for data stuffing respectively rolling code G1 and random code S to be converted to and to meet key data and the clear data that cryptographic calculation requires for the second time, fillibility data in the present embodiment are all to do XOR by extracting part divided data in the data that need executing data to fill to draw.
Above-described embodiment is preferably scheme of one of the present invention, not the present invention is done to any pro forma restriction, also has other variant and remodeling under the prerequisite that does not exceed the technical scheme that claim records.

Claims (10)

1.一种遥控器加密解密方法,其特征在于:所述遥控器加密解密方法的硬件基础为汽车遥控器以及与汽车遥控器相匹配的中央集控器(20),所述的汽车遥控器包括控制芯片(10),遥控器加密解密方法包括三个阶段:学习阶段、加密阶段和解密执行阶段,其中, 1. A remote control encryption and decryption method, characterized in that: the hardware basis of the remote control encryption and decryption method is a car remote control and a central centralized controller (20) that matches the car remote control, and the car remote control Including the control chip (10), the remote control encryption and decryption method includes three stages: learning stage, encryption stage and decryption execution stage, wherein, 所述的学习阶段在使用汽车遥控器时执行,当中央集控器(20)判断为首次与汽车遥控器通讯时,进入学习阶段, The learning phase is executed when using the car remote control, and when the central controller (20) judges that it communicates with the car remote control for the first time, it enters the learning phase, 在学习阶段中,中央集控器(20)根据程序设定产生个随机码S,中央集控器(20)保存此随机码S并与汽车遥控器进行通讯; In the learning stage, the central centralized controller (20) generates a random code S according to the program setting, and the central centralized controller (20) saves the random code S and communicates with the car remote control; 加密阶段步骤:控制芯片(10)根据使用者的操作产生相应的操作码,操作码、设定好的序列号以及非线性转换表经过有序排列和第一次加密运算得到滚动码G1,滚动码G1与随机码S做第二次加密运算,得到密文F1,控制芯片(10)向中央集控器(20)传输密文F1; Steps in the encryption stage: the control chip (10) generates the corresponding operation code according to the user's operation, the operation code, the set serial number and the nonlinear conversion table are arranged in an orderly manner and the first encryption operation is performed to obtain the rolling code G1, and the rolling code G1 is obtained after rolling The code G1 and the random code S are encrypted for the second time to obtain the ciphertext F1, and the control chip (10) transmits the ciphertext F1 to the central controller (20); 解密执行阶段中,中央集控器(20)读取随机码S,对密文F1执行第二次加密运算的逆运算,得出滚动码G1;然后再对滚动码G1做第一次加密运算的逆运算,然后根据数据结构得出操作码和序列号; In the decryption execution stage, the central controller (20) reads the random code S, performs the inverse operation of the second encryption operation on the ciphertext F1, and obtains the rolling code G1; then performs the first encryption operation on the rolling code G1 The inverse operation, and then obtain the operation code and serial number according to the data structure; 中央集控器(20)根据序列号判断密文F1是否正确,如密文F1正确则执行操作码,否则拒绝执行操作码。 The central controller (20) judges whether the ciphertext F1 is correct according to the serial number, and executes the operation code if the ciphertext F1 is correct, otherwise refuses to execute the operation code. 2.根据权利要求1所述的遥控器加密解密方法,其特征在于:控制芯片(10)上电连接有振荡电路(19)、按键电路(18)和第一数据存储器(11),控制芯片(10)依次通过第一放大电路(12)、第一耦合电路(13)与第一通讯器(14)电连接,控制芯片(10)依次通过第二放大电路(15)、第二耦合电路(16)与第二通讯器(17)电连接,所述的中央集控器(20)依次通过第三放大电路(22)、第三耦合电路(23)与第三通讯器(24)电连接,所述的中央集控器(20)依次通过第四放大电路(25)、第四耦合电路(26)与第四通讯器(27)电连接,所述的中央集控器(20)电连接有第二数据存储器(21)。 2. The remote control encryption and decryption method according to claim 1, characterized in that: the control chip (10) is electrically connected to an oscillating circuit (19), a key circuit (18) and a first data memory (11), and the control chip (10) The first amplifying circuit (12) and the first coupling circuit (13) are electrically connected to the first communicator (14) in turn, and the control chip (10) is sequentially passing through the second amplifying circuit (15) and the second coupling circuit (16) is electrically connected to the second communicator (17), and the central centralized controller (20) is electrically connected to the third communicator (24) through the third amplifying circuit (22), the third coupling circuit (23) and the third communicator (24). connection, the central centralized controller (20) is electrically connected to the fourth communicator (27) through the fourth amplifying circuit (25), the fourth coupling circuit (26) in turn, and the central centralized controller (20) The second data storage (21) is electrically connected. 3.根据权利要求2所述的遥控器加密解密方法,其特征在于:所述的学习阶段,包括以下步骤: 3. The remote controller encryption and decryption method according to claim 2, characterized in that: the learning stage comprises the following steps: 学习阶段步骤一:将设定好的序列号和非线性转换表储存入第一数据存储器(11)、第二数据存储器(21)里; Step 1 of the learning stage: store the set serial number and nonlinear conversion table in the first data memory (11) and the second data memory (21); 学习阶段步骤二:中央集控器(20)根据程序设定产生个随机码S,中央集控器(20)保存此随机码S至第二数据存储器(21)并通过第四通讯器(27)与汽车遥控器进行通讯; Step 2 of the learning stage: the central centralized controller (20) generates a random code S according to the program setting, and the central centralized controller (20) saves the random code S to the second data memory (21) and passes it through the fourth communicator (27 ) to communicate with the car remote control; 学习阶段步骤三:汽车遥控器通过第二通讯器(17)接收到随机码S,并将此随机码S存入第一数据存储器(11); Step 3 of the learning stage: the car remote control receives the random code S through the second communicator (17), and stores the random code S into the first data memory (11); 学习阶段步骤四:遥控器加密解密方法完成学习阶段步骤,进入加密阶段。 Step 4 of the learning phase: Encryption and decryption method of the remote controller Complete the steps of the learning phase and enter the encryption phase. 4.根据权利要求2所述的遥控器加密解密方法,其特征在于:所述的加密阶段包括以下步骤: 4. The remote controller encryption and decryption method according to claim 2, characterized in that: the encryption stage comprises the following steps: 加密阶段步骤一:控制芯片(10)根据使用者对汽车遥控器按键电路(18)的不同操作产生相应的操作码,并且按键电路(18)每操作一次,控制芯片(10)即从控制芯片(10)寄存器中读取一个计数码,然后将计数码加一后重新存入寄存器,等到按键电路(18)再次操作时,进行重复读取; Step 1 of the encryption stage: the control chip (10) generates corresponding operation codes according to the different operations of the user on the button circuit (18) of the car remote control, and every time the button circuit (18) is operated, the control chip (10) is automatically activated from the control chip. (10) Read a counting code in the register, then add one to the counting code and store it in the register again, and repeat the reading when the button circuit (18) is operated again; 加密阶段步骤二:控制芯片(10)将当前读取的计数码、序列号、操作码按照程序设定进行有序排列构成原始数据G0; Step 2 of the encryption stage: the control chip (10) arranges the currently read count code, serial number, and operation code in an orderly manner according to the program settings to form the original data G0; 加密阶段步骤三:控制芯片(10)从第一数据存储器(11)中读取非线性转换表,控制芯片(10)将原始数据G0与非线性转换表做第一次加密运算,得到滚动码G1; Step 3 of the encryption stage: the control chip (10) reads the nonlinear conversion table from the first data memory (11), and the control chip (10) performs the first encryption operation on the original data G0 and the nonlinear conversion table to obtain a rolling code G1; 加密阶段步骤四:控制芯片(10)从第一数据存储器(11)中读取随机码S,控制芯片(10)将滚动码G1与随机码S做第二次加密运算,得到密文F1,控制芯片(10)通过第一通讯器(14)向中央集控器(20)传输密文F1; Step 4 of the encryption stage: the control chip (10) reads the random code S from the first data memory (11), and the control chip (10) performs a second encryption operation on the rolling code G1 and the random code S to obtain the ciphertext F1, The control chip (10) transmits the ciphertext F1 to the central controller (20) through the first communicator (14); 加密阶段步骤五:遥控器加密解密方法完成加密阶段步骤,进入解密执行阶段。  Step 5 of the encryption stage: the encryption and decryption method of the remote controller completes the steps of the encryption stage and enters the decryption execution stage. the 5.根据权利要求3所述的遥控器加密解密方法,其特征在于:所述的解密执行阶段包括以下步骤: 5. The remote control encryption and decryption method according to claim 3, characterized in that: the decryption execution stage comprises the following steps: 解密执行阶段一:中央集控器(20)通过第三通讯器(24)接收密文F1; Decryption execution stage 1: the central controller (20) receives the ciphertext F1 through the third communicator (24); 解密执行阶段二:中央集控器(20)读取随机码S,对密文F1执行第二次加密运算的逆运算,得出滚动码G1; Decryption execution stage two: the central controller (20) reads the random code S, performs the inverse operation of the second encryption operation on the ciphertext F1, and obtains the rolling code G1; 解密执行阶段三:中央集控器(20)读取非线性转换表,中央集控器(20)根据非线性转换表对滚动码G1执行第一次加密运算的逆运算,得出原始数据G0; Decryption execution stage three: the central centralized controller (20) reads the nonlinear conversion table, and the central centralized controller (20) performs the inverse operation of the first encryption operation on the rolling code G1 according to the nonlinear conversion table to obtain the original data G0 ; 解密执行阶段四:中央集控器(20)根据数据结构的解读原始数据G0,分别获取解密后计数码、解密后序列号、操作码; Decryption execution stage 4: The central centralized controller (20) interprets the original data G0 according to the data structure, and obtains the decrypted counter code, decrypted serial number, and operation code respectively; 解密执行阶段五:中央集控器(20)核对序列号,当解密后序列号与存储在第二数据存储器(21)中的序列号不同时,中央集控器(20)判断此密文F1错误,拒绝执行解密执行阶段六,当解密后序列号与存储在第二数据存储器(21)中的序列号相同时,中央集控器(20)判断此密文F1正确,执行解密执行阶段六; Decryption execution stage five: the central centralized controller (20) checks the serial number, and when the decrypted serial number is different from the serial number stored in the second data storage (21), the central centralized controller (20) judges the ciphertext F1 Error, refuse to execute the decryption execution stage six, when the serial number after decryption is the same as the serial number stored in the second data storage (21), the central controller (20) judges that the ciphertext F1 is correct, and executes the decryption execution stage six ; 执行解密执行阶段六:中央集控器(20)核对解密后计数码,中央集控器(20)认定解密后计数码有效,则执行解密执行阶段七,否则拒绝执行解密执行阶段七; Execute decryption execution stage six: the central centralized controller (20) checks the count code after decryption, and the central centralized controller (20) determines that the decrypted count code is valid, then executes decryption execution stage seven, otherwise refuses to execute decryption execution stage seven; 执行解密执行阶段七:中央集控器(20)将解密后计数码覆盖第二数据存储器(21)中的计数码,同时根据操作码执行动作。 Execute decryption execution stage seven: the central centralized controller (20) overwrites the decrypted count code with the count code in the second data memory (21), and at the same time executes an action according to the operation code. 6.根据权利要求5所述的遥控器加密解密方法,其特征在于:所述的第一次加密运算设定的明文数据长度大于等于原始数据G0的数据长度,密钥数据长度大于等于非线性转换表的数据长度,所述的第二次加密运算设定的明文数据长度大于等于滚动码G1的数据长度,所述的第二次加密运算设定的密钥数据长度大于等于随机码S的数据长度,在执行第一次加密运算前,采用数据填充的方法分别将非线性转换表和原始数据G0转换为符合第一次加密运算要求的密钥数据和明文数据,然后进行第一次加密运算,在执行第一次加密运算前,采用数据填充的方法分别将滚动码G1和随机码S转换为符合第二次加密运算要求的密钥数据和明文数据,所述数据填充的方法为:由程序设定在需执行数据填充的数据上增加填充性数据达到设定数据长度,所述填充性数据为随机数、数据0或是由需执行数据填充的数据中抽取部分数据做异或运算得出。 6. The remote control encryption and decryption method according to claim 5, characterized in that: the length of the plaintext data set by the first encryption operation is greater than or equal to the data length of the original data G0, and the length of the key data is greater than or equal to the non-linear The data length of the conversion table, the plaintext data length set by the second encryption operation is greater than or equal to the data length of the rolling code G1, the key data length set by the second encryption operation is greater than or equal to the random code S Data length, before the first encryption operation is performed, the non-linear conversion table and the original data G0 are respectively converted into key data and plaintext data that meet the requirements of the first encryption operation by means of data filling, and then the first encryption is performed Operation, before the first encryption operation is performed, the rolling code G1 and the random code S are respectively converted into key data and plaintext data meeting the requirements of the second encryption operation by means of data filling. The method of data filling is as follows: It is set by the program to add filling data to the data that needs to be filled with data to reach the set data length. The filling data is random number, data 0, or some data is extracted from the data that needs to be filled with data to perform XOR operation inferred. 7.根据权利要求5或6所述的遥控器加密解密方法,其特征在于:在所述的解密执行阶段二中:中央集控器(20)读取随机码S,对密文F1执行第二次加密运算的逆运算后得出明文数据,中央集控器(20)根据程序设定删除填充性数据得出滚动码G1;在所述的解密执行阶段三中:中央集控器(20)读取非线性转换表,中央集控器(20)根据非线性转换表对滚动码G1执行第一次加密运算的逆运算后得出明文数据,中央集控器(20)根据程序设定删除填充性数据得出原始数据G0。 7. The remote control encryption and decryption method according to claim 5 or 6, characterized in that: in the second decryption execution stage: the central controller (20) reads the random code S, and executes the second step on the ciphertext F1 After the inverse operation of the secondary encryption operation, the plaintext data is obtained, and the central centralized controller (20) deletes the filling data according to the program setting to obtain the rolling code G1; in the third decryption execution stage: the central centralized controller (20 ) to read the nonlinear conversion table, the central centralized controller (20) performs the inverse operation of the first encryption operation on the rolling code G1 according to the nonlinear conversion table to obtain plaintext data, and the central centralized controller (20) sets Delete the filling data to get the original data G0. 8.根据权利要求1所述的遥控器加密解密方法,其特征在于:所述的第一次加密运算采用DES加密算法,所述的第二次加密运算采用AES加密算法。 8. The remote control encryption and decryption method according to claim 1, characterized in that: said first encryption operation adopts DES encryption algorithm, and said second encryption operation adopts AES encryption algorithm. 9.根据权利要求2或3或4或5所述的遥控器加密解密方法,其特征在于:所述的第一次加密运算采用DES加密算法,所述的第二次加密运算采用DES加密算法。 9. The encryption and decryption method for remote controller according to claim 2 or 3 or 4 or 5, characterized in that: said first encryption operation adopts DES encryption algorithm, and said second encryption operation adopts DES encryption algorithm . 10.根据权利要求5所述的遥控器加密解密方法,其特征在于:在所述执行解密执行阶段六中,当解密后计数码值大于等于存储在第二数据存储器中的计数码值加1且小于等于存储在第二数据存储器(21)中的计数码值加额定值时,中央集控器(20)认定解密后计数码有效,执行解密执行阶段七,否则拒绝执行解密执行阶段七。 10. The remote control encryption and decryption method according to claim 5, characterized in that: in the sixth execution stage of decryption, when the count value after decryption is greater than or equal to the count value stored in the second data memory plus 1 And when it is less than or equal to the count code value stored in the second data memory (21) plus the rated value, the central centralized controller (20) determines that the decrypted count code is valid, and executes the decryption execution stage seven, otherwise refuses to execute the decryption execution stage seven.
CN201110299153.7A 2011-09-29 2011-09-29 Encryption and decryption method for remote controller Expired - Fee Related CN102568062B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110299153.7A CN102568062B (en) 2011-09-29 2011-09-29 Encryption and decryption method for remote controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110299153.7A CN102568062B (en) 2011-09-29 2011-09-29 Encryption and decryption method for remote controller

Publications (2)

Publication Number Publication Date
CN102568062A CN102568062A (en) 2012-07-11
CN102568062B true CN102568062B (en) 2014-06-18

Family

ID=46413399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110299153.7A Expired - Fee Related CN102568062B (en) 2011-09-29 2011-09-29 Encryption and decryption method for remote controller

Country Status (1)

Country Link
CN (1) CN102568062B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566347A (en) * 2017-08-10 2018-01-09 北京洋浦伟业科技发展有限公司 Rolling code learning detection method and device, equipment and computer-readable recording medium

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104851257B (en) * 2014-12-19 2018-09-14 北汽福田汽车股份有限公司 Remote controler and its method, the device and method thereof for receiving remote controler message, vehicle
CN105120454B (en) * 2015-07-17 2019-07-02 北京奇虎科技有限公司 Information transmission method, networking access method and corresponding terminal
CN105119900B (en) * 2015-07-17 2019-02-26 北京奇虎科技有限公司 Information security transmission method, networking access method and corresponding terminal
US10438431B2 (en) * 2016-06-30 2019-10-08 Integrated Device Technology, Inc. Wireless powered digital lock
CN106869616A (en) * 2017-03-05 2017-06-20 宁波亿拍客网络科技有限公司 A kind of dynamic puzzle-lock, dynamic cipher system and dynamic encryption and decryption system
CN109286487B (en) * 2017-07-19 2021-10-01 杭州海康威视数字技术股份有限公司 A kind of remote control method and system of electronic equipment
CN107395603A (en) * 2017-07-28 2017-11-24 移康智能科技(上海)股份有限公司 The encryption and decryption method of control instruction transmission, terminal device/server
CN107393277A (en) * 2017-08-28 2017-11-24 江苏赫奕科技有限公司 Method of sending and receiving based on low-power consumption safe mode des encryption rolling code
CN107749795B (en) * 2017-10-13 2021-03-30 车展交通器材(台山)有限公司 Automobile remote control method based on rolling code secondary encryption
CN108492413A (en) * 2018-03-15 2018-09-04 广东西雅斯智能科技有限公司 Dynamic password generation method, password generator and password lock

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5898397A (en) * 1996-01-16 1999-04-27 Stanley Home Automation Remote control transmitter and method of operation
CN101457610A (en) 2009-01-05 2009-06-17 许李纳 Non-key system for automobile and communication encrypting method thereof
CN101662363A (en) * 2008-08-30 2010-03-03 怀化学院 Multi-layer rolling code encryption and decryption technology
CN101866534A (en) * 2010-01-29 2010-10-20 中南大学 Automobile remote control keyless access control identity authentication method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231041B2 (en) * 2003-08-19 2007-06-12 General Motors Corporation Method, device, and system for secure motor vehicle remote keyless entry

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5898397A (en) * 1996-01-16 1999-04-27 Stanley Home Automation Remote control transmitter and method of operation
CN101662363A (en) * 2008-08-30 2010-03-03 怀化学院 Multi-layer rolling code encryption and decryption technology
CN101457610A (en) 2009-01-05 2009-06-17 许李纳 Non-key system for automobile and communication encrypting method thereof
CN101866534A (en) * 2010-01-29 2010-10-20 中南大学 Automobile remote control keyless access control identity authentication method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566347A (en) * 2017-08-10 2018-01-09 北京洋浦伟业科技发展有限公司 Rolling code learning detection method and device, equipment and computer-readable recording medium

Also Published As

Publication number Publication date
CN102568062A (en) 2012-07-11

Similar Documents

Publication Publication Date Title
CN102568062B (en) Encryption and decryption method for remote controller
US4264782A (en) Method and apparatus for transaction and identity verification
KR950001729B1 (en) How to provide a remote call system
EP2382536B1 (en) System and methods for encryption with authentication integrity
CN110098923B (en) Method and equipment for generating and verifying temporary password
CN108055235B (en) A smart lock control method, related equipment and system
CN100559751C (en) Pseudo public key encryption method and system
JPS6014353B2 (en) digital signature device
CN106056713B (en) A remote authorization method for password lock
CN103886659B (en) Electronic security equipment and control method thereof
CN101588236B (en) Protecting device, system and method for transmitting contents safely
CN105184929A (en) Intelligent door lock control method and device
CN108868367B (en) Smart lock device
CN106972926A (en) A kind of encrypting and decrypting method, the apparatus and system of wireless automobile key
CN105006051A (en) Wireless communication method and system of intelligent remote control door lock
CN102970676A (en) Method for processing original data, internet of thing system and terminal
CN102903226B (en) Data transmission method for communication of intelligent electric meters
CN104868995B (en) Coding convention controls formula authenticating method and coding convention controls formula enciphered method
CN100459495C (en) Password dynamic enciphering inputmethod of public emipering mode
CN101265769A (en) Password distant control lock control system based on AES cryptographic algorithm and control method
CN107749795B (en) Automobile remote control method based on rolling code secondary encryption
CN107579824B (en) Automobile remote control method based on rolling code
CN109961545A (en) Intelligent door lock and its wireless telecommunications plaintext data encryption and decryption approaches
CN100461669C (en) Public key code hopping safety system and method
CN109743162A (en) An Encryption Method for Identity Attribute Matching Using Ideal Lattice Operations

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140618